diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/CHANGELOG.md b/sdk/devcenter/azure-resourcemanager-devcenter/CHANGELOG.md index 127848579336..2c8144616787 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/CHANGELOG.md +++ b/sdk/devcenter/azure-resourcemanager-devcenter/CHANGELOG.md @@ -1,14 +1,288 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-30) + +- Azure Resource Manager DevCenter client library for Java. This package contains Microsoft Azure SDK for DevCenter Management SDK. DevCenter Management API. Package tag package-preview-2025-04-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.StopOnNoConnectEnableStatus` was added -### Bugs Fixed +* `models.DevBoxAutoDeleteSettings` was added -### Other Changes +* `models.DevCenterCatalogImageDefinitionBuildOperations` was added + +* `models.PoolDevBoxDefinition` was added + +* `models.ProjectCatalogImageDefinitions` was added + +* `models.CustomizationTaskInstance` was added + +* `models.DevBoxTunnelEnableStatus` was added + +* `models.ImageDefinition` was added + +* `models.KeepAwakeEnableStatus` was added + +* `models.DevCenterNetworkSettings` was added + +* `models.PoolDevBoxDefinitionType` was added + +* `models.CustomizationTaskInputType` was added + +* `models.AutoImageBuildStatus` was added + +* `models.ProjectPolicyUpdate` was added + +* `models.ProjectPolicy$DefinitionStages` was added + +* `models.DevCenterCatalogImageDefinitionBuilds` was added + +* `models.ImageDefinitionBuildTask` was added + +* `models.UserCustomizationsEnableStatus` was added + +* `models.StopOnNoConnectConfiguration` was added + +* `models.CustomizationTaskListResult` was added + +* `models.DevCenterEncryptionSet$DefinitionStages` was added + +* `models.DevboxDisksEncryptionEnableStatus` was added + +* `models.ImageDefinitionReference` was added + +* `models.ImageDefinitionBuild` was added + +* `models.EncryptionSetListResult` was added + +* `models.DevBoxProvisioningSettings` was added + +* `models.ProjectPolicy$UpdateStages` was added + +* `models.DevCenterEncryptionSet$Definition` was added + +* `models.ProjectPolicy$Update` was added + +* `models.ActiveHoursConfiguration` was added + +* `models.ProjectNetworkSettings` was added + +* `models.ProjectCatalogImageDefinitionBuildOperations` was added + +* `models.ImageDefinitionBuildListResult` was added + +* `models.WorkspaceStorageSettings` was added + +* `models.InheritedSettingsForProject` was added + +* `models.ImageDefinitionBuildTaskParametersItem` was added + +* `models.DevCenterCatalogImageDefinitions` was added + +* `models.EncryptionSetUpdate` was added + +* `models.ServerlessGpuSessionsSettings` was added + +* `models.CustomizationTasks` was added + +* `models.ProjectPolicy` was added + +* `models.LatestImageBuild` was added + +* `models.AzureAiServicesSettings` was added + +* `models.ImageDefinitionListResult` was added + +* `models.DevCenterEncryptionSet$UpdateStages` was added + +* `models.MicrosoftHostedNetworkEnableStatus` was added + +* `models.PolicyAction` was added + +* `models.ImageDefinitionBuildStatus` was added + +* `models.DefinitionParametersItem` was added + +* `models.ImageDefinitionBuildTaskGroup` was added + +* `models.ServerlessGpuSessionsMode` was added + +* `models.DevCenterResourceType` was added + +* `models.ResourcePolicy` was added + +* `models.ProjectPolicy$Definition` was added + +* `models.DevBoxDeleteMode` was added + +* `models.WorkspaceStorageMode` was added + +* `models.ProjectCustomizationIdentityType` was added + +* `models.ProjectPolicyListResult` was added + +* `models.CustomizationTask` was added + +* `models.ProjectCustomizationManagedIdentity` was added + +* `models.ProjectCustomizationSettings` was added + +* `models.AzureAiServicesMode` was added + +* `models.EncryptionSets` was added + +* `models.ProjectCatalogImageDefinitionBuilds` was added + +* `models.AutoStartEnableStatus` was added + +* `models.DevCenterEncryptionSet` was added + +* `models.ImageCreationErrorDetails` was added + +* `models.CustomizationTaskInput` was added + +* `models.InstallAzureMonitorAgentEnableStatus` was added + +* `models.ProjectPolicies` was added + +* `models.DevCenterEncryptionSet$Update` was added + +* `models.ImageDefinitionBuildDetails` was added + +#### `models.DevCenter$Update` was modified + +* `withDevBoxProvisioningSettings(models.DevBoxProvisioningSettings)` was added +* `withNetworkSettings(models.DevCenterNetworkSettings)` was added + +#### `models.DevCenter` was modified + +* `devBoxProvisioningSettings()` was added +* `networkSettings()` was added + +#### `models.DevCenterUpdate` was modified + +* `networkSettings()` was added +* `withDevBoxProvisioningSettings(models.DevBoxProvisioningSettings)` was added +* `withNetworkSettings(models.DevCenterNetworkSettings)` was added +* `devBoxProvisioningSettings()` was added + +#### `models.DevCenter$Definition` was modified + +* `withNetworkSettings(models.DevCenterNetworkSettings)` was added +* `withDevBoxProvisioningSettings(models.DevBoxProvisioningSettings)` was added + +#### `models.Images` was modified + +* `getByProjectWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByProject(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByProject(java.lang.String,java.lang.String)` was added +* `getByProject(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.Project$Update` was modified + +* `withCustomizationSettings(models.ProjectCustomizationSettings)` was added +* `withDevBoxAutoDeleteSettings(models.DevBoxAutoDeleteSettings)` was added +* `withServerlessGpuSessionsSettings(models.ServerlessGpuSessionsSettings)` was added +* `withAzureAiServicesSettings(models.AzureAiServicesSettings)` was added +* `withWorkspaceStorageSettings(models.WorkspaceStorageSettings)` was added + +#### `models.Project` was modified + +* `getInheritedSettings()` was added +* `workspaceStorageSettings()` was added +* `serverlessGpuSessionsSettings()` was added +* `customizationSettings()` was added +* `getInheritedSettingsWithResponse(com.azure.core.util.Context)` was added +* `azureAiServicesSettings()` was added +* `devBoxAutoDeleteSettings()` was added + +#### `models.Projects` was modified + +* `getInheritedSettingsWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getInheritedSettings(java.lang.String,java.lang.String)` was added + +#### `models.Pool$Update` was modified + +* `withStopOnNoConnect(models.StopOnNoConnectConfiguration)` was added +* `withDevBoxDefinition(models.PoolDevBoxDefinition)` was added +* `withActiveHoursConfiguration(models.ActiveHoursConfiguration)` was added +* `withDevBoxDefinitionType(models.PoolDevBoxDefinitionType)` was added +* `withDevBoxTunnelEnableStatus(models.DevBoxTunnelEnableStatus)` was added + +#### `models.Pool` was modified + +* `stopOnNoConnect()` was added +* `devBoxTunnelEnableStatus()` was added +* `activeHoursConfiguration()` was added +* `devBoxDefinition()` was added +* `devBoxDefinitionType()` was added + +#### `DevCenterManager` was modified + +* `devCenterCatalogImageDefinitionBuilds()` was added +* `devCenterCatalogImageDefinitions()` was added +* `customizationTasks()` was added +* `projectCatalogImageDefinitionBuildOperations()` was added +* `encryptionSets()` was added +* `devCenterCatalogImageDefinitionBuildOperations()` was added +* `projectCatalogImageDefinitions()` was added +* `projectPolicies()` was added +* `projectCatalogImageDefinitionBuilds()` was added + +#### `models.PoolUpdate` was modified + +* `devBoxDefinitionType()` was added +* `withDevBoxDefinition(models.PoolDevBoxDefinition)` was added +* `withDevBoxTunnelEnableStatus(models.DevBoxTunnelEnableStatus)` was added +* `devBoxTunnelEnableStatus()` was added +* `withActiveHoursConfiguration(models.ActiveHoursConfiguration)` was added +* `activeHoursConfiguration()` was added +* `withDevBoxDefinitionType(models.PoolDevBoxDefinitionType)` was added +* `withStopOnNoConnect(models.StopOnNoConnectConfiguration)` was added +* `stopOnNoConnect()` was added +* `devBoxDefinition()` was added + +#### `models.Pool$Definition` was modified + +* `withStopOnNoConnect(models.StopOnNoConnectConfiguration)` was added +* `withDevBoxDefinition(models.PoolDevBoxDefinition)` was added +* `withDevBoxDefinitionType(models.PoolDevBoxDefinitionType)` was added +* `withDevBoxTunnelEnableStatus(models.DevBoxTunnelEnableStatus)` was added +* `withActiveHoursConfiguration(models.ActiveHoursConfiguration)` was added + +#### `models.Project$Definition` was modified + +* `withAzureAiServicesSettings(models.AzureAiServicesSettings)` was added +* `withServerlessGpuSessionsSettings(models.ServerlessGpuSessionsSettings)` was added +* `withWorkspaceStorageSettings(models.WorkspaceStorageSettings)` was added +* `withDevBoxAutoDeleteSettings(models.DevBoxAutoDeleteSettings)` was added +* `withCustomizationSettings(models.ProjectCustomizationSettings)` was added + +#### `models.ProjectUpdate` was modified + +* `withDevBoxAutoDeleteSettings(models.DevBoxAutoDeleteSettings)` was added +* `devBoxAutoDeleteSettings()` was added +* `serverlessGpuSessionsSettings()` was added +* `azureAiServicesSettings()` was added +* `workspaceStorageSettings()` was added +* `withAzureAiServicesSettings(models.AzureAiServicesSettings)` was added +* `withServerlessGpuSessionsSettings(models.ServerlessGpuSessionsSettings)` was added +* `customizationSettings()` was added +* `withWorkspaceStorageSettings(models.WorkspaceStorageSettings)` was added +* `withCustomizationSettings(models.ProjectCustomizationSettings)` was added + +#### `models.ImageVersions` was modified + +* `listByProject(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getByProject(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listByProject(java.lang.String,java.lang.String,java.lang.String)` was added +* `getByProjectWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.Skus` was modified + +* `listByProject(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByProject(java.lang.String,java.lang.String)` was added ## 1.0.0 (2024-12-25) diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/README.md b/sdk/devcenter/azure-resourcemanager-devcenter/README.md index 41744c733b6f..ef006ebaa6d0 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/README.md +++ b/sdk/devcenter/azure-resourcemanager-devcenter/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DevCenter client library for Java. -This package contains Microsoft Azure SDK for DevCenter Management SDK. DevCenter Management API. Package tag package-2024-02. 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 DevCenter Management SDK. DevCenter Management API. Package tag package-preview-2025-04-01-preview. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ DevCenterManager manager = DevCenterManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/ - - diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/SAMPLE.md b/sdk/devcenter/azure-resourcemanager-devcenter/SAMPLE.md index 3c0ae8d3e1ae..68844bd576ad 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/SAMPLE.md +++ b/sdk/devcenter/azure-resourcemanager-devcenter/SAMPLE.md @@ -29,6 +29,12 @@ - [Execute](#checkscopednameavailability_execute) +## CustomizationTasks + +- [Get](#customizationtasks_get) +- [GetErrorDetails](#customizationtasks_geterrordetails) +- [ListByCatalog](#customizationtasks_listbycatalog) + ## DevBoxDefinitions - [CreateOrUpdate](#devboxdefinitions_createorupdate) @@ -39,6 +45,23 @@ - [ListByProject](#devboxdefinitions_listbyproject) - [Update](#devboxdefinitions_update) +## DevCenterCatalogImageDefinitionBuildOperation + +- [Cancel](#devcentercatalogimagedefinitionbuildoperation_cancel) +- [Get](#devcentercatalogimagedefinitionbuildoperation_get) +- [GetBuildDetails](#devcentercatalogimagedefinitionbuildoperation_getbuilddetails) + +## DevCenterCatalogImageDefinitionBuilds + +- [ListByImageDefinition](#devcentercatalogimagedefinitionbuilds_listbyimagedefinition) + +## DevCenterCatalogImageDefinitions + +- [BuildImage](#devcentercatalogimagedefinitions_buildimage) +- [GetByDevCenterCatalog](#devcentercatalogimagedefinitions_getbydevcentercatalog) +- [GetErrorDetails](#devcentercatalogimagedefinitions_geterrordetails) +- [ListByDevCenterCatalog](#devcentercatalogimagedefinitions_listbydevcentercatalog) + ## DevCenters - [CreateOrUpdate](#devcenters_createorupdate) @@ -48,6 +71,14 @@ - [ListByResourceGroup](#devcenters_listbyresourcegroup) - [Update](#devcenters_update) +## EncryptionSets + +- [CreateOrUpdate](#encryptionsets_createorupdate) +- [Delete](#encryptionsets_delete) +- [Get](#encryptionsets_get) +- [List](#encryptionsets_list) +- [Update](#encryptionsets_update) + ## EnvironmentDefinitions - [Get](#environmentdefinitions_get) @@ -74,13 +105,17 @@ ## ImageVersions - [Get](#imageversions_get) +- [GetByProject](#imageversions_getbyproject) - [ListByImage](#imageversions_listbyimage) +- [ListByProject](#imageversions_listbyproject) ## Images - [Get](#images_get) +- [GetByProject](#images_getbyproject) - [ListByDevCenter](#images_listbydevcenter) - [ListByGallery](#images_listbygallery) +- [ListByProject](#images_listbyproject) ## NetworkConnections @@ -121,6 +156,23 @@ - [GetErrorDetails](#projectcatalogenvironmentdefinitions_geterrordetails) +## ProjectCatalogImageDefinitionBuildOperation + +- [Cancel](#projectcatalogimagedefinitionbuildoperation_cancel) +- [Get](#projectcatalogimagedefinitionbuildoperation_get) +- [GetBuildDetails](#projectcatalogimagedefinitionbuildoperation_getbuilddetails) + +## ProjectCatalogImageDefinitionBuilds + +- [ListByImageDefinition](#projectcatalogimagedefinitionbuilds_listbyimagedefinition) + +## ProjectCatalogImageDefinitions + +- [BuildImage](#projectcatalogimagedefinitions_buildimage) +- [GetByProjectCatalog](#projectcatalogimagedefinitions_getbyprojectcatalog) +- [GetErrorDetails](#projectcatalogimagedefinitions_geterrordetails) +- [ListByProjectCatalog](#projectcatalogimagedefinitions_listbyprojectcatalog) + ## ProjectCatalogs - [Connect](#projectcatalogs_connect) @@ -140,11 +192,20 @@ - [List](#projectenvironmenttypes_list) - [Update](#projectenvironmenttypes_update) +## ProjectPolicies + +- [CreateOrUpdate](#projectpolicies_createorupdate) +- [Delete](#projectpolicies_delete) +- [Get](#projectpolicies_get) +- [ListByDevCenter](#projectpolicies_listbydevcenter) +- [Update](#projectpolicies_update) + ## Projects - [CreateOrUpdate](#projects_createorupdate) - [Delete](#projects_delete) - [GetByResourceGroup](#projects_getbyresourcegroup) +- [GetInheritedSettings](#projects_getinheritedsettings) - [List](#projects_list) - [ListByResourceGroup](#projects_listbyresourcegroup) - [Update](#projects_update) @@ -160,6 +221,7 @@ ## Skus - [List](#skus_list) +- [ListByProject](#skus_listbyproject) ## Usages @@ -168,26 +230,22 @@ ```java /** - * Samples for AttachedNetworks CreateOrUpdate. + * Samples for NetworkConnections List. */ -public final class AttachedNetworksCreateOrUpdateSamples { +public final class NetworkConnectionsListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/AttachedNetworks_Create. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_ListBySubscription.json */ /** - * Sample code: AttachedNetworks_Create. + * Sample code: NetworkConnections_ListBySubscription. * * @param manager Entry point to DevCenterManager. */ - public static void attachedNetworksCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.attachedNetworks() - .define("network-uswest3") - .withExistingDevcenter("rg1", "Contoso") - .withNetworkConnectionId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/NetworkConnections/network-uswest3") - .create(); + public static void + networkConnectionsListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections().list(null, com.azure.core.util.Context.NONE); } } ``` @@ -196,21 +254,26 @@ public final class AttachedNetworksCreateOrUpdateSamples { ```java /** - * Samples for AttachedNetworks Delete. + * Samples for AttachedNetworks CreateOrUpdate. */ -public final class AttachedNetworksDeleteSamples { +public final class AttachedNetworksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/AttachedNetworks_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_Create.json */ /** - * Sample code: AttachedNetworks_Delete. + * Sample code: AttachedNetworks_Create. * * @param manager Entry point to DevCenterManager. */ - public static void attachedNetworksDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.attachedNetworks().delete("rg1", "Contoso", "network-uswest3", com.azure.core.util.Context.NONE); + public static void attachedNetworksCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.attachedNetworks() + .define("network-uswest3") + .withExistingDevcenter("rg1", "Contoso") + .withNetworkConnectionId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/NetworkConnections/network-uswest3") + .create(); } } ``` @@ -219,21 +282,21 @@ public final class AttachedNetworksDeleteSamples { ```java /** - * Samples for AttachedNetworks GetByDevCenter. + * Samples for DevBoxDefinitions ListByProject. */ -public final class AttachedNetworksGetByDevCenterSamples { +public final class DevBoxDefinitionsListByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * AttachedNetworks_GetByDevCenter.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_ListByProject.json */ /** - * Sample code: AttachedNetworks_GetByDevCenter. + * Sample code: DevBoxDefinitions_ListByProject. * * @param manager Entry point to DevCenterManager. */ - public static void attachedNetworksGetByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.attachedNetworks() - .getByDevCenterWithResponse("rg1", "Contoso", "network-uswest3", com.azure.core.util.Context.NONE); + public static void devBoxDefinitionsListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devBoxDefinitions().listByProject("rg1", "ContosoProject", null, com.azure.core.util.Context.NONE); } } ``` @@ -242,21 +305,24 @@ public final class AttachedNetworksGetByDevCenterSamples { ```java /** - * Samples for AttachedNetworks GetByProject. + * Samples for DevCenterCatalogImageDefinitionBuildOperation GetBuildDetails. */ -public final class AttachedNetworksGetByProjectSamples { +public final class DevCenterCatalogImageDefinitionBuildOperationGetBuildDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * AttachedNetworks_GetByProject.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_GetImageBuildDetails.json */ /** - * Sample code: AttachedNetworks_GetByProject. + * Sample code: DevCenterCatalogImageDefinitionBuild_GetErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void attachedNetworksGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.attachedNetworks() - .getByProjectWithResponse("rg1", "DevProject", "network-uswest3", com.azure.core.util.Context.NONE); + public static void devCenterCatalogImageDefinitionBuildGetErrorDetails( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuildOperations() + .getBuildDetailsWithResponse("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); } } ``` @@ -265,20 +331,21 @@ public final class AttachedNetworksGetByProjectSamples { ```java /** - * Samples for AttachedNetworks ListByDevCenter. + * Samples for Images ListByProject. */ -public final class AttachedNetworksListByDevCenterSamples { +public final class ImagesListByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * AttachedNetworks_ListByDevCenter.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_ListByProject.json */ /** - * Sample code: AttachedNetworks_ListByDevCenter. + * Sample code: Images_ListByProject. * * @param manager Entry point to DevCenterManager. */ - public static void attachedNetworksListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.attachedNetworks().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + public static void imagesListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images().listByProject("rg1", "myProject", com.azure.core.util.Context.NONE); } } ``` @@ -287,20 +354,24 @@ public final class AttachedNetworksListByDevCenterSamples { ```java /** - * Samples for AttachedNetworks ListByProject. + * Samples for ProjectCatalogImageDefinitions GetErrorDetails. */ -public final class AttachedNetworksListByProjectSamples { +public final class ProjectCatalogImageDefinitionsGetErrorDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * AttachedNetworks_ListByProject.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogImageDefinitions_GetErrorDetails.json */ /** - * Sample code: AttachedNetworks_ListByProject. + * Sample code: ProjectCatalogImageDefinitions_GetErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void attachedNetworksListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.attachedNetworks().listByProject("rg1", "DevProject", null, com.azure.core.util.Context.NONE); + public static void + projectCatalogImageDefinitionsGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .getErrorDetailsWithResponse("rg1", "DevProject", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); } } ``` @@ -309,20 +380,23 @@ public final class AttachedNetworksListByProjectSamples { ```java /** - * Samples for Catalogs Connect. + * Samples for ProjectCatalogs GetSyncErrorDetails. */ -public final class CatalogsConnectSamples { +public final class ProjectCatalogsGetSyncErrorDetailsSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Connect.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_GetSyncErrorDetails.json */ /** - * Sample code: Catalogs_Connect. + * Sample code: ProjectCatalogs_GetSyncErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsConnect(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs().connect("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void + projectCatalogsGetSyncErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs() + .getSyncErrorDetailsWithResponse("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); } } ``` @@ -330,54 +404,22 @@ public final class CatalogsConnectSamples { ### Catalogs_CreateOrUpdate ```java -import com.azure.resourcemanager.devcenter.fluent.models.CatalogInner; -import com.azure.resourcemanager.devcenter.models.CatalogSyncType; -import com.azure.resourcemanager.devcenter.models.GitCatalog; - /** - * Samples for Catalogs CreateOrUpdate. + * Samples for Galleries ListByDevCenter. */ -public final class CatalogsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_CreateAdo.json - */ - /** - * Sample code: Catalogs_CreateOrUpdateAdo. - * - * @param manager Entry point to DevCenterManager. - */ - public static void catalogsCreateOrUpdateAdo(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs() - .createOrUpdate("rg1", "Contoso", "CentralCatalog", - new CatalogInner().withAdoGit(new GitCatalog() - .withUri("https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso") - .withBranch("main") - .withSecretIdentifier("fakeTokenPlaceholder") - .withPath("/templates")).withSyncType(CatalogSyncType.SCHEDULED), - com.azure.core.util.Context.NONE); - } - +public final class GalleriesListByDevCenterSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_CreateGitHub. + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_List. * json */ /** - * Sample code: Catalogs_CreateOrUpdateGitHub. + * Sample code: Galleries_ListByDevCenter. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsCreateOrUpdateGitHub(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs() - .createOrUpdate("rg1", "Contoso", "CentralCatalog", - new CatalogInner() - .withGitHub(new GitCatalog().withUri("https://github.com/Contoso/centralrepo-fake.git") - .withBranch("main") - .withSecretIdentifier("fakeTokenPlaceholder") - .withPath("/templates")) - .withSyncType(CatalogSyncType.MANUAL), - com.azure.core.util.Context.NONE); + public static void galleriesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.galleries().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); } } ``` @@ -386,20 +428,23 @@ public final class CatalogsCreateOrUpdateSamples { ```java /** - * Samples for Catalogs Delete. + * Samples for ImageVersions ListByProject. */ -public final class CatalogsDeleteSamples { +public final class ImageVersionsListByProjectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_ListByProject.json */ /** - * Sample code: Catalogs_Delete. + * Sample code: ImageVersions_ListByProject. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs().delete("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void imageVersionsListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.imageVersions() + .listByProject("rg1", "myProject", "~gallery~DefaultDevGallery~ContosoImageDefinition", + com.azure.core.util.Context.NONE); } } ``` @@ -408,20 +453,21 @@ public final class CatalogsDeleteSamples { ```java /** - * Samples for Catalogs Get. + * Samples for DevBoxDefinitions Get. */ -public final class CatalogsGetSamples { +public final class DevBoxDefinitionsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Get.json */ /** - * Sample code: Catalogs_Get. + * Sample code: DevBoxDefinitions_Get. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs().getWithResponse("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void devBoxDefinitionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devBoxDefinitions().getWithResponse("rg1", "Contoso", "WebDevBox", com.azure.core.util.Context.NONE); } } ``` @@ -430,21 +476,21 @@ public final class CatalogsGetSamples { ```java /** - * Samples for Catalogs GetSyncErrorDetails. + * Samples for Pools Delete. */ -public final class CatalogsGetSyncErrorDetailsSamples { +public final class PoolsDeleteSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * Catalogs_GetSyncErrorDetails.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Delete. + * json */ /** - * Sample code: Catalogs_GetSyncErrorDetails. + * Sample code: Pools_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsGetSyncErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs() - .getSyncErrorDetailsWithResponse("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void poolsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools().delete("rg1", "DevProject", "poolName", com.azure.core.util.Context.NONE); } } ``` @@ -453,20 +499,22 @@ public final class CatalogsGetSyncErrorDetailsSamples { ```java /** - * Samples for Catalogs ListByDevCenter. + * Samples for AttachedNetworks GetByProject. */ -public final class CatalogsListByDevCenterSamples { +public final class AttachedNetworksGetByProjectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_GetByProject.json */ /** - * Sample code: Catalogs_ListByDevCenter. + * Sample code: AttachedNetworks_GetByProject. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + public static void attachedNetworksGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.attachedNetworks() + .getByProjectWithResponse("rg1", "DevProject", "network-uswest3", com.azure.core.util.Context.NONE); } } ``` @@ -475,20 +523,21 @@ public final class CatalogsListByDevCenterSamples { ```java /** - * Samples for Catalogs Sync. + * Samples for ProjectCatalogs Delete. */ -public final class CatalogsSyncSamples { +public final class ProjectCatalogsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Sync.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Delete.json */ /** - * Sample code: Catalogs_Sync. + * Sample code: ProjectCatalogs_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsSync(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs().sync("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void projectCatalogsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs().delete("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); } } ``` @@ -496,28 +545,24 @@ public final class CatalogsSyncSamples { ### Catalogs_Update ```java -import com.azure.resourcemanager.devcenter.models.CatalogSyncType; -import com.azure.resourcemanager.devcenter.models.CatalogUpdate; -import com.azure.resourcemanager.devcenter.models.GitCatalog; - /** - * Samples for Catalogs Update. + * Samples for DevCenterCatalogImageDefinitions GetErrorDetails. */ -public final class CatalogsUpdateSamples { +public final class DevCenterCatalogImageDefinitionsGetErrorDetailsSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_GetErrorDetails.json */ /** - * Sample code: Catalogs_Update. + * Sample code: DevCenterImageDefinitions_GetErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void catalogsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.catalogs() - .update("rg1", "Contoso", "CentralCatalog", - new CatalogUpdate().withGitHub(new GitCatalog().withPath("/environments")) - .withSyncType(CatalogSyncType.SCHEDULED), + public static void + devCenterImageDefinitionsGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .getErrorDetailsWithResponse("rg1", "DevDevCenter", "TeamCatalog", "WebDevBox", com.azure.core.util.Context.NONE); } } @@ -526,27 +571,23 @@ public final class CatalogsUpdateSamples { ### CheckNameAvailability_Execute ```java -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityRequest; - /** - * Samples for CheckNameAvailability Execute. + * Samples for NetworkConnections ListHealthDetails. */ -public final class CheckNameAvailabilityExecuteSamples { +public final class NetworkConnectionsListHealthDetailsSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/CheckNameAvailability. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_ListHealthDetails.json */ /** - * Sample code: NameAvailability. + * Sample code: NetworkConnections_ListHealthDetails. * * @param manager Entry point to DevCenterManager. */ - public static void nameAvailability(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.checkNameAvailabilities() - .executeWithResponse( - new CheckNameAvailabilityRequest().withName("name1").withType("Microsoft.DevCenter/devcenters"), - com.azure.core.util.Context.NONE); + public static void + networkConnectionsListHealthDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections().listHealthDetails("rg1", "uswest3network", null, com.azure.core.util.Context.NONE); } } ``` @@ -554,86 +595,1092 @@ public final class CheckNameAvailabilityExecuteSamples { ### CheckScopedNameAvailability_Execute ```java -import com.azure.resourcemanager.devcenter.models.CheckScopedNameAvailabilityRequest; +import com.azure.resourcemanager.devcenter.models.CatalogItemSyncEnableStatus; +import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryption; +import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryptionKeyIdentity; +import com.azure.resourcemanager.devcenter.models.DevBoxProvisioningSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterNetworkSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.Encryption; +import com.azure.resourcemanager.devcenter.models.IdentityType; +import com.azure.resourcemanager.devcenter.models.InstallAzureMonitorAgentEnableStatus; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.MicrosoftHostedNetworkEnableStatus; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; /** - * Samples for CheckScopedNameAvailability Execute. + * Samples for DevCenters CreateOrUpdate. */ -public final class CheckScopedNameAvailabilityExecuteSamples { +public final class DevCentersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * CheckScopedNameAvailability_ProjectCatalog.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_Create.json */ /** - * Sample code: ProjectCatalogNameAvailability. + * Sample code: DevCenters_Create. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogNameAvailability(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.checkScopedNameAvailabilities() - .executeWithResponse(new CheckScopedNameAvailabilityRequest().withName("name1") - .withType("Microsoft.DevCenter/projects/catalogs") - .withScope( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/projects/DevProject"), - com.azure.core.util.Context.NONE); - } - + public static void devCentersCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters() + .define("Contoso") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) + .withDisplayName("ContosoDevCenter") + .withProjectCatalogSettings(new DevCenterProjectCatalogSettings() + .withCatalogItemSyncEnableStatus(CatalogItemSyncEnableStatus.ENABLED)) + .withDevBoxProvisioningSettings(new DevBoxProvisioningSettings() + .withInstallAzureMonitorAgentEnableStatus(InstallAzureMonitorAgentEnableStatus.ENABLED)) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_CreateWithDisabledManagedNetworks.json + */ + /** + * Sample code: DevCenters_CreateWithDisabledManagedNetworks. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + devCentersCreateWithDisabledManagedNetworks(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters() + .define("Contoso") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDisplayName("ContosoDevCenter") + .withNetworkSettings(new DevCenterNetworkSettings() + .withMicrosoftHostedNetworkEnableStatus(MicrosoftHostedNetworkEnableStatus.DISABLED)) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_CreateWithUserIdentity.json + */ + /** + * Sample code: DevCenters_CreateWithUserIdentity. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCentersCreateWithUserIdentity(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters() + .define("Contoso") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDisplayName("ContosoDevCenter") + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_CreateWithEncryption.json + */ + /** + * Sample code: DevCenters_CreateWithEncryption. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCentersCreateWithEncryption(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters() + .define("Contoso") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withEncryption(new Encryption().withCustomerManagedKeyEncryption(new CustomerManagedKeyEncryption() + .withKeyEncryptionKeyIdentity(new CustomerManagedKeyEncryptionKeyIdentity() + .withIdentityType(IdentityType.USER_ASSIGNED_IDENTITY) + .withUserAssignedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1")) + .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) + .withDisplayName("ContosoDevCenter") + .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; + } +} +``` + +### CustomizationTasks_Get + +```java +/** + * Samples for DevCenters GetByResourceGroup. + */ +public final class DevCentersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/DevCenters_Get. + * json + */ + /** + * Sample code: DevCenters_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCentersGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters().getByResourceGroupWithResponse("rg1", "Contoso", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomizationTasks_GetErrorDetails + +```java +/** + * Samples for NetworkConnections ListByResourceGroup. + */ +public final class NetworkConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_ListByResourceGroup.json + */ + /** + * Sample code: NetworkConnections_ListByResourceGroup. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + networkConnectionsListByResourceGroup(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### CustomizationTasks_ListByCatalog + +```java +/** + * Samples for AttachedNetworks ListByDevCenter. + */ +public final class AttachedNetworksListByDevCenterSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_ListByDevCenter.json + */ + /** + * Sample code: AttachedNetworks_ListByDevCenter. + * + * @param manager Entry point to DevCenterManager. + */ + public static void attachedNetworksListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.attachedNetworks().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DevBoxDefinitions_CreateOrUpdate + +```java +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.util.Arrays; + +/** + * Samples for ProjectPolicies CreateOrUpdate. + */ +public final class ProjectPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Put.json + */ + /** + * Sample code: ProjectPolicies_CreateOrUpdate. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies() + .define("DevOnlyResources") + .withExistingDevcenter("rg1", "Contoso") + .withResourcePolicies(Arrays.asList(new ResourcePolicy().withResources( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff1/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso/attachednetworks/network-westus3"))) + .withScopes(Arrays.asList( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff1/resourceGroups/rg1/providers/Microsoft.DevCenter/projects/DevProject")) + .create(); + } +} +``` + +### DevBoxDefinitions_Delete + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Operations_Get. + * json + */ + /** + * Sample code: Operations_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void operationsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DevBoxDefinitions_Get + +```java +/** + * Samples for ProjectCatalogs List. + */ +public final class ProjectCatalogsListSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_List.json + */ + /** + * Sample code: ProjectCatalogs_List. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogsList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs().list("rg1", "DevProject", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DevBoxDefinitions_GetByProject + +```java +/** + * Samples for DevCenterCatalogImageDefinitions BuildImage. + */ +public final class DevCenterCatalogImageDefinitionsBuildImageSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_BuildImage.json + */ + /** + * Sample code: DevCenterCatalogImageDefinitions_BuildImage. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + devCenterCatalogImageDefinitionsBuildImage(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .buildImage("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", com.azure.core.util.Context.NONE); + } +} +``` + +### DevBoxDefinitions_ListByDevCenter + +```java +import com.azure.resourcemanager.devcenter.models.ActiveHoursConfiguration; +import com.azure.resourcemanager.devcenter.models.AutoStartEnableStatus; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import com.azure.resourcemanager.devcenter.models.KeepAwakeEnableStatus; +import com.azure.resourcemanager.devcenter.models.LicenseType; +import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinitionType; +import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; +import com.azure.resourcemanager.devcenter.models.Sku; +import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectEnableStatus; +import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; +import java.util.Arrays; + +/** + * Samples for Pools CreateOrUpdate. + */ +public final class PoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_PutWithValueDevBoxDefinition.json + */ + /** + * Sample code: Pools_CreateOrUpdateWithValueDevBoxDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + poolsCreateOrUpdateWithValueDevBoxDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools() + .define("DevPool") + .withRegion("centralus") + .withExistingProject("rg1", "DevProject") + .withDevBoxDefinitionType(PoolDevBoxDefinitionType.VALUE) + .withDevBoxDefinitionName("") + .withDevBoxDefinition(new PoolDevBoxDefinition().withImageReference(new ImageReference().withId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/projects/DevProject/images/exampleImage/version/1.0.0")) + .withSku(new Sku().withName("Preview"))) + .withNetworkConnectionName("Network1-westus2") + .withLicenseType(LicenseType.WINDOWS_CLIENT) + .withLocalAdministrator(LocalAdminStatus.ENABLED) + .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) + .withGracePeriodMinutes(60)) + .withStopOnNoConnect(new StopOnNoConnectConfiguration().withStatus(StopOnNoConnectEnableStatus.ENABLED) + .withGracePeriodMinutes(120)) + .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) + .withDisplayName("Developer Pool") + .withVirtualNetworkType(VirtualNetworkType.UNMANAGED) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Put.json + */ + /** + * Sample code: Pools_CreateOrUpdate. + * + * @param manager Entry point to DevCenterManager. + */ + public static void poolsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools() + .define("DevPool") + .withRegion("centralus") + .withExistingProject("rg1", "DevProject") + .withDevBoxDefinitionName("WebDevBox") + .withNetworkConnectionName("Network1-westus2") + .withLicenseType(LicenseType.WINDOWS_CLIENT) + .withLocalAdministrator(LocalAdminStatus.ENABLED) + .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) + .withGracePeriodMinutes(60)) + .withStopOnNoConnect(new StopOnNoConnectConfiguration().withStatus(StopOnNoConnectEnableStatus.ENABLED) + .withGracePeriodMinutes(120)) + .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) + .withDisplayName("Developer Pool") + .withVirtualNetworkType(VirtualNetworkType.UNMANAGED) + .withActiveHoursConfiguration( + new ActiveHoursConfiguration().withKeepAwakeEnableStatus(KeepAwakeEnableStatus.ENABLED) + .withAutoStartEnableStatus(AutoStartEnableStatus.ENABLED) + .withDefaultTimeZone("America/Los_Angeles") + .withDefaultStartTimeHour(9) + .withDefaultEndTimeHour(17)) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_PutWithManagedNetwork.json + */ + /** + * Sample code: Pools_CreateOrUpdateWithManagedNetwork. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + poolsCreateOrUpdateWithManagedNetwork(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools() + .define("DevPool") + .withRegion("centralus") + .withExistingProject("rg1", "DevProject") + .withDevBoxDefinitionName("WebDevBox") + .withNetworkConnectionName("managedNetwork") + .withLicenseType(LicenseType.WINDOWS_CLIENT) + .withLocalAdministrator(LocalAdminStatus.ENABLED) + .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) + .withGracePeriodMinutes(60)) + .withStopOnNoConnect(new StopOnNoConnectConfiguration().withStatus(StopOnNoConnectEnableStatus.ENABLED) + .withGracePeriodMinutes(120)) + .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) + .withDisplayName("Developer Pool") + .withVirtualNetworkType(VirtualNetworkType.MANAGED) + .withManagedVirtualNetworkRegions(Arrays.asList("centralus")) + .create(); + } +} +``` + +### DevBoxDefinitions_ListByProject + +```java +/** + * Samples for Usages ListByLocation. + */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Usages_ListByLocation.json + */ + /** + * Sample code: listUsages. + * + * @param manager Entry point to DevCenterManager. + */ + public static void listUsages(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.usages().listByLocation("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### DevBoxDefinitions_Update + +```java +import com.azure.resourcemanager.devcenter.models.Pool; + +/** + * Samples for Pools Update. + */ +public final class PoolsUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Patch.json + */ + /** + * Sample code: Pools_Update. + * + * @param manager Entry point to DevCenterManager. + */ + public static void poolsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + Pool resource = manager.pools() + .getWithResponse("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDevBoxDefinitionName("WebDevBox2").apply(); + } +} +``` + +### DevCenterCatalogImageDefinitionBuildOperation_Cancel + +```java +/** + * Samples for Images Get. + */ +public final class ImagesGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Images_Get.json + */ + /** + * Sample code: Images_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imagesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images() + .getWithResponse("rg1", "Contoso", "DefaultDevGallery", "ContosoBaseImage", + com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenterCatalogImageDefinitionBuildOperation_Get + +```java +import com.azure.resourcemanager.devcenter.models.ProjectPolicy; +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.util.Arrays; + +/** + * Samples for ProjectPolicies Update. + */ +public final class ProjectPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Patch.json + */ + /** + * Sample code: ProjectPolicies_Update. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + ProjectPolicy resource = manager.projectPolicies() + .getWithResponse("rg1", "Contoso", "DevOnlyResources", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withResourcePolicies(Arrays.asList(new ResourcePolicy().withResources( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff1/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso/attachednetworks/network-westus3"))) + .apply(); + } +} +``` + +### DevCenterCatalogImageDefinitionBuildOperation_GetBuildDetails + +```java +/** + * Samples for ProjectCatalogs Get. + */ +public final class ProjectCatalogsGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Get.json + */ + /** + * Sample code: ProjectCatalogs_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs() + .getWithResponse("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenterCatalogImageDefinitionBuilds_ListByImageDefinition + +```java +/** + * Samples for ProjectCatalogs Sync. + */ +public final class ProjectCatalogsSyncSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Sync.json + */ + /** + * Sample code: ProjectCatalogs_Sync. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogsSync(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs().sync("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenterCatalogImageDefinitions_BuildImage + +```java +/** + * Samples for ImageVersions GetByProject. + */ +public final class ImageVersionsGetByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_GetByProject.json + */ + /** + * Sample code: ImageVersions_GetByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imageVersionsGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.imageVersions() + .getByProjectWithResponse("rg1", "myProject", "~gallery~DefaultDevGallery~ContosoImageDefinition", "1.0.0", + com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenterCatalogImageDefinitions_GetByDevCenterCatalog + +```java +/** + * Samples for Projects Delete. + */ +public final class ProjectsDeleteSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Delete. + * json + */ + /** + * Sample code: Projects_Delete. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects().delete("rg1", "DevProject", com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenterCatalogImageDefinitions_GetErrorDetails + +```java +/** + * Samples for Catalogs ListByDevCenter. + */ +public final class CatalogsListByDevCenterSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_List. + * json + */ + /** + * Sample code: Catalogs_ListByDevCenter. + * + * @param manager Entry point to DevCenterManager. + */ + public static void catalogsListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenterCatalogImageDefinitions_ListByDevCenterCatalog + +```java +/** + * Samples for AttachedNetworks GetByDevCenter. + */ +public final class AttachedNetworksGetByDevCenterSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_GetByDevCenter.json + */ + /** + * Sample code: AttachedNetworks_GetByDevCenter. + * + * @param manager Entry point to DevCenterManager. + */ + public static void attachedNetworksGetByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.attachedNetworks() + .getByDevCenterWithResponse("rg1", "Contoso", "network-uswest3", com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenters_CreateOrUpdate + +```java +/** + * Samples for DevBoxDefinitions GetByProject. + */ +public final class DevBoxDefinitionsGetByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_GetByProject.json + */ + /** + * Sample code: DevBoxDefinitions_GetByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devBoxDefinitionsGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devBoxDefinitions() + .getByProjectWithResponse("rg1", "ContosoProject", "WebDevBox", com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenters_Delete + +```java +/** + * Samples for EnvironmentTypes ListByDevCenter. + */ +public final class EnvironmentTypesListByDevCenterSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_List.json + */ + /** + * Sample code: EnvironmentTypes_ListByDevCenter. + * + * @param manager Entry point to DevCenterManager. + */ + public static void environmentTypesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentTypes().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenters_GetByResourceGroup + +```java +import com.azure.resourcemanager.devcenter.models.Catalog; +import com.azure.resourcemanager.devcenter.models.GitCatalog; + +/** + * Samples for ProjectCatalogs Patch. + */ +public final class ProjectCatalogsPatchSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Patch.json + */ + /** + * Sample code: ProjectCatalogs_Patch. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogsPatch(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + Catalog resource = manager.projectCatalogs() + .getWithResponse("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withGitHub(new GitCatalog().withPath("/environments")).apply(); + } +} +``` + +### DevCenters_List + +```java +/** + * Samples for Catalogs Get. + */ +public final class CatalogsGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Get. + * json + */ + /** + * Sample code: Catalogs_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void catalogsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs().getWithResponse("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenters_ListByResourceGroup + +```java +/** + * Samples for DevBoxDefinitions ListByDevCenter. + */ +public final class DevBoxDefinitionsListByDevCenterSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_ListByDevCenter.json + */ + /** + * Sample code: DevBoxDefinitions_ListByDevCenter. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devBoxDefinitionsListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devBoxDefinitions().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DevCenters_Update + +```java +/** + * Samples for ProjectCatalogImageDefinitions GetByProjectCatalog. + */ +public final class ProjectCatalogImageDefinitionsGetByProjectCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetByProjectCatalog.json + */ + /** + * Sample code: ImageDefinitions_GetByProjectCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionsGetByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .getByProjectCatalogWithResponse("rg1", "ContosoProject", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionSets_CreateOrUpdate + +```java +import com.azure.resourcemanager.devcenter.models.CheckScopedNameAvailabilityRequest; + +/** + * Samples for CheckScopedNameAvailability Execute. + */ +public final class CheckScopedNameAvailabilityExecuteSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CheckScopedNameAvailability_ProjectCatalog.json + */ + /** + * Sample code: ProjectCatalogNameAvailability. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogNameAvailability(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.checkScopedNameAvailabilities() + .executeWithResponse(new CheckScopedNameAvailabilityRequest().withName("name1") + .withType("Microsoft.DevCenter/projects/catalogs") + .withScope( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/projects/DevProject"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CheckScopedNameAvailability_DevCenterCatalog.json + */ + /** + * Sample code: DevcenterCatalogNameAvailability. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devcenterCatalogNameAvailability(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.checkScopedNameAvailabilities() + .executeWithResponse(new CheckScopedNameAvailabilityRequest().withName("name1") + .withType("Microsoft.DevCenter/devcenters/catalogs") + .withScope( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso"), + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionSets_Delete + +```java +/** + * Samples for ProjectCatalogEnvironmentDefinitions GetErrorDetails. + */ +public final class ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogEnvironmentDefinitions_GetErrorDetails.json + */ + /** + * Sample code: ProjectCatalogEnvironmentDefinitions_GetErrorDetails. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogEnvironmentDefinitionsGetErrorDetails( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogEnvironmentDefinitions() + .getErrorDetailsWithResponse("rg1", "DevProject", "myCatalog", "myEnvironmentDefinition", + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionSets_Get + +```java +/** + * Samples for DevCenterCatalogImageDefinitionBuilds ListByImageDefinition. + */ +public final class DevCenterCatalogImageDefinitionBuildsListByImageDefinitionSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_ListImageBuildsByImageDefinition.json + */ + /** + * Sample code: DevCenterImageDefinitionBuilds_ListByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCenterImageDefinitionBuildsListByImageDefinition( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuilds() + .listByImageDefinition("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionSets_List + +```java +import com.azure.resourcemanager.devcenter.fluent.models.CatalogInner; +import com.azure.resourcemanager.devcenter.models.CatalogSyncType; +import com.azure.resourcemanager.devcenter.models.GitCatalog; + +/** + * Samples for Catalogs CreateOrUpdate. + */ +public final class CatalogsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Catalogs_CreateAdo.json + */ + /** + * Sample code: Catalogs_CreateOrUpdateAdo. + * + * @param manager Entry point to DevCenterManager. + */ + public static void catalogsCreateOrUpdateAdo(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs() + .createOrUpdate("rg1", "Contoso", "CentralCatalog", + new CatalogInner().withAdoGit(new GitCatalog() + .withUri("https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso") + .withBranch("main") + .withSecretIdentifier("fakeTokenPlaceholder") + .withPath("/templates")).withSyncType(CatalogSyncType.SCHEDULED), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Catalogs_CreateGitHub.json + */ + /** + * Sample code: Catalogs_CreateOrUpdateGitHub. + * + * @param manager Entry point to DevCenterManager. + */ + public static void catalogsCreateOrUpdateGitHub(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs() + .createOrUpdate("rg1", "Contoso", "CentralCatalog", + new CatalogInner() + .withGitHub(new GitCatalog().withUri("https://github.com/Contoso/centralrepo-fake.git") + .withBranch("main") + .withSecretIdentifier("fakeTokenPlaceholder") + .withPath("/templates")) + .withSyncType(CatalogSyncType.MANUAL), + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionSets_Update + +```java +/** + * Samples for AttachedNetworks Delete. + */ +public final class AttachedNetworksDeleteSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_Delete.json + */ + /** + * Sample code: AttachedNetworks_Delete. + * + * @param manager Entry point to DevCenterManager. + */ + public static void attachedNetworksDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.attachedNetworks().delete("rg1", "Contoso", "network-uswest3", com.azure.core.util.Context.NONE); + } +} +``` + +### EnvironmentDefinitions_Get + +```java +/** + * Samples for DevCenters Delete. + */ +public final class DevCentersDeleteSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_Delete.json + */ + /** + * Sample code: DevCenters_Delete. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCentersDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters().delete("rg1", "Contoso", com.azure.core.util.Context.NONE); + } +} +``` + +### EnvironmentDefinitions_GetByProjectCatalog + +```java +/** + * Samples for ProjectPolicies Get. + */ +public final class ProjectPoliciesGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * CheckScopedNameAvailability_DevCenterCatalog.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Get.json */ /** - * Sample code: DevcenterCatalogNameAvailability. + * Sample code: ProjectPolicies_Get. * * @param manager Entry point to DevCenterManager. */ - public static void devcenterCatalogNameAvailability(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.checkScopedNameAvailabilities() - .executeWithResponse(new CheckScopedNameAvailabilityRequest().withName("name1") - .withType("Microsoft.DevCenter/devcenters/catalogs") - .withScope( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso"), - com.azure.core.util.Context.NONE); + public static void projectPoliciesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies() + .getWithResponse("rg1", "Contoso", "DevOnlyResources", com.azure.core.util.Context.NONE); } } ``` -### DevBoxDefinitions_CreateOrUpdate +### EnvironmentDefinitions_GetErrorDetails ```java -import com.azure.resourcemanager.devcenter.models.HibernateSupport; -import com.azure.resourcemanager.devcenter.models.ImageReference; -import com.azure.resourcemanager.devcenter.models.Sku; - /** - * Samples for DevBoxDefinitions CreateOrUpdate. + * Samples for Schedules ListByPool. */ -public final class DevBoxDefinitionsCreateOrUpdateSamples { +public final class SchedulesListByPoolSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Create. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Schedules_ListByPool.json */ /** - * Sample code: DevBoxDefinitions_Create. + * Sample code: Schedules_ListByPool. * * @param manager Entry point to DevCenterManager. */ - public static void devBoxDefinitionsCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devBoxDefinitions() - .define("WebDevBox") - .withRegion("centralus") - .withExistingDevcenter("rg1", "Contoso") - .withImageReference(new ImageReference().withId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/version/1.0.0")) - .withSku(new Sku().withName("Preview")) - .withHibernateSupport(HibernateSupport.ENABLED) - .create(); + public static void schedulesListByPool(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.schedules().listByPool("rg1", "TestProject", "DevPool", null, com.azure.core.util.Context.NONE); } } ``` -### DevBoxDefinitions_Delete +### EnvironmentDefinitions_ListByCatalog ```java /** @@ -642,8 +1689,8 @@ public final class DevBoxDefinitionsCreateOrUpdateSamples { public final class DevBoxDefinitionsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Delete.json */ /** * Sample code: DevBoxDefinitions_Delete. @@ -656,343 +1703,456 @@ public final class DevBoxDefinitionsDeleteSamples { } ``` -### DevBoxDefinitions_Get +### EnvironmentDefinitions_ListByProjectCatalog ```java /** - * Samples for DevBoxDefinitions Get. + * Samples for DevCenterCatalogImageDefinitionBuildOperation Cancel. */ -public final class DevBoxDefinitionsGetSamples { +public final class DevCenterCatalogImageDefinitionBuildOperationCancelSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Get. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_CancelImageBuild.json */ /** - * Sample code: DevBoxDefinitions_Get. + * Sample code: DevCenterImageDefinitionBuilds_CancelByImageDefinition. * * @param manager Entry point to DevCenterManager. */ - public static void devBoxDefinitionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devBoxDefinitions().getWithResponse("rg1", "Contoso", "WebDevBox", com.azure.core.util.Context.NONE); + public static void devCenterImageDefinitionBuildsCancelByImageDefinition( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuildOperations() + .cancel("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", "0a28fc61-6f87-4611-8fe2-32df44ab93b7", + com.azure.core.util.Context.NONE); } } ``` -### DevBoxDefinitions_GetByProject +### EnvironmentTypes_CreateOrUpdate ```java /** - * Samples for DevBoxDefinitions GetByProject. + * Samples for Projects GetInheritedSettings. */ -public final class DevBoxDefinitionsGetByProjectSamples { +public final class ProjectsGetInheritedSettingsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevBoxDefinitions_GetByProject.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_GetInheritedSettings.json */ /** - * Sample code: DevBoxDefinitions_GetByProject. + * Sample code: Projects_GetInheritedSettings. * * @param manager Entry point to DevCenterManager. */ - public static void devBoxDefinitionsGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devBoxDefinitions() - .getByProjectWithResponse("rg1", "ContosoProject", "WebDevBox", com.azure.core.util.Context.NONE); + public static void projectsGetInheritedSettings(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects().getInheritedSettingsWithResponse("rg1", "Contoso", com.azure.core.util.Context.NONE); } } ``` -### DevBoxDefinitions_ListByDevCenter +### EnvironmentTypes_Delete ```java /** - * Samples for DevBoxDefinitions ListByDevCenter. + * Samples for NetworkConnections RunHealthChecks. */ -public final class DevBoxDefinitionsListByDevCenterSamples { +public final class NetworkConnectionsRunHealthChecksSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevBoxDefinitions_ListByDevCenter.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_RunHealthChecks.json */ /** - * Sample code: DevBoxDefinitions_ListByDevCenter. + * Sample code: NetworkConnections_RunHealthChecks. * * @param manager Entry point to DevCenterManager. */ - public static void devBoxDefinitionsListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devBoxDefinitions().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + public static void networkConnectionsRunHealthChecks(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections().runHealthChecks("rg1", "uswest3network", com.azure.core.util.Context.NONE); } } ``` -### DevBoxDefinitions_ListByProject +### EnvironmentTypes_Get ```java /** - * Samples for DevBoxDefinitions ListByProject. + * Samples for EncryptionSets List. */ -public final class DevBoxDefinitionsListByProjectSamples { +public final class EncryptionSetsListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevBoxDefinitions_ListByProject.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_List.json */ /** - * Sample code: DevBoxDefinitions_ListByProject. + * Sample code: EncryptionSets_List. * * @param manager Entry point to DevCenterManager. */ - public static void devBoxDefinitionsListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devBoxDefinitions().listByProject("rg1", "ContosoProject", null, com.azure.core.util.Context.NONE); + public static void encryptionSetsList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets().list("rg1", "Contoso", null, com.azure.core.util.Context.NONE); } } ``` -### DevBoxDefinitions_Update +### EnvironmentTypes_ListByDevCenter ```java -import com.azure.resourcemanager.devcenter.models.DevBoxDefinition; -import com.azure.resourcemanager.devcenter.models.ImageReference; +/** + * Samples for Catalogs Connect. + */ +public final class CatalogsConnectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Connect + * .json + */ + /** + * Sample code: Catalogs_Connect. + * + * @param manager Entry point to DevCenterManager. + */ + public static void catalogsConnect(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs().connect("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); + } +} +``` + +### EnvironmentTypes_Update + +```java +import com.azure.resourcemanager.devcenter.models.CatalogItemType; +import com.azure.resourcemanager.devcenter.models.Project; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for DevBoxDefinitions Update. + * Samples for Projects Update. */ -public final class DevBoxDefinitionsUpdateSamples { +public final class ProjectsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Patch. + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Patch. * json */ /** - * Sample code: DevBoxDefinitions_Patch. + * Sample code: Projects_Update. * * @param manager Entry point to DevCenterManager. */ - public static void devBoxDefinitionsPatch(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - DevBoxDefinition resource = manager.devBoxDefinitions() - .getWithResponse("rg1", "Contoso", "WebDevBox", com.azure.core.util.Context.NONE) + public static void projectsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + Project resource = manager.projects() + .getByResourceGroupWithResponse("rg1", "DevProject", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withImageReference(new ImageReference().withId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/version/2.0.0")) + .withTags(mapOf("CostCenter", "R&D")) + .withDescription("This is my first project.") + .withDisplayName("Dev") + .withCatalogSettings(new ProjectCatalogSettings() + .withCatalogItemSyncTypes(Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION))) .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; + } } ``` -### DevCenters_CreateOrUpdate +### Galleries_CreateOrUpdate ```java -import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryption; -import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryptionKeyIdentity; -import com.azure.resourcemanager.devcenter.models.Encryption; -import com.azure.resourcemanager.devcenter.models.IdentityType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devcenter.models.DomainJoinType; /** - * Samples for DevCenters CreateOrUpdate. + * Samples for NetworkConnections CreateOrUpdate. */ -public final class DevCentersCreateOrUpdateSamples { +public final class NetworkConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Create.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Put.json */ /** - * Sample code: DevCenters_Create. + * Sample code: NetworkConnections_CreateOrUpdate. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters() - .define("Contoso") + public static void networkConnectionsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections() + .define("uswest3network") .withRegion("centralus") .withExistingResourceGroup("rg1") - .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) - .withDisplayName("ContosoDevCenter") + .withNetworkingResourceGroupName("NetworkInterfaces") + .withDomainJoinType(DomainJoinType.HYBRID_AZURE_ADJOIN) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default") + .withDomainName("mydomaincontroller.local") + .withDomainUsername("testuser@mydomaincontroller.local") + .withDomainPassword("Password value for user") .create(); } +} +``` + +### Galleries_Delete +```java +/** + * Samples for ProjectCatalogs Connect. + */ +public final class ProjectCatalogsConnectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevCenters_CreateWithUserIdentity.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Connect.json */ /** - * Sample code: DevCenters_CreateWithUserIdentity. + * Sample code: ProjectCatalogs_Connect. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersCreateWithUserIdentity(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters() - .define("Contoso") - .withRegion("centralus") - .withExistingResourceGroup("rg1") - .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", - new UserAssignedIdentity()))) - .withDisplayName("ContosoDevCenter") - .create(); + public static void projectCatalogsConnect(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs().connect("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + } +} +``` + +### Galleries_Get + +```java +/** + * Samples for Images ListByGallery. + */ +public final class ImagesListByGallerySamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_ListByGallery.json + */ + /** + * Sample code: Images_ListByGallery. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imagesListByGallery(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images().listByGallery("rg1", "Contoso", "DevGallery", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Galleries_ListByDevCenter + +```java +/** + * Samples for AttachedNetworks ListByProject. + */ +public final class AttachedNetworksListByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_ListByProject.json + */ + /** + * Sample code: AttachedNetworks_ListByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void attachedNetworksListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.attachedNetworks().listByProject("rg1", "DevProject", null, com.azure.core.util.Context.NONE); } +} +``` + +### ImageVersions_Get +```java +/** + * Samples for EnvironmentTypes Get. + */ +public final class EnvironmentTypesGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevCenters_CreateWithEncryption.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Get.json */ /** - * Sample code: DevCenters_CreateWithEncryption. + * Sample code: EnvironmentTypes_Get. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersCreateWithEncryption(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters() - .define("Contoso") - .withRegion("centralus") - .withExistingResourceGroup("rg1") - .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", - new UserAssignedIdentity()))) - .withEncryption(new Encryption().withCustomerManagedKeyEncryption(new CustomerManagedKeyEncryption() - .withKeyEncryptionKeyIdentity(new CustomerManagedKeyEncryptionKeyIdentity() - .withIdentityType(IdentityType.USER_ASSIGNED_IDENTITY) - .withUserAssignedIdentityResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1")) - .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) - .withDisplayName("ContosoDevCenter") - .create(); + public static void environmentTypesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentTypes().getWithResponse("rg1", "Contoso", "DevTest", 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; +### ImageVersions_GetByProject + +```java +/** + * Samples for ProjectEnvironmentTypes Get. + */ +public final class ProjectEnvironmentTypesGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectEnvironmentTypes_Get.json + */ + /** + * Sample code: ProjectEnvironmentTypes_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectEnvironmentTypesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectEnvironmentTypes() + .getWithResponse("rg1", "ContosoProj", "DevTest", com.azure.core.util.Context.NONE); } } ``` -### DevCenters_Delete +### ImageVersions_ListByImage ```java +import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityRequest; + /** - * Samples for DevCenters Delete. + * Samples for CheckNameAvailability Execute. */ -public final class DevCentersDeleteSamples { +public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CheckNameAvailability.json */ /** - * Sample code: DevCenters_Delete. + * Sample code: NameAvailability. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters().delete("rg1", "Contoso", com.azure.core.util.Context.NONE); + public static void nameAvailability(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.checkNameAvailabilities() + .executeWithResponse( + new CheckNameAvailabilityRequest().withName("name1").withType("Microsoft.DevCenter/devcenters"), + com.azure.core.util.Context.NONE); } } ``` -### DevCenters_GetByResourceGroup +### ImageVersions_ListByProject ```java /** - * Samples for DevCenters GetByResourceGroup. + * Samples for Schedules Get. */ -public final class DevCentersGetByResourceGroupSamples { +public final class SchedulesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Schedules_Get. + * json */ /** - * Sample code: DevCenters_Get. + * Sample code: Schedules_GetByPool. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters().getByResourceGroupWithResponse("rg1", "Contoso", com.azure.core.util.Context.NONE); + public static void schedulesGetByPool(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.schedules() + .getWithResponse("rg1", "TestProject", "DevPool", "autoShutdown", null, com.azure.core.util.Context.NONE); } } ``` -### DevCenters_List +### Images_Get ```java /** - * Samples for DevCenters List. + * Samples for ProjectAllowedEnvironmentTypes Get. */ -public final class DevCentersListSamples { +public final class ProjectAllowedEnvironmentTypesGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevCenters_ListBySubscription.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectAllowedEnvironmentTypes_Get.json */ /** - * Sample code: DevCenters_ListBySubscription. + * Sample code: ProjectAllowedEnvironmentTypes_Get. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters().list(null, com.azure.core.util.Context.NONE); + public static void projectAllowedEnvironmentTypesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectAllowedEnvironmentTypes() + .getWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE); } } ``` -### DevCenters_ListByResourceGroup +### Images_GetByProject ```java /** - * Samples for DevCenters ListByResourceGroup. + * Samples for ProjectCatalogImageDefinitionBuildOperation Cancel. */ -public final class DevCentersListByResourceGroupSamples { +public final class ProjectCatalogImageDefinitionBuildOperationCancelSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * DevCenters_ListByResourceGroup.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_CancelImageBuild.json */ /** - * Sample code: DevCenters_ListByResourceGroup. + * Sample code: ImageDefinitionBuilds_CancelByImageDefinition. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersListByResourceGroup(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.devCenters().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); + public static void + imageDefinitionBuildsCancelByImageDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuildOperations() + .cancel("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", "0a28fc61-6f87-4611-8fe2-32df44ab93b7", + com.azure.core.util.Context.NONE); } } ``` -### DevCenters_Update +### Images_ListByDevCenter ```java -import com.azure.resourcemanager.devcenter.models.DevCenter; import java.util.HashMap; import java.util.Map; /** - * Samples for DevCenters Update. + * Samples for EnvironmentTypes CreateOrUpdate. */ -public final class DevCentersUpdateSamples { +public final class EnvironmentTypesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Put.json */ /** - * Sample code: DevCenters_Update. + * Sample code: EnvironmentTypes_CreateOrUpdate. * * @param manager Entry point to DevCenterManager. */ - public static void devCentersUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - DevCenter resource = manager.devCenters() - .getByResourceGroupWithResponse("rg1", "Contoso", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("CostCode", "fakeTokenPlaceholder")).apply(); + public static void environmentTypesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentTypes() + .define("DevTest") + .withExistingDevcenter("rg1", "Contoso") + .withTags(mapOf("Owner", "superuser")) + .withDisplayName("Dev") + .create(); } // Use "Map.of" if available @@ -1009,1569 +2169,1605 @@ public final class DevCentersUpdateSamples { } ``` -### EnvironmentDefinitions_Get +### Images_ListByGallery ```java /** - * Samples for EnvironmentDefinitions Get. + * Samples for EncryptionSets Get. */ -public final class EnvironmentDefinitionsGetSamples { +public final class EncryptionSetsGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * EnvironmentDefinitions_Get.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Get.json */ /** - * Sample code: EnvironmentDefinitions_Get. + * Sample code: EncryptionSets_Get. * * @param manager Entry point to DevCenterManager. */ - public static void environmentDefinitionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentDefinitions() - .getWithResponse("rg1", "Contoso", "myCatalog", "myEnvironmentDefinition", - com.azure.core.util.Context.NONE); + public static void encryptionSetsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets() + .getWithResponse("rg1", "Contoso", "EncryptionWestUs", com.azure.core.util.Context.NONE); } } ``` -### EnvironmentDefinitions_GetByProjectCatalog +### Images_ListByProject ```java -/** - * Samples for EnvironmentDefinitions GetByProjectCatalog. - */ -public final class EnvironmentDefinitionsGetByProjectCatalogSamples { - /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * EnvironmentDefinitions_GetByProjectCatalog.json - */ - /** - * Sample code: EnvironmentDefinitions_GetByProjectCatalog. - * - * @param manager Entry point to DevCenterManager. - */ - public static void - environmentDefinitionsGetByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentDefinitions() - .getByProjectCatalogWithResponse("rg1", "DevProject", "myCatalog", "myEnvironmentDefinition", - com.azure.core.util.Context.NONE); - } -} -``` - -### EnvironmentDefinitions_GetErrorDetails +import com.azure.resourcemanager.devcenter.models.DevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.ImageReference; -```java /** - * Samples for EnvironmentDefinitions GetErrorDetails. + * Samples for DevBoxDefinitions Update. */ -public final class EnvironmentDefinitionsGetErrorDetailsSamples { +public final class DevBoxDefinitionsUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * EnvironmentDefinitions_GetErrorDetails.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Patch.json */ /** - * Sample code: EnvironmentDefinitions_GetErrorDetails. + * Sample code: DevBoxDefinitions_Patch. * * @param manager Entry point to DevCenterManager. */ - public static void - environmentDefinitionsGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentDefinitions() - .getErrorDetailsWithResponse("rg1", "Contoso", "myCatalog", "myEnvironmentDefinition", - com.azure.core.util.Context.NONE); + public static void devBoxDefinitionsPatch(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + DevBoxDefinition resource = manager.devBoxDefinitions() + .getWithResponse("rg1", "Contoso", "WebDevBox", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withImageReference(new ImageReference().withId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/version/2.0.0")) + .apply(); } } ``` -### EnvironmentDefinitions_ListByCatalog +### NetworkConnections_CreateOrUpdate ```java /** - * Samples for EnvironmentDefinitions ListByCatalog. + * Samples for NetworkConnections GetByResourceGroup. */ -public final class EnvironmentDefinitionsListByCatalogSamples { +public final class NetworkConnectionsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * EnvironmentDefinitions_ListByCatalog.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Get.json */ /** - * Sample code: EnvironmentDefinitions_ListByCatalog. + * Sample code: NetworkConnections_Get. * * @param manager Entry point to DevCenterManager. */ - public static void - environmentDefinitionsListByCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentDefinitions() - .listByCatalog("rg1", "Contoso", "myCatalog", null, com.azure.core.util.Context.NONE); + public static void networkConnectionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections() + .getByResourceGroupWithResponse("rg1", "uswest3network", com.azure.core.util.Context.NONE); } } ``` -### EnvironmentDefinitions_ListByProjectCatalog +### NetworkConnections_Delete ```java /** - * Samples for EnvironmentDefinitions ListByProjectCatalog. + * Samples for Skus List. */ -public final class EnvironmentDefinitionsListByProjectCatalogSamples { +public final class SkusListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * EnvironmentDefinitions_ListByProjectCatalog.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Skus_ListBySubscription.json */ /** - * Sample code: EnvironmentDefinitions_ListByProjectCatalog. + * Sample code: Skus_ListBySubscription. * * @param manager Entry point to DevCenterManager. */ - public static void - environmentDefinitionsListByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentDefinitions() - .listByProjectCatalog("rg1", "DevProject", "myCatalog", com.azure.core.util.Context.NONE); + public static void skusListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.skus().list(null, com.azure.core.util.Context.NONE); } } ``` -### EnvironmentTypes_CreateOrUpdate +### NetworkConnections_GetByResourceGroup ```java -import java.util.HashMap; -import java.util.Map; - /** - * Samples for EnvironmentTypes CreateOrUpdate. + * Samples for ProjectCatalogImageDefinitionBuildOperation Get. */ -public final class EnvironmentTypesCreateOrUpdateSamples { +public final class ProjectCatalogImageDefinitionBuildOperationGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Put.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetImageBuild.json */ /** - * Sample code: EnvironmentTypes_CreateOrUpdate. + * Sample code: ImageDefinitionBuilds_GetByImageDefinition. * * @param manager Entry point to DevCenterManager. */ - public static void environmentTypesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentTypes() - .define("DevTest") - .withExistingDevcenter("rg1", "Contoso") - .withTags(mapOf("Owner", "superuser")) - .withDisplayName("Dev") - .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; + public static void + imageDefinitionBuildsGetByImageDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuildOperations() + .getWithResponse("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); } } ``` -### EnvironmentTypes_Delete +### NetworkConnections_GetHealthDetails ```java /** - * Samples for EnvironmentTypes Delete. + * Samples for ImageVersions Get. */ -public final class EnvironmentTypesDeleteSamples { +public final class ImageVersionsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_Get.json */ /** - * Sample code: EnvironmentTypes_Delete. + * Sample code: Versions_Get. * * @param manager Entry point to DevCenterManager. */ - public static void environmentTypesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentTypes().deleteWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE); + public static void versionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.imageVersions() + .getWithResponse("rg1", "Contoso", "DefaultDevGallery", "Win11", "1.0.0", com.azure.core.util.Context.NONE); } } ``` -### EnvironmentTypes_Get +### NetworkConnections_List ```java /** - * Samples for EnvironmentTypes Get. + * Samples for CustomizationTasks Get. */ -public final class EnvironmentTypesGetSamples { +public final class CustomizationTasksGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CustomizationTasks_Get.json */ /** - * Sample code: EnvironmentTypes_Get. + * Sample code: CustomizationTasks_Get. * * @param manager Entry point to DevCenterManager. */ - public static void environmentTypesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentTypes().getWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE); + public static void customizationTasksGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.customizationTasks() + .getWithResponse("rg1", "Contoso", "CentralCatalog", "SampleTask", com.azure.core.util.Context.NONE); } } ``` -### EnvironmentTypes_ListByDevCenter +### NetworkConnections_ListByResourceGroup ```java /** - * Samples for EnvironmentTypes ListByDevCenter. + * Samples for Skus ListByProject. */ -public final class EnvironmentTypesListByDevCenterSamples { +public final class SkusListByProjectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_List. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Skus_ListByProject.json */ /** - * Sample code: EnvironmentTypes_ListByDevCenter. + * Sample code: Skus_ListByProject. * * @param manager Entry point to DevCenterManager. */ - public static void environmentTypesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.environmentTypes().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + public static void skusListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.skus().listByProject("rg1", "myProject", com.azure.core.util.Context.NONE); } } ``` -### EnvironmentTypes_Update +### NetworkConnections_ListHealthDetails ```java -import com.azure.resourcemanager.devcenter.models.EnvironmentType; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for EnvironmentTypes Update. + * Samples for DevCenters List. */ -public final class EnvironmentTypesUpdateSamples { +public final class DevCentersListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Patch. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_ListBySubscription.json */ /** - * Sample code: EnvironmentTypes_Update. + * Sample code: DevCenters_ListBySubscription. * * @param manager Entry point to DevCenterManager. */ - public static void environmentTypesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - EnvironmentType resource = manager.environmentTypes() - .getWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("Owner", "superuser")).withDisplayName("Dev").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; + public static void devCentersListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters().list(null, com.azure.core.util.Context.NONE); } } ``` -### Galleries_CreateOrUpdate +### NetworkConnections_ListOutboundNetworkDependenciesEndpoints ```java /** - * Samples for Galleries CreateOrUpdate. + * Samples for EnvironmentDefinitions ListByCatalog. */ -public final class GalleriesCreateOrUpdateSamples { +public final class EnvironmentDefinitionsListByCatalogSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_Create.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentDefinitions_ListByCatalog.json */ /** - * Sample code: Galleries_CreateOrUpdate. + * Sample code: EnvironmentDefinitions_ListByCatalog. * * @param manager Entry point to DevCenterManager. */ - public static void galleriesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.galleries() - .define("StandardGallery") - .withExistingDevcenter("rg1", "Contoso") - .withGalleryResourceId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.Compute/galleries/StandardGallery") - .create(); + public static void + environmentDefinitionsListByCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentDefinitions() + .listByCatalog("rg1", "Contoso", "myCatalog", null, com.azure.core.util.Context.NONE); } } ``` -### Galleries_Delete +### NetworkConnections_RunHealthChecks ```java /** - * Samples for Galleries Delete. + * Samples for Catalogs GetSyncErrorDetails. */ -public final class GalleriesDeleteSamples { +public final class CatalogsGetSyncErrorDetailsSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Catalogs_GetSyncErrorDetails.json */ /** - * Sample code: Galleries_Delete. + * Sample code: Catalogs_GetSyncErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void galleriesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.galleries().delete("rg1", "Contoso", "StandardGallery", com.azure.core.util.Context.NONE); + public static void catalogsGetSyncErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs() + .getSyncErrorDetailsWithResponse("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); } } ``` -### Galleries_Get +### NetworkConnections_Update ```java /** - * Samples for Galleries Get. + * Samples for DevCenterCatalogImageDefinitionBuildOperation Get. */ -public final class GalleriesGetSamples { +public final class DevCenterCatalogImageDefinitionBuildOperationGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_GetImageBuild.json */ /** - * Sample code: Galleries_Get. + * Sample code: DevCenterImageDefinitionBuilds_GetByImageDefinition. * * @param manager Entry point to DevCenterManager. */ - public static void galleriesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.galleries().getWithResponse("rg1", "Contoso", "StandardGallery", com.azure.core.util.Context.NONE); + public static void devCenterImageDefinitionBuildsGetByImageDefinition( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuildOperations() + .getWithResponse("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); } } ``` -### Galleries_ListByDevCenter +### OperationStatuses_Get ```java /** - * Samples for Galleries ListByDevCenter. + * Samples for ProjectCatalogImageDefinitionBuilds ListByImageDefinition. */ -public final class GalleriesListByDevCenterSamples { +public final class ProjectCatalogImageDefinitionBuildsListByImageDefinitionSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_ListImageBuildsByImageDefinition.json */ /** - * Sample code: Galleries_ListByDevCenter. + * Sample code: ImageDefinitionBuilds_ListByImageDefinition. * * @param manager Entry point to DevCenterManager. */ - public static void galleriesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.galleries().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + public static void + imageDefinitionBuildsListByImageDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuilds() + .listByImageDefinition("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", + com.azure.core.util.Context.NONE); } } ``` -### ImageVersions_Get +### Operations_List ```java /** - * Samples for ImageVersions Get. + * Samples for ProjectPolicies ListByDevCenter. */ -public final class ImageVersionsGetSamples { +public final class ProjectPoliciesListByDevCenterSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ImageVersions_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_ListByDevCenter.json */ /** - * Sample code: Versions_Get. + * Sample code: ProjectPolicies_ListByDevCenter. * * @param manager Entry point to DevCenterManager. */ - public static void versionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.imageVersions() - .getWithResponse("rg1", "Contoso", "DefaultDevGallery", "Win11", "1.0.0", com.azure.core.util.Context.NONE); + public static void projectPoliciesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); } } ``` -### ImageVersions_ListByImage +### Pools_CreateOrUpdate ```java /** - * Samples for ImageVersions ListByImage. + * Samples for DevCenters ListByResourceGroup. */ -public final class ImageVersionsListByImageSamples { +public final class DevCentersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ImageVersions_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_ListByResourceGroup.json */ /** - * Sample code: ImageVersions_ListByImage. + * Sample code: DevCenters_ListByResourceGroup. * * @param manager Entry point to DevCenterManager. */ - public static void imageVersionsListByImage(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.imageVersions() - .listByImage("rg1", "Contoso", "DefaultDevGallery", "Win11", com.azure.core.util.Context.NONE); + public static void devCentersListByResourceGroup(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); } } ``` -### Images_Get +### Pools_Delete ```java +import com.azure.resourcemanager.devcenter.models.DevboxDisksEncryptionEnableStatus; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Images Get. + * Samples for EncryptionSets CreateOrUpdate. */ -public final class ImagesGetSamples { +public final class EncryptionSetsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Images_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Create.json */ /** - * Sample code: Images_Get. + * Sample code: EncryptionSets_Create. * * @param manager Entry point to DevCenterManager. */ - public static void imagesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.images() - .getWithResponse("rg1", "Contoso", "DefaultDevGallery", "ContosoBaseImage", - com.azure.core.util.Context.NONE); + public static void encryptionSetsCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets() + .define("EncryptionWestUs") + .withRegion("westus") + .withExistingDevcenter("rg1", "Contoso") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus.ENABLED) + .withKeyEncryptionKeyUrl("https://contosovaultwestus.vault.azure.net/keys/contosokek") + .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; } } ``` -### Images_ListByDevCenter +### Pools_Get ```java /** - * Samples for Images ListByDevCenter. + * Samples for ProjectCatalogImageDefinitions BuildImage. */ -public final class ImagesListByDevCenterSamples { +public final class ProjectCatalogImageDefinitionsBuildImageSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Images_ListByDevCenter. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_BuildImage.json */ /** - * Sample code: Images_ListByDevCenter. + * Sample code: ProjectCatalogImageDefinitions_BuildImage. * * @param manager Entry point to DevCenterManager. */ - public static void imagesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.images().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + public static void + projectCatalogImageDefinitionsBuildImage(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .buildImage("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", com.azure.core.util.Context.NONE); } } ``` -### Images_ListByGallery +### Pools_ListByProject ```java +import com.azure.resourcemanager.devcenter.models.EnvironmentRole; +import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentType; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Images ListByGallery. + * Samples for ProjectEnvironmentTypes Update. */ -public final class ImagesListByGallerySamples { +public final class ProjectEnvironmentTypesUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Images_ListByGallery.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectEnvironmentTypes_Patch.json */ /** - * Sample code: Images_ListByGallery. + * Sample code: ProjectEnvironmentTypes_Update. * * @param manager Entry point to DevCenterManager. */ - public static void imagesListByGallery(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.images().listByGallery("rg1", "Contoso", "DevGallery", null, com.azure.core.util.Context.NONE); + public static void projectEnvironmentTypesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + ProjectEnvironmentType resource = manager.projectEnvironmentTypes() + .getWithResponse("rg1", "ContosoProj", "DevTest", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("CostCenter", "RnD")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDeploymentTargetId("/subscriptions/00000000-0000-0000-0000-000000000000") + .withStatus(EnvironmentTypeEnableStatus.ENABLED) + .withUserRoleAssignments(mapOf("e45e3m7c-176e-416a-b466-0c5ec8298f8a", + new UserRoleAssignmentValue() + .withRoles(mapOf("4cbf0b6c-e750-441c-98a7-10da8387e4d6", new EnvironmentRole())))) + .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; } } ``` -### NetworkConnections_CreateOrUpdate +### Pools_RunHealthChecks ```java -import com.azure.resourcemanager.devcenter.models.DomainJoinType; +import com.azure.resourcemanager.devcenter.models.NetworkConnection; /** - * Samples for NetworkConnections CreateOrUpdate. + * Samples for NetworkConnections Update. */ -public final class NetworkConnectionsCreateOrUpdateSamples { +public final class NetworkConnectionsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Put. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Patch.json */ /** - * Sample code: NetworkConnections_CreateOrUpdate. + * Sample code: NetworkConnections_Update. * * @param manager Entry point to DevCenterManager. */ - public static void networkConnectionsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections() - .define("uswest3network") - .withRegion("centralus") - .withExistingResourceGroup("rg1") - .withNetworkingResourceGroupName("NetworkInterfaces") - .withDomainJoinType(DomainJoinType.HYBRID_AZURE_ADJOIN) - .withSubnetId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default") - .withDomainName("mydomaincontroller.local") - .withDomainUsername("testuser@mydomaincontroller.local") - .withDomainPassword("Password value for user") - .create(); + public static void networkConnectionsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + NetworkConnection resource = manager.networkConnections() + .getByResourceGroupWithResponse("rg1", "uswest3network", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDomainPassword("New Password value for user").apply(); } } ``` -### NetworkConnections_Delete +### Pools_Update ```java +import com.azure.resourcemanager.devcenter.models.GitCatalog; + /** - * Samples for NetworkConnections Delete. + * Samples for ProjectCatalogs CreateOrUpdate. */ -public final class NetworkConnectionsDeleteSamples { +public final class ProjectCatalogsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Delete - * .json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_CreateAdo.json */ /** - * Sample code: NetworkConnections_Delete. + * Sample code: ProjectCatalogs_CreateOrUpdateAdo. * * @param manager Entry point to DevCenterManager. */ - public static void networkConnectionsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections().delete("rg1", "eastusnetwork", com.azure.core.util.Context.NONE); + public static void projectCatalogsCreateOrUpdateAdo(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs() + .define("CentralCatalog") + .withExistingProject("rg1", "DevProject") + .withAdoGit(new GitCatalog() + .withUri("https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso") + .withBranch("main") + .withSecretIdentifier("fakeTokenPlaceholder") + .withPath("/templates")) + .create(); } -} -``` -### NetworkConnections_GetByResourceGroup - -```java -/** - * Samples for NetworkConnections GetByResourceGroup. - */ -public final class NetworkConnectionsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Get. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_CreateGitHub.json */ /** - * Sample code: NetworkConnections_Get. + * Sample code: ProjectCatalogs_CreateOrUpdateGitHub. * * @param manager Entry point to DevCenterManager. */ - public static void networkConnectionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections() - .getByResourceGroupWithResponse("rg1", "uswest3network", com.azure.core.util.Context.NONE); + public static void + projectCatalogsCreateOrUpdateGitHub(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogs() + .define("CentralCatalog") + .withExistingProject("rg1", "DevProject") + .withGitHub(new GitCatalog().withUri("https://github.com/Contoso/centralrepo-fake.git") + .withBranch("main") + .withSecretIdentifier("fakeTokenPlaceholder") + .withPath("/templates")) + .create(); } } ``` -### NetworkConnections_GetHealthDetails +### ProjectAllowedEnvironmentTypes_Get ```java /** - * Samples for NetworkConnections GetHealthDetails. + * Samples for CustomizationTasks ListByCatalog. */ -public final class NetworkConnectionsGetHealthDetailsSamples { +public final class CustomizationTasksListByCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * NetworkConnections_GetHealthDetails.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CustomizationTasks_ListByCatalog.json */ /** - * Sample code: NetworkConnections_GetHealthDetails. + * Sample code: CustomizationTasks_ListByCatalog. * * @param manager Entry point to DevCenterManager. */ - public static void - networkConnectionsGetHealthDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections() - .getHealthDetailsWithResponse("rg1", "eastusnetwork", com.azure.core.util.Context.NONE); + public static void customizationTasksListByCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.customizationTasks() + .listByCatalog("rg1", "Contoso", "CentralCatalog", null, com.azure.core.util.Context.NONE); } } ``` -### NetworkConnections_List +### ProjectAllowedEnvironmentTypes_List ```java /** - * Samples for NetworkConnections List. + * Samples for Images GetByProject. */ -public final class NetworkConnectionsListSamples { +public final class ImagesGetByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * NetworkConnections_ListBySubscription.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_GetByProject.json */ /** - * Sample code: NetworkConnections_ListBySubscription. + * Sample code: Images_GetByProject. * * @param manager Entry point to DevCenterManager. */ - public static void - networkConnectionsListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections().list(null, com.azure.core.util.Context.NONE); + public static void imagesGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images() + .getByProjectWithResponse("rg1", "myProject", "~gallery~DefaultDevGallery~ContosoBaseImage", + com.azure.core.util.Context.NONE); } } ``` -### NetworkConnections_ListByResourceGroup +### ProjectCatalogEnvironmentDefinitions_GetErrorDetails ```java +import com.azure.resourcemanager.devcenter.models.EnvironmentRole; +import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for NetworkConnections ListByResourceGroup. + * Samples for ProjectEnvironmentTypes CreateOrUpdate. */ -public final class NetworkConnectionsListByResourceGroupSamples { +public final class ProjectEnvironmentTypesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * NetworkConnections_ListByResourceGroup.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectEnvironmentTypes_Put.json */ /** - * Sample code: NetworkConnections_ListByResourceGroup. + * Sample code: ProjectEnvironmentTypes_CreateOrUpdate. * * @param manager Entry point to DevCenterManager. */ public static void - networkConnectionsListByResourceGroup(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); + projectEnvironmentTypesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectEnvironmentTypes() + .define("DevTest") + .withExistingProject("rg1", "ContosoProj") + .withTags(mapOf("CostCenter", "RnD")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDeploymentTargetId("/subscriptions/00000000-0000-0000-0000-000000000000") + .withStatus(EnvironmentTypeEnableStatus.ENABLED) + .withCreatorRoleAssignment(new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment() + .withRoles(mapOf("4cbf0b6c-e750-441c-98a7-10da8387e4d6", new EnvironmentRole()))) + .withUserRoleAssignments(mapOf("e45e3m7c-176e-416a-b466-0c5ec8298f8a", + new UserRoleAssignmentValue() + .withRoles(mapOf("4cbf0b6c-e750-441c-98a7-10da8387e4d6", new EnvironmentRole())))) + .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; } } ``` -### NetworkConnections_ListHealthDetails +### ProjectCatalogImageDefinitionBuildOperation_Cancel ```java /** - * Samples for NetworkConnections ListHealthDetails. + * Samples for Catalogs Sync. */ -public final class NetworkConnectionsListHealthDetailsSamples { +public final class CatalogsSyncSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * NetworkConnections_ListHealthDetails.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Sync. + * json */ /** - * Sample code: NetworkConnections_ListHealthDetails. + * Sample code: Catalogs_Sync. * * @param manager Entry point to DevCenterManager. */ - public static void - networkConnectionsListHealthDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections().listHealthDetails("rg1", "uswest3network", null, com.azure.core.util.Context.NONE); + public static void catalogsSync(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs().sync("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); } } ``` -### NetworkConnections_ListOutboundNetworkDependenciesEndpoints +### ProjectCatalogImageDefinitionBuildOperation_Get ```java /** - * Samples for NetworkConnections ListOutboundNetworkDependenciesEndpoints. + * Samples for DevCenterCatalogImageDefinitions GetByDevCenterCatalog. */ -public final class NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples { +public final class DevCenterCatalogImageDefinitionsGetByDevCenterCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * NetworkConnections_ListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetByDevCenterCatalog.json */ /** - * Sample code: ListOutboundNetworkDependencies. + * Sample code: ImageDefinitions_GetByDevCenterCatalog. * * @param manager Entry point to DevCenterManager. */ - public static void listOutboundNetworkDependencies(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections() - .listOutboundNetworkDependenciesEndpoints("rg1", "uswest3network", null, com.azure.core.util.Context.NONE); + public static void + imageDefinitionsGetByDevCenterCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .getByDevCenterCatalogWithResponse("rg1", "ContosoDevCenter", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); } } ``` -### NetworkConnections_RunHealthChecks +### ProjectCatalogImageDefinitionBuildOperation_GetBuildDetails ```java /** - * Samples for NetworkConnections RunHealthChecks. + * Samples for ProjectEnvironmentTypes Delete. */ -public final class NetworkConnectionsRunHealthChecksSamples { +public final class ProjectEnvironmentTypesDeleteSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * NetworkConnections_RunHealthChecks.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectEnvironmentTypes_Delete.json */ /** - * Sample code: NetworkConnections_RunHealthChecks. + * Sample code: ProjectEnvironmentTypes_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void networkConnectionsRunHealthChecks(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.networkConnections().runHealthChecks("rg1", "uswest3network", com.azure.core.util.Context.NONE); + public static void projectEnvironmentTypesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectEnvironmentTypes() + .deleteWithResponse("rg1", "ContosoProj", "DevTest", com.azure.core.util.Context.NONE); } } ``` -### NetworkConnections_Update +### ProjectCatalogImageDefinitionBuilds_ListByImageDefinition ```java -import com.azure.resourcemanager.devcenter.models.NetworkConnection; +import com.azure.resourcemanager.devcenter.models.Schedule; /** - * Samples for NetworkConnections Update. + * Samples for Schedules Update. */ -public final class NetworkConnectionsUpdateSamples { +public final class SchedulesUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Patch. + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Schedules_Patch. * json */ /** - * Sample code: NetworkConnections_Update. + * Sample code: Schedules_Update. * * @param manager Entry point to DevCenterManager. */ - public static void networkConnectionsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - NetworkConnection resource = manager.networkConnections() - .getByResourceGroupWithResponse("rg1", "uswest3network", com.azure.core.util.Context.NONE) + public static void schedulesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + Schedule resource = manager.schedules() + .getWithResponse("rg1", "TestProject", "DevPool", "autoShutdown", null, com.azure.core.util.Context.NONE) .getValue(); - resource.update().withDomainPassword("New Password value for user").apply(); + resource.update().withTime("18:00").apply(); } } ``` -### OperationStatuses_Get +### ProjectCatalogImageDefinitions_BuildImage ```java /** - * Samples for OperationStatuses Get. + * Samples for EnvironmentTypes Delete. */ -public final class OperationStatusesGetSamples { +public final class EnvironmentTypesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/OperationStatus_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Delete.json */ /** - * Sample code: Get OperationStatus. + * Sample code: EnvironmentTypes_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void getOperationStatus(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.operationStatuses() - .getWithResponse("westus3", "3fa1a29d-e807-488d-81d1-f1c5456a08cd", com.azure.core.util.Context.NONE); + public static void environmentTypesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentTypes().deleteWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### ProjectCatalogImageDefinitions_GetByProjectCatalog ```java /** - * Samples for Operations List. + * Samples for Projects List. */ -public final class OperationsListSamples { +public final class ProjectsListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Operations_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_ListBySubscription.json */ /** - * Sample code: Operations_Get. + * Sample code: Projects_ListBySubscription. * * @param manager Entry point to DevCenterManager. */ - public static void operationsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void projectsListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects().list(null, com.azure.core.util.Context.NONE); } } ``` -### Pools_CreateOrUpdate +### ProjectCatalogImageDefinitions_GetErrorDetails ```java -import com.azure.resourcemanager.devcenter.models.LicenseType; -import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; -import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus; -import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; -import java.util.Arrays; +import com.azure.resourcemanager.devcenter.models.DevCenter; +import java.util.HashMap; +import java.util.Map; /** - * Samples for Pools CreateOrUpdate. + * Samples for DevCenters Update. */ -public final class PoolsCreateOrUpdateSamples { +public final class DevCentersUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Put.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/DevCenters_Patch + * .json */ /** - * Sample code: Pools_CreateOrUpdate. + * Sample code: DevCenters_Update. * * @param manager Entry point to DevCenterManager. */ - public static void poolsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools() - .define("DevPool") - .withRegion("centralus") - .withExistingProject("rg1", "DevProject") - .withDevBoxDefinitionName("WebDevBox") - .withNetworkConnectionName("Network1-westus2") - .withLicenseType(LicenseType.WINDOWS_CLIENT) - .withLocalAdministrator(LocalAdminStatus.ENABLED) - .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) - .withGracePeriodMinutes(60)) - .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) - .withDisplayName("Developer Pool") - .withVirtualNetworkType(VirtualNetworkType.UNMANAGED) - .create(); + public static void devCentersUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + DevCenter resource = manager.devCenters() + .getByResourceGroupWithResponse("rg1", "Contoso", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("CostCode", "fakeTokenPlaceholder")).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; } +} +``` + +### ProjectCatalogImageDefinitions_ListByProjectCatalog +```java +/** + * Samples for NetworkConnections Delete. + */ +public final class NetworkConnectionsDeleteSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * Pools_PutWithManagedNetwork.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Delete.json */ /** - * Sample code: Pools_CreateOrUpdateWithManagedNetwork. + * Sample code: NetworkConnections_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void - poolsCreateOrUpdateWithManagedNetwork(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools() - .define("DevPool") - .withRegion("centralus") - .withExistingProject("rg1", "DevProject") - .withDevBoxDefinitionName("WebDevBox") - .withNetworkConnectionName("managedNetwork") - .withLicenseType(LicenseType.WINDOWS_CLIENT) - .withLocalAdministrator(LocalAdminStatus.ENABLED) - .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) - .withGracePeriodMinutes(60)) - .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) - .withDisplayName("Developer Pool") - .withVirtualNetworkType(VirtualNetworkType.MANAGED) - .withManagedVirtualNetworkRegions(Arrays.asList("centralus")) - .create(); + public static void networkConnectionsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections().delete("rg1", "eastusnetwork", com.azure.core.util.Context.NONE); } } ``` -### Pools_Delete +### ProjectCatalogs_Connect ```java /** - * Samples for Pools Delete. + * Samples for ProjectEnvironmentTypes List. */ -public final class PoolsDeleteSamples { +public final class ProjectEnvironmentTypesListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectEnvironmentTypes_List.json */ /** - * Sample code: Pools_Delete. + * Sample code: ProjectEnvironmentTypes_List. * * @param manager Entry point to DevCenterManager. */ - public static void poolsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools().delete("rg1", "DevProject", "poolName", com.azure.core.util.Context.NONE); + public static void projectEnvironmentTypesList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectEnvironmentTypes().list("rg1", "ContosoProj", null, com.azure.core.util.Context.NONE); } } ``` -### Pools_Get +### ProjectCatalogs_CreateOrUpdate ```java +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationIdentityType; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationManagedIdentity; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationSettings; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Pools Get. + * Samples for Projects CreateOrUpdate. */ -public final class PoolsGetSamples { +public final class ProjectsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_GetUnhealthyStatus. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_PutWithMaxDevBoxPerUser.json */ /** - * Sample code: Pools_GetUnhealthyStatus. + * Sample code: Projects_CreateOrUpdateWithLimitsPerDev. * * @param manager Entry point to DevCenterManager. */ - public static void poolsGetUnhealthyStatus(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools().getWithResponse("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE); + public static void + projectsCreateOrUpdateWithLimitsPerDev(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects() + .define("DevProject") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCenter", "R&D")) + .withDevCenterId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") + .withDescription("This is my first project.") + .withMaxDevBoxesPerUser(3) + .create(); } /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_PutWithCustomizationSettings.json */ /** - * Sample code: Pools_Get. + * Sample code: Projects_CreateOrUpdateWithCustomizationSettings. * * @param manager Entry point to DevCenterManager. */ - public static void poolsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools().getWithResponse("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE); + public static void + projectsCreateOrUpdateWithCustomizationSettings(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects() + .define("DevProject") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCenter", "R&D")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDevCenterId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") + .withDescription("This is my first project.") + .withCustomizationSettings(new ProjectCustomizationSettings() + .withIdentities(Arrays.asList(new ProjectCustomizationManagedIdentity() + .withIdentityType(ProjectCustomizationIdentityType.USER_ASSIGNED_IDENTITY) + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1")))) + .create(); } -} -``` - -### Pools_ListByProject -```java -/** - * Samples for Pools ListByProject. - */ -public final class PoolsListByProjectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_PutWithCustomizationSettings_SystemIdentity.json */ /** - * Sample code: Pools_ListByProject. + * Sample code: Projects_CreateOrUpdateWithCustomizationSettings_SystemIdentity. * * @param manager Entry point to DevCenterManager. */ - public static void poolsListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools().listByProject("rg1", "DevProject", null, com.azure.core.util.Context.NONE); + public static void projectsCreateOrUpdateWithCustomizationSettingsSystemIdentity( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects() + .define("DevProject") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCenter", "R&D")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withDevCenterId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") + .withDescription("This is my first project.") + .withCustomizationSettings(new ProjectCustomizationSettings() + .withIdentities(Arrays.asList(new ProjectCustomizationManagedIdentity() + .withIdentityType(ProjectCustomizationIdentityType.SYSTEM_ASSIGNED_IDENTITY)))) + .create(); } -} -``` - -### Pools_RunHealthChecks -```java -/** - * Samples for Pools RunHealthChecks. - */ -public final class PoolsRunHealthChecksSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_RunHealthChecks. + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Put. * json */ /** - * Sample code: Pools_RefreshStatus. + * Sample code: Projects_CreateOrUpdate. * * @param manager Entry point to DevCenterManager. */ - public static void poolsRefreshStatus(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.pools().runHealthChecks("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE); + public static void projectsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects() + .define("DevProject") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCenter", "R&D")) + .withDevCenterId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") + .withDescription("This is my first project.") + .withDisplayName("Dev") + .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; } } ``` -### Pools_Update +### ProjectCatalogs_Delete ```java -import com.azure.resourcemanager.devcenter.models.Pool; - /** - * Samples for Pools Update. + * Samples for DevCenterCatalogImageDefinitions ListByDevCenterCatalog. */ -public final class PoolsUpdateSamples { +public final class DevCenterCatalogImageDefinitionsListByDevCenterCatalogSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_ListByDevCenterCatalog.json */ /** - * Sample code: Pools_Update. + * Sample code: ImageDefinitions_ListByDevCenterCatalog. * * @param manager Entry point to DevCenterManager. */ - public static void poolsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - Pool resource = manager.pools() - .getWithResponse("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withDevBoxDefinitionName("WebDevBox2").apply(); + public static void + imageDefinitionsListByDevCenterCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .listByDevCenterCatalog("rg1", "ContosoDevCenter", "TeamCatalog", null, com.azure.core.util.Context.NONE); } } ``` -### ProjectAllowedEnvironmentTypes_Get +### ProjectCatalogs_Get ```java /** - * Samples for ProjectAllowedEnvironmentTypes Get. + * Samples for ProjectCatalogImageDefinitions ListByProjectCatalog. */ -public final class ProjectAllowedEnvironmentTypesGetSamples { +public final class ProjectCatalogImageDefinitionsListByProjectCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectAllowedEnvironmentTypes_Get.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_ListByProjectCatalog.json */ /** - * Sample code: ProjectAllowedEnvironmentTypes_Get. + * Sample code: ImageDefinitions_ListByProjectCatalog. * * @param manager Entry point to DevCenterManager. */ - public static void projectAllowedEnvironmentTypesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectAllowedEnvironmentTypes() - .getWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE); + public static void + imageDefinitionsListByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .listByProjectCatalog("rg1", "ContosoProject", "TeamCatalog", null, com.azure.core.util.Context.NONE); } } ``` -### ProjectAllowedEnvironmentTypes_List +### ProjectCatalogs_GetSyncErrorDetails ```java /** - * Samples for ProjectAllowedEnvironmentTypes List. + * Samples for EnvironmentDefinitions GetErrorDetails. */ -public final class ProjectAllowedEnvironmentTypesListSamples { +public final class EnvironmentDefinitionsGetErrorDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectAllowedEnvironmentTypes_List.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentDefinitions_GetErrorDetails.json */ /** - * Sample code: ProjectAllowedEnvironmentTypes_List. + * Sample code: EnvironmentDefinitions_GetErrorDetails. * * @param manager Entry point to DevCenterManager. */ public static void - projectAllowedEnvironmentTypesList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectAllowedEnvironmentTypes().list("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + environmentDefinitionsGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentDefinitions() + .getErrorDetailsWithResponse("rg1", "Contoso", "myCatalog", "myEnvironmentDefinition", + com.azure.core.util.Context.NONE); } } ``` -### ProjectCatalogEnvironmentDefinitions_GetErrorDetails +### ProjectCatalogs_List ```java /** - * Samples for ProjectCatalogEnvironmentDefinitions GetErrorDetails. + * Samples for ProjectCatalogImageDefinitionBuildOperation GetBuildDetails. */ -public final class ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples { +public final class ProjectCatalogImageDefinitionBuildOperationGetBuildDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectCatalogEnvironmentDefinitions_GetErrorDetails.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetImageBuildDetails.json */ /** - * Sample code: ProjectCatalogEnvironmentDefinitions_GetErrorDetails. + * Sample code: ProjectCatalogImageDefinitionBuild_GetErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogEnvironmentDefinitionsGetErrorDetails( + public static void projectCatalogImageDefinitionBuildGetErrorDetails( com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogEnvironmentDefinitions() - .getErrorDetailsWithResponse("rg1", "DevProject", "myCatalog", "myEnvironmentDefinition", - com.azure.core.util.Context.NONE); + manager.projectCatalogImageDefinitionBuildOperations() + .getBuildDetailsWithResponse("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); } } ``` -### ProjectCatalogs_Connect +### ProjectCatalogs_Patch ```java /** - * Samples for ProjectCatalogs Connect. + * Samples for Projects ListByResourceGroup. */ -public final class ProjectCatalogsConnectSamples { +public final class ProjectsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Connect. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_ListByResourceGroup.json */ /** - * Sample code: ProjectCatalogs_Connect. + * Sample code: Projects_ListByResourceGroup. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogsConnect(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs().connect("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void projectsListByResourceGroup(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); } } ``` -### ProjectCatalogs_CreateOrUpdate +### ProjectCatalogs_Sync ```java -import com.azure.resourcemanager.devcenter.models.GitCatalog; +import com.azure.resourcemanager.devcenter.models.HibernateSupport; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import com.azure.resourcemanager.devcenter.models.Sku; /** - * Samples for ProjectCatalogs CreateOrUpdate. + * Samples for DevBoxDefinitions CreateOrUpdate. */ -public final class ProjectCatalogsCreateOrUpdateSamples { +public final class DevBoxDefinitionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_CreateAdo - * .json - */ - /** - * Sample code: ProjectCatalogs_CreateOrUpdateAdo. - * - * @param manager Entry point to DevCenterManager. - */ - public static void projectCatalogsCreateOrUpdateAdo(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs() - .define("CentralCatalog") - .withExistingProject("rg1", "DevProject") - .withAdoGit(new GitCatalog() - .withUri("https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso") - .withBranch("main") - .withSecretIdentifier("fakeTokenPlaceholder") - .withPath("/templates")) - .create(); - } - - /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectCatalogs_CreateGitHub.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Create.json */ /** - * Sample code: ProjectCatalogs_CreateOrUpdateGitHub. + * Sample code: DevBoxDefinitions_Create. * * @param manager Entry point to DevCenterManager. */ - public static void - projectCatalogsCreateOrUpdateGitHub(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs() - .define("CentralCatalog") - .withExistingProject("rg1", "DevProject") - .withGitHub(new GitCatalog().withUri("https://github.com/Contoso/centralrepo-fake.git") - .withBranch("main") - .withSecretIdentifier("fakeTokenPlaceholder") - .withPath("/templates")) + public static void devBoxDefinitionsCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devBoxDefinitions() + .define("WebDevBox") + .withRegion("centralus") + .withExistingDevcenter("rg1", "Contoso") + .withImageReference(new ImageReference().withId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/versions/1.0.0")) + .withSku(new Sku().withName("Preview")) + .withHibernateSupport(HibernateSupport.ENABLED) .create(); } } ``` -### ProjectCatalogs_Delete +### ProjectEnvironmentTypes_CreateOrUpdate ```java +import com.azure.resourcemanager.devcenter.models.EnvironmentType; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ProjectCatalogs Delete. + * Samples for EnvironmentTypes Update. */ -public final class ProjectCatalogsDeleteSamples { +public final class EnvironmentTypesUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Patch.json */ /** - * Sample code: ProjectCatalogs_Delete. + * Sample code: EnvironmentTypes_Update. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs().delete("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void environmentTypesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + EnvironmentType resource = manager.environmentTypes() + .getWithResponse("rg1", "Contoso", "DevTest", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Owner", "superuser")).withDisplayName("Dev").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; } } ``` -### ProjectCatalogs_Get +### ProjectEnvironmentTypes_Delete ```java /** - * Samples for ProjectCatalogs Get. + * Samples for Schedules Delete. */ -public final class ProjectCatalogsGetSamples { +public final class SchedulesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Schedules_Delete + * .json */ /** - * Sample code: ProjectCatalogs_Get. + * Sample code: Schedules_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs() - .getWithResponse("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void schedulesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.schedules() + .delete("rg1", "TestProject", "DevPool", "autoShutdown", null, com.azure.core.util.Context.NONE); } } ``` -### ProjectCatalogs_GetSyncErrorDetails +### ProjectEnvironmentTypes_Get ```java /** - * Samples for ProjectCatalogs GetSyncErrorDetails. + * Samples for Pools RunHealthChecks. */ -public final class ProjectCatalogsGetSyncErrorDetailsSamples { +public final class PoolsRunHealthChecksSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectCatalogs_GetSyncErrorDetails.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_RunHealthChecks.json */ /** - * Sample code: ProjectCatalogs_GetSyncErrorDetails. + * Sample code: Pools_RefreshStatus. * * @param manager Entry point to DevCenterManager. */ - public static void - projectCatalogsGetSyncErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs() - .getSyncErrorDetailsWithResponse("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void poolsRefreshStatus(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools().runHealthChecks("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE); } } ``` -### ProjectCatalogs_List +### ProjectEnvironmentTypes_List ```java +import com.azure.resourcemanager.devcenter.models.DevCenterEncryptionSet; +import com.azure.resourcemanager.devcenter.models.DevboxDisksEncryptionEnableStatus; + /** - * Samples for ProjectCatalogs List. + * Samples for EncryptionSets Update. */ -public final class ProjectCatalogsListSamples { +public final class EncryptionSetsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Patch.json */ /** - * Sample code: ProjectCatalogs_List. + * Sample code: EncryptionSets_Update. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogsList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs().list("rg1", "DevProject", null, com.azure.core.util.Context.NONE); + public static void encryptionSetsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + DevCenterEncryptionSet resource = manager.encryptionSets() + .getWithResponse("rg1", "Contoso", "EncryptionWestUs", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus.ENABLED).apply(); } } ``` -### ProjectCatalogs_Patch +### ProjectEnvironmentTypes_Update ```java -import com.azure.resourcemanager.devcenter.models.Catalog; -import com.azure.resourcemanager.devcenter.models.GitCatalog; - /** - * Samples for ProjectCatalogs Patch. + * Samples for ImageVersions ListByImage. */ -public final class ProjectCatalogsPatchSamples { +public final class ImageVersionsListByImageSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Patch. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_List.json */ /** - * Sample code: ProjectCatalogs_Patch. + * Sample code: ImageVersions_ListByImage. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogsPatch(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - Catalog resource = manager.projectCatalogs() - .getWithResponse("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withGitHub(new GitCatalog().withPath("/environments")).apply(); + public static void imageVersionsListByImage(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.imageVersions() + .listByImage("rg1", "Contoso", "DefaultDevGallery", "Win11", com.azure.core.util.Context.NONE); } } ``` -### ProjectCatalogs_Sync +### ProjectPolicies_CreateOrUpdate ```java /** - * Samples for ProjectCatalogs Sync. + * Samples for ProjectPolicies Delete. */ -public final class ProjectCatalogsSyncSamples { +public final class ProjectPoliciesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Sync.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Delete.json */ /** - * Sample code: ProjectCatalogs_Sync. + * Sample code: ProjectPolicies_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void projectCatalogsSync(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectCatalogs().sync("rg1", "DevProject", "CentralCatalog", com.azure.core.util.Context.NONE); + public static void projectPoliciesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies().delete("rg1", "Contoso", "DevOnlyResources", com.azure.core.util.Context.NONE); } } ``` -### ProjectEnvironmentTypes_CreateOrUpdate +### ProjectPolicies_Delete ```java -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.devcenter.models.CatalogSyncType; +import com.azure.resourcemanager.devcenter.models.CatalogUpdate; +import com.azure.resourcemanager.devcenter.models.GitCatalog; /** - * Samples for ProjectEnvironmentTypes CreateOrUpdate. + * Samples for Catalogs Update. */ -public final class ProjectEnvironmentTypesCreateOrUpdateSamples { +public final class CatalogsUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectEnvironmentTypes_Put.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Patch. + * json */ /** - * Sample code: ProjectEnvironmentTypes_CreateOrUpdate. + * Sample code: Catalogs_Update. * * @param manager Entry point to DevCenterManager. */ - public static void - projectEnvironmentTypesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectEnvironmentTypes() - .define("DevTest") - .withExistingProject("rg1", "ContosoProj") - .withTags(mapOf("CostCenter", "RnD")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", - new UserAssignedIdentity()))) - .withDeploymentTargetId("/subscriptions/00000000-0000-0000-0000-000000000000") - .withStatus(EnvironmentTypeEnableStatus.ENABLED) - .withCreatorRoleAssignment(new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment() - .withRoles(mapOf("4cbf0b6c-e750-441c-98a7-10da8387e4d6", new EnvironmentRole()))) - .withUserRoleAssignments(mapOf("e45e3m7c-176e-416a-b466-0c5ec8298f8a", - new UserRoleAssignmentValue() - .withRoles(mapOf("4cbf0b6c-e750-441c-98a7-10da8387e4d6", new EnvironmentRole())))) - .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; + public static void catalogsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs() + .update("rg1", "Contoso", "CentralCatalog", + new CatalogUpdate().withGitHub(new GitCatalog().withPath("/environments")) + .withSyncType(CatalogSyncType.SCHEDULED), + com.azure.core.util.Context.NONE); } } ``` -### ProjectEnvironmentTypes_Delete +### ProjectPolicies_Get ```java /** - * Samples for ProjectEnvironmentTypes Delete. + * Samples for Projects GetByResourceGroup. */ -public final class ProjectEnvironmentTypesDeleteSamples { +public final class ProjectsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectEnvironmentTypes_Delete.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Get. + * json */ /** - * Sample code: ProjectEnvironmentTypes_Delete. + * Sample code: Projects_Get. * * @param manager Entry point to DevCenterManager. */ - public static void projectEnvironmentTypesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectEnvironmentTypes() - .deleteWithResponse("rg1", "ContosoProj", "DevTest", com.azure.core.util.Context.NONE); + public static void projectsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects().getByResourceGroupWithResponse("rg1", "DevProject", com.azure.core.util.Context.NONE); } } ``` -### ProjectEnvironmentTypes_Get +### ProjectPolicies_ListByDevCenter ```java /** - * Samples for ProjectEnvironmentTypes Get. + * Samples for OperationStatuses Get. */ -public final class ProjectEnvironmentTypesGetSamples { +public final class OperationStatusesGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectEnvironmentTypes_Get.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * OperationStatus_Get.json */ /** - * Sample code: ProjectEnvironmentTypes_Get. + * Sample code: Get OperationStatus. * * @param manager Entry point to DevCenterManager. */ - public static void projectEnvironmentTypesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectEnvironmentTypes() - .getWithResponse("rg1", "ContosoProj", "DevTest", com.azure.core.util.Context.NONE); + public static void getOperationStatus(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.operationStatuses() + .getWithResponse("westus3", "3fa1a29d-e807-488d-81d1-f1c5456a08cd", com.azure.core.util.Context.NONE); } } ``` -### ProjectEnvironmentTypes_List +### ProjectPolicies_Update ```java /** - * Samples for ProjectEnvironmentTypes List. + * Samples for Images ListByDevCenter. */ -public final class ProjectEnvironmentTypesListSamples { +public final class ImagesListByDevCenterSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectEnvironmentTypes_List.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_ListByDevCenter.json */ /** - * Sample code: ProjectEnvironmentTypes_List. + * Sample code: Images_ListByDevCenter. * * @param manager Entry point to DevCenterManager. */ - public static void projectEnvironmentTypesList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projectEnvironmentTypes().list("rg1", "ContosoProj", null, com.azure.core.util.Context.NONE); + public static void imagesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); } } ``` -### ProjectEnvironmentTypes_Update +### Projects_CreateOrUpdate ```java -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentType; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for ProjectEnvironmentTypes Update. + * Samples for NetworkConnections ListOutboundNetworkDependenciesEndpoints. */ -public final class ProjectEnvironmentTypesUpdateSamples { +public final class NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * ProjectEnvironmentTypes_Patch.json - */ - /** - * Sample code: ProjectEnvironmentTypes_Update. - * - * @param manager Entry point to DevCenterManager. + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_ListOutboundNetworkDependenciesEndpoints.json */ - public static void projectEnvironmentTypesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - ProjectEnvironmentType resource = manager.projectEnvironmentTypes() - .getWithResponse("rg1", "ContosoProj", "DevTest", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("CostCenter", "RnD")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", - new UserAssignedIdentity()))) - .withDeploymentTargetId("/subscriptions/00000000-0000-0000-0000-000000000000") - .withStatus(EnvironmentTypeEnableStatus.ENABLED) - .withUserRoleAssignments(mapOf("e45e3m7c-176e-416a-b466-0c5ec8298f8a", - new UserRoleAssignmentValue() - .withRoles(mapOf("4cbf0b6c-e750-441c-98a7-10da8387e4d6", new EnvironmentRole())))) - .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; + /** + * Sample code: ListOutboundNetworkDependencies. + * + * @param manager Entry point to DevCenterManager. + */ + public static void listOutboundNetworkDependencies(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections() + .listOutboundNetworkDependenciesEndpoints("rg1", "uswest3network", null, com.azure.core.util.Context.NONE); } } ``` -### Projects_CreateOrUpdate +### Projects_Delete ```java -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Projects CreateOrUpdate. + * Samples for Pools Get. */ -public final class ProjectsCreateOrUpdateSamples { +public final class PoolsGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * Projects_PutWithMaxDevBoxPerUser.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_GetUnhealthyStatus.json */ /** - * Sample code: Projects_CreateOrUpdateWithLimitsPerDev. + * Sample code: Pools_GetUnhealthyStatus. * * @param manager Entry point to DevCenterManager. */ - public static void - projectsCreateOrUpdateWithLimitsPerDev(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projects() - .define("DevProject") - .withRegion("centralus") - .withExistingResourceGroup("rg1") - .withTags(mapOf("CostCenter", "R&D")) - .withDevCenterId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") - .withDescription("This is my first project.") - .withMaxDevBoxesPerUser(3) - .create(); + public static void poolsGetUnhealthyStatus(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools().getWithResponse("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE); } /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Put.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Get.json */ /** - * Sample code: Projects_CreateOrUpdate. + * Sample code: Pools_Get. * * @param manager Entry point to DevCenterManager. */ - public static void projectsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projects() - .define("DevProject") - .withRegion("centralus") - .withExistingResourceGroup("rg1") - .withTags(mapOf("CostCenter", "R&D")) - .withDevCenterId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") - .withDescription("This is my first project.") - .withDisplayName("Dev") - .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; + public static void poolsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools().getWithResponse("rg1", "DevProject", "DevPool", com.azure.core.util.Context.NONE); } } ``` -### Projects_Delete +### Projects_GetByResourceGroup ```java /** - * Samples for Projects Delete. + * Samples for ProjectAllowedEnvironmentTypes List. */ -public final class ProjectsDeleteSamples { +public final class ProjectAllowedEnvironmentTypesListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectAllowedEnvironmentTypes_List.json */ /** - * Sample code: Projects_Delete. + * Sample code: ProjectAllowedEnvironmentTypes_List. * * @param manager Entry point to DevCenterManager. */ - public static void projectsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projects().delete("rg1", "DevProject", com.azure.core.util.Context.NONE); + public static void + projectAllowedEnvironmentTypesList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectAllowedEnvironmentTypes().list("rg1", "Contoso", null, com.azure.core.util.Context.NONE); } } ``` -### Projects_GetByResourceGroup +### Projects_GetInheritedSettings ```java /** - * Samples for Projects GetByResourceGroup. + * Samples for Pools ListByProject. */ -public final class ProjectsGetByResourceGroupSamples { +public final class PoolsListByProjectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_List.json */ /** - * Sample code: Projects_Get. + * Sample code: Pools_ListByProject. * * @param manager Entry point to DevCenterManager. */ - public static void projectsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projects().getByResourceGroupWithResponse("rg1", "DevProject", com.azure.core.util.Context.NONE); + public static void poolsListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools().listByProject("rg1", "DevProject", null, com.azure.core.util.Context.NONE); } } ``` @@ -2580,20 +3776,23 @@ public final class ProjectsGetByResourceGroupSamples { ```java /** - * Samples for Projects List. + * Samples for NetworkConnections GetHealthDetails. */ -public final class ProjectsListSamples { +public final class NetworkConnectionsGetHealthDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * Projects_ListBySubscription.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_GetHealthDetails.json */ /** - * Sample code: Projects_ListBySubscription. + * Sample code: NetworkConnections_GetHealthDetails. * * @param manager Entry point to DevCenterManager. */ - public static void projectsListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projects().list(null, com.azure.core.util.Context.NONE); + public static void + networkConnectionsGetHealthDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.networkConnections() + .getHealthDetailsWithResponse("rg1", "eastusnetwork", com.azure.core.util.Context.NONE); } } ``` @@ -2602,20 +3801,23 @@ public final class ProjectsListSamples { ```java /** - * Samples for Projects ListByResourceGroup. + * Samples for EnvironmentDefinitions ListByProjectCatalog. */ -public final class ProjectsListByResourceGroupSamples { +public final class EnvironmentDefinitionsListByProjectCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ - * Projects_ListByResourceGroup.json + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentDefinitions_ListByProjectCatalog.json */ /** - * Sample code: Projects_ListByResourceGroup. + * Sample code: EnvironmentDefinitions_ListByProjectCatalog. * * @param manager Entry point to DevCenterManager. */ - public static void projectsListByResourceGroup(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.projects().listByResourceGroup("rg1", null, com.azure.core.util.Context.NONE); + public static void + environmentDefinitionsListByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentDefinitions() + .listByProjectCatalog("rg1", "DevProject", "myCatalog", com.azure.core.util.Context.NONE); } } ``` @@ -2623,54 +3825,53 @@ public final class ProjectsListByResourceGroupSamples { ### Projects_Update ```java -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.Project; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Projects Update. + * Samples for EncryptionSets Delete. */ -public final class ProjectsUpdateSamples { +public final class EncryptionSetsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Delete.json */ /** - * Sample code: Projects_Update. + * Sample code: EncryptionSets_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void projectsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - Project resource = manager.projects() - .getByResourceGroupWithResponse("rg1", "DevProject", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("CostCenter", "R&D")) - .withDescription("This is my first project.") - .withDisplayName("Dev") - .withCatalogSettings(new ProjectCatalogSettings() - .withCatalogItemSyncTypes(Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION))) - .apply(); + public static void encryptionSetsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets().delete("rg1", "Contoso", "EncryptionWestUs", 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; +### Schedules_CreateOrUpdate + +```java +/** + * Samples for EnvironmentDefinitions GetByProjectCatalog. + */ +public final class EnvironmentDefinitionsGetByProjectCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentDefinitions_GetByProjectCatalog.json + */ + /** + * Sample code: EnvironmentDefinitions_GetByProjectCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + environmentDefinitionsGetByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentDefinitions() + .getByProjectCatalogWithResponse("rg1", "DevProject", "myCatalog", "myEnvironmentDefinition", + com.azure.core.util.Context.NONE); } } ``` -### Schedules_CreateOrUpdate +### Schedules_Delete ```java import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; @@ -2682,7 +3883,8 @@ import com.azure.resourcemanager.devcenter.models.ScheduledType; */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Schedules_CreateDailyShutdownPoolSchedule.json */ /** @@ -2705,120 +3907,126 @@ public final class SchedulesCreateOrUpdateSamples { } ``` -### Schedules_Delete +### Schedules_Get ```java /** - * Samples for Schedules Delete. + * Samples for CustomizationTasks GetErrorDetails. */ -public final class SchedulesDeleteSamples { +public final class CustomizationTasksGetErrorDetailsSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CustomizationTasks_GetErrorDetails.json */ /** - * Sample code: Schedules_Delete. + * Sample code: CustomizationTasks_GetErrorDetails. * * @param manager Entry point to DevCenterManager. */ - public static void schedulesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.schedules() - .delete("rg1", "TestProject", "DevPool", "autoShutdown", null, com.azure.core.util.Context.NONE); + public static void customizationTasksGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.customizationTasks() + .getErrorDetailsWithResponse("rg1", "Contoso", "CentralCatalog", "SampleTask", + com.azure.core.util.Context.NONE); } } ``` -### Schedules_Get +### Schedules_ListByPool ```java /** - * Samples for Schedules Get. + * Samples for Galleries CreateOrUpdate. */ -public final class SchedulesGetSamples { +public final class GalleriesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_Create + * .json */ /** - * Sample code: Schedules_GetByPool. + * Sample code: Galleries_CreateOrUpdate. * * @param manager Entry point to DevCenterManager. */ - public static void schedulesGetByPool(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.schedules() - .getWithResponse("rg1", "TestProject", "DevPool", "autoShutdown", null, com.azure.core.util.Context.NONE); + public static void galleriesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.galleries() + .define("StandardGallery") + .withExistingDevcenter("rg1", "Contoso") + .withGalleryResourceId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.Compute/galleries/StandardGallery") + .create(); } } ``` -### Schedules_ListByPool +### Schedules_Update ```java /** - * Samples for Schedules ListByPool. + * Samples for EnvironmentDefinitions Get. */ -public final class SchedulesListByPoolSamples { +public final class EnvironmentDefinitionsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_ListByPool.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentDefinitions_Get.json */ /** - * Sample code: Schedules_ListByPool. + * Sample code: EnvironmentDefinitions_Get. * * @param manager Entry point to DevCenterManager. */ - public static void schedulesListByPool(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.schedules().listByPool("rg1", "TestProject", "DevPool", null, com.azure.core.util.Context.NONE); + public static void environmentDefinitionsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.environmentDefinitions() + .getWithResponse("rg1", "Contoso", "myCatalog", "myEnvironmentDefinition", + com.azure.core.util.Context.NONE); } } ``` -### Schedules_Update +### Skus_List ```java -import com.azure.resourcemanager.devcenter.models.Schedule; - /** - * Samples for Schedules Update. + * Samples for Galleries Delete. */ -public final class SchedulesUpdateSamples { +public final class GalleriesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_Delete + * .json */ /** - * Sample code: Schedules_Update. + * Sample code: Galleries_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void schedulesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - Schedule resource = manager.schedules() - .getWithResponse("rg1", "TestProject", "DevPool", "autoShutdown", null, com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTime("18:00").apply(); + public static void galleriesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.galleries().delete("rg1", "Contoso", "StandardGallery", com.azure.core.util.Context.NONE); } } ``` -### Skus_List +### Skus_ListByProject ```java /** - * Samples for Skus List. + * Samples for Catalogs Delete. */ -public final class SkusListSamples { +public final class CatalogsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Skus_ListBySubscription. + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Delete. * json */ /** - * Sample code: Skus_ListBySubscription. + * Sample code: Catalogs_Delete. * * @param manager Entry point to DevCenterManager. */ - public static void skusListBySubscription(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.skus().list(null, com.azure.core.util.Context.NONE); + public static void catalogsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.catalogs().delete("rg1", "Contoso", "CentralCatalog", com.azure.core.util.Context.NONE); } } ``` @@ -2827,21 +4035,21 @@ public final class SkusListSamples { ```java /** - * Samples for Usages ListByLocation. + * Samples for Galleries Get. */ -public final class UsagesListByLocationSamples { +public final class GalleriesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Usages_ListByLocation. + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_Get. * json */ /** - * Sample code: listUsages. + * Sample code: Galleries_Get. * * @param manager Entry point to DevCenterManager. */ - public static void listUsages(com.azure.resourcemanager.devcenter.DevCenterManager manager) { - manager.usages().listByLocation("westus", com.azure.core.util.Context.NONE); + public static void galleriesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.galleries().getWithResponse("rg1", "Contoso", "StandardGallery", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml b/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml index 3da7576414cd..ce32940fe442 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml +++ b/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for DevCenter Management - This package contains Microsoft Azure SDK for DevCenter Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DevCenter Management API. Package tag package-2024-02. + This package contains Microsoft Azure SDK for DevCenter Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DevCenter Management API. Package tag package-preview-2025-04-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/DevCenterManager.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/DevCenterManager.java index a83a3899fc90..447eedb2236c 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/DevCenterManager.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/DevCenterManager.java @@ -22,15 +22,21 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devcenter.fluent.DevCenterManagementClient; import com.azure.resourcemanager.devcenter.implementation.AttachedNetworksImpl; import com.azure.resourcemanager.devcenter.implementation.CatalogsImpl; import com.azure.resourcemanager.devcenter.implementation.CheckNameAvailabilitiesImpl; import com.azure.resourcemanager.devcenter.implementation.CheckScopedNameAvailabilitiesImpl; +import com.azure.resourcemanager.devcenter.implementation.CustomizationTasksImpl; import com.azure.resourcemanager.devcenter.implementation.DevBoxDefinitionsImpl; +import com.azure.resourcemanager.devcenter.implementation.DevCenterCatalogImageDefinitionBuildOperationsImpl; +import com.azure.resourcemanager.devcenter.implementation.DevCenterCatalogImageDefinitionBuildsImpl; +import com.azure.resourcemanager.devcenter.implementation.DevCenterCatalogImageDefinitionsImpl; import com.azure.resourcemanager.devcenter.implementation.DevCenterManagementClientBuilder; import com.azure.resourcemanager.devcenter.implementation.DevCentersImpl; +import com.azure.resourcemanager.devcenter.implementation.EncryptionSetsImpl; import com.azure.resourcemanager.devcenter.implementation.EnvironmentDefinitionsImpl; import com.azure.resourcemanager.devcenter.implementation.EnvironmentTypesImpl; import com.azure.resourcemanager.devcenter.implementation.GalleriesImpl; @@ -42,8 +48,12 @@ import com.azure.resourcemanager.devcenter.implementation.PoolsImpl; import com.azure.resourcemanager.devcenter.implementation.ProjectAllowedEnvironmentTypesImpl; import com.azure.resourcemanager.devcenter.implementation.ProjectCatalogEnvironmentDefinitionsImpl; +import com.azure.resourcemanager.devcenter.implementation.ProjectCatalogImageDefinitionBuildOperationsImpl; +import com.azure.resourcemanager.devcenter.implementation.ProjectCatalogImageDefinitionBuildsImpl; +import com.azure.resourcemanager.devcenter.implementation.ProjectCatalogImageDefinitionsImpl; import com.azure.resourcemanager.devcenter.implementation.ProjectCatalogsImpl; import com.azure.resourcemanager.devcenter.implementation.ProjectEnvironmentTypesImpl; +import com.azure.resourcemanager.devcenter.implementation.ProjectPoliciesImpl; import com.azure.resourcemanager.devcenter.implementation.ProjectsImpl; import com.azure.resourcemanager.devcenter.implementation.SchedulesImpl; import com.azure.resourcemanager.devcenter.implementation.SkusImpl; @@ -52,8 +62,13 @@ import com.azure.resourcemanager.devcenter.models.Catalogs; import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilities; import com.azure.resourcemanager.devcenter.models.CheckScopedNameAvailabilities; +import com.azure.resourcemanager.devcenter.models.CustomizationTasks; import com.azure.resourcemanager.devcenter.models.DevBoxDefinitions; +import com.azure.resourcemanager.devcenter.models.DevCenterCatalogImageDefinitionBuildOperations; +import com.azure.resourcemanager.devcenter.models.DevCenterCatalogImageDefinitionBuilds; +import com.azure.resourcemanager.devcenter.models.DevCenterCatalogImageDefinitions; import com.azure.resourcemanager.devcenter.models.DevCenters; +import com.azure.resourcemanager.devcenter.models.EncryptionSets; import com.azure.resourcemanager.devcenter.models.EnvironmentDefinitions; import com.azure.resourcemanager.devcenter.models.EnvironmentTypes; import com.azure.resourcemanager.devcenter.models.Galleries; @@ -65,8 +80,12 @@ import com.azure.resourcemanager.devcenter.models.Pools; import com.azure.resourcemanager.devcenter.models.ProjectAllowedEnvironmentTypes; import com.azure.resourcemanager.devcenter.models.ProjectCatalogEnvironmentDefinitions; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogImageDefinitionBuildOperations; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogImageDefinitionBuilds; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogImageDefinitions; import com.azure.resourcemanager.devcenter.models.ProjectCatalogs; import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypes; +import com.azure.resourcemanager.devcenter.models.ProjectPolicies; import com.azure.resourcemanager.devcenter.models.Projects; import com.azure.resourcemanager.devcenter.models.Schedules; import com.azure.resourcemanager.devcenter.models.Skus; @@ -75,6 +94,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -85,6 +105,10 @@ public final class DevCenterManager { private DevCenters devCenters; + private EncryptionSets encryptionSets; + + private ProjectPolicies projectPolicies; + private Projects projects; private AttachedNetworks attachedNetworks; @@ -101,6 +125,8 @@ public final class DevCenterManager { private ImageVersions imageVersions; + private Skus skus; + private Catalogs catalogs; private EnvironmentTypes environmentTypes; @@ -121,7 +147,19 @@ public final class DevCenterManager { private CheckScopedNameAvailabilities checkScopedNameAvailabilities; - private Skus skus; + private CustomizationTasks customizationTasks; + + private DevCenterCatalogImageDefinitions devCenterCatalogImageDefinitions; + + private DevCenterCatalogImageDefinitionBuilds devCenterCatalogImageDefinitionBuilds; + + private DevCenterCatalogImageDefinitionBuildOperations devCenterCatalogImageDefinitionBuildOperations; + + private ProjectCatalogImageDefinitions projectCatalogImageDefinitions; + + private ProjectCatalogImageDefinitionBuilds projectCatalogImageDefinitionBuilds; + + private ProjectCatalogImageDefinitionBuildOperations projectCatalogImageDefinitionBuildOperations; private Pools pools; @@ -181,6 +219,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-devcenter.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -288,12 +329,14 @@ public DevCenterManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.devcenter") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -351,6 +394,30 @@ public DevCenters devCenters() { return devCenters; } + /** + * Gets the resource collection API of EncryptionSets. It manages DevCenterEncryptionSet. + * + * @return Resource collection API of EncryptionSets. + */ + public EncryptionSets encryptionSets() { + if (this.encryptionSets == null) { + this.encryptionSets = new EncryptionSetsImpl(clientObject.getEncryptionSets(), this); + } + return encryptionSets; + } + + /** + * Gets the resource collection API of ProjectPolicies. It manages ProjectPolicy. + * + * @return Resource collection API of ProjectPolicies. + */ + public ProjectPolicies projectPolicies() { + if (this.projectPolicies == null) { + this.projectPolicies = new ProjectPoliciesImpl(clientObject.getProjectPolicies(), this); + } + return projectPolicies; + } + /** * Gets the resource collection API of Projects. It manages Project. * @@ -449,6 +516,18 @@ public ImageVersions imageVersions() { return imageVersions; } + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + /** * Gets the resource collection API of Catalogs. * @@ -574,15 +653,94 @@ public CheckScopedNameAvailabilities checkScopedNameAvailabilities() { } /** - * Gets the resource collection API of Skus. + * Gets the resource collection API of CustomizationTasks. * - * @return Resource collection API of Skus. + * @return Resource collection API of CustomizationTasks. */ - public Skus skus() { - if (this.skus == null) { - this.skus = new SkusImpl(clientObject.getSkus(), this); + public CustomizationTasks customizationTasks() { + if (this.customizationTasks == null) { + this.customizationTasks = new CustomizationTasksImpl(clientObject.getCustomizationTasks(), this); } - return skus; + return customizationTasks; + } + + /** + * Gets the resource collection API of DevCenterCatalogImageDefinitions. + * + * @return Resource collection API of DevCenterCatalogImageDefinitions. + */ + public DevCenterCatalogImageDefinitions devCenterCatalogImageDefinitions() { + if (this.devCenterCatalogImageDefinitions == null) { + this.devCenterCatalogImageDefinitions + = new DevCenterCatalogImageDefinitionsImpl(clientObject.getDevCenterCatalogImageDefinitions(), this); + } + return devCenterCatalogImageDefinitions; + } + + /** + * Gets the resource collection API of DevCenterCatalogImageDefinitionBuilds. + * + * @return Resource collection API of DevCenterCatalogImageDefinitionBuilds. + */ + public DevCenterCatalogImageDefinitionBuilds devCenterCatalogImageDefinitionBuilds() { + if (this.devCenterCatalogImageDefinitionBuilds == null) { + this.devCenterCatalogImageDefinitionBuilds = new DevCenterCatalogImageDefinitionBuildsImpl( + clientObject.getDevCenterCatalogImageDefinitionBuilds(), this); + } + return devCenterCatalogImageDefinitionBuilds; + } + + /** + * Gets the resource collection API of DevCenterCatalogImageDefinitionBuildOperations. + * + * @return Resource collection API of DevCenterCatalogImageDefinitionBuildOperations. + */ + public DevCenterCatalogImageDefinitionBuildOperations devCenterCatalogImageDefinitionBuildOperations() { + if (this.devCenterCatalogImageDefinitionBuildOperations == null) { + this.devCenterCatalogImageDefinitionBuildOperations + = new DevCenterCatalogImageDefinitionBuildOperationsImpl( + clientObject.getDevCenterCatalogImageDefinitionBuildOperations(), this); + } + return devCenterCatalogImageDefinitionBuildOperations; + } + + /** + * Gets the resource collection API of ProjectCatalogImageDefinitions. + * + * @return Resource collection API of ProjectCatalogImageDefinitions. + */ + public ProjectCatalogImageDefinitions projectCatalogImageDefinitions() { + if (this.projectCatalogImageDefinitions == null) { + this.projectCatalogImageDefinitions + = new ProjectCatalogImageDefinitionsImpl(clientObject.getProjectCatalogImageDefinitions(), this); + } + return projectCatalogImageDefinitions; + } + + /** + * Gets the resource collection API of ProjectCatalogImageDefinitionBuilds. + * + * @return Resource collection API of ProjectCatalogImageDefinitionBuilds. + */ + public ProjectCatalogImageDefinitionBuilds projectCatalogImageDefinitionBuilds() { + if (this.projectCatalogImageDefinitionBuilds == null) { + this.projectCatalogImageDefinitionBuilds = new ProjectCatalogImageDefinitionBuildsImpl( + clientObject.getProjectCatalogImageDefinitionBuilds(), this); + } + return projectCatalogImageDefinitionBuilds; + } + + /** + * Gets the resource collection API of ProjectCatalogImageDefinitionBuildOperations. + * + * @return Resource collection API of ProjectCatalogImageDefinitionBuildOperations. + */ + public ProjectCatalogImageDefinitionBuildOperations projectCatalogImageDefinitionBuildOperations() { + if (this.projectCatalogImageDefinitionBuildOperations == null) { + this.projectCatalogImageDefinitionBuildOperations = new ProjectCatalogImageDefinitionBuildOperationsImpl( + clientObject.getProjectCatalogImageDefinitionBuildOperations(), this); + } + return projectCatalogImageDefinitionBuildOperations; } /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/CustomizationTasksClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/CustomizationTasksClient.java new file mode 100644 index 000000000000..d1ed8fd78360 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/CustomizationTasksClient.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.CustomizationTaskInner; + +/** + * An instance of this class provides access to all the operations defined in CustomizationTasksClient. + */ +public interface CustomizationTasksClient { + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String devCenterName, + String catalogName); + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context); + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String devCenterName, String catalogName, + String taskName, Context context); + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomizationTaskInner get(String resourceGroupName, String devCenterName, String catalogName, String taskName); + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String taskName, Context context); + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CatalogResourceValidationErrorDetailsInner getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String taskName); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionBuildOperationsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionBuildOperationsClient.java new file mode 100644 index 000000000000..8accd4c2e7e7 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionBuildOperationsClient.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.devcenter.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; + +/** + * An instance of this class provides access to all the operations defined in + * DevCenterCatalogImageDefinitionBuildOperationsClient. + */ +public interface DevCenterCatalogImageDefinitionBuildOperationsClient { + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, Context context); + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageDefinitionBuildInner get(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginCancel(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginCancel(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName, Context context); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageDefinitionBuildDetailsInner getBuildDetails(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionBuildsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionBuildsClient.java new file mode 100644 index 000000000000..655891e085b0 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionBuildsClient.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.devcenter.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; + +/** + * An instance of this class provides access to all the operations defined in + * DevCenterCatalogImageDefinitionBuildsClient. + */ +public interface DevCenterCatalogImageDefinitionBuildsClient { + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByImageDefinition(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName); + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByImageDefinition(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionsClient.java new file mode 100644 index 000000000000..fdf195afec3e --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterCatalogImageDefinitionsClient.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.devcenter.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.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in DevCenterCatalogImageDefinitionsClient. + */ +public interface DevCenterCatalogImageDefinitionsClient { + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName); + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByDevCenterCatalogWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageDefinitionInner getByDevCenterCatalog(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CatalogResourceValidationErrorDetailsInner getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginBuildImage(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginBuildImage(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterManagementClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterManagementClient.java index 18c96eaab884..b595188316fa 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterManagementClient.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/DevCenterManagementClient.java @@ -53,6 +53,20 @@ public interface DevCenterManagementClient { */ DevCentersClient getDevCenters(); + /** + * Gets the EncryptionSetsClient object to access its operations. + * + * @return the EncryptionSetsClient object. + */ + EncryptionSetsClient getEncryptionSets(); + + /** + * Gets the ProjectPoliciesClient object to access its operations. + * + * @return the ProjectPoliciesClient object. + */ + ProjectPoliciesClient getProjectPolicies(); + /** * Gets the ProjectsClient object to access its operations. * @@ -109,6 +123,13 @@ public interface DevCenterManagementClient { */ ImageVersionsClient getImageVersions(); + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + /** * Gets the CatalogsClient object to access its operations. * @@ -180,11 +201,53 @@ public interface DevCenterManagementClient { CheckScopedNameAvailabilitiesClient getCheckScopedNameAvailabilities(); /** - * Gets the SkusClient object to access its operations. + * Gets the CustomizationTasksClient object to access its operations. * - * @return the SkusClient object. + * @return the CustomizationTasksClient object. */ - SkusClient getSkus(); + CustomizationTasksClient getCustomizationTasks(); + + /** + * Gets the DevCenterCatalogImageDefinitionsClient object to access its operations. + * + * @return the DevCenterCatalogImageDefinitionsClient object. + */ + DevCenterCatalogImageDefinitionsClient getDevCenterCatalogImageDefinitions(); + + /** + * Gets the DevCenterCatalogImageDefinitionBuildsClient object to access its operations. + * + * @return the DevCenterCatalogImageDefinitionBuildsClient object. + */ + DevCenterCatalogImageDefinitionBuildsClient getDevCenterCatalogImageDefinitionBuilds(); + + /** + * Gets the DevCenterCatalogImageDefinitionBuildOperationsClient object to access its operations. + * + * @return the DevCenterCatalogImageDefinitionBuildOperationsClient object. + */ + DevCenterCatalogImageDefinitionBuildOperationsClient getDevCenterCatalogImageDefinitionBuildOperations(); + + /** + * Gets the ProjectCatalogImageDefinitionsClient object to access its operations. + * + * @return the ProjectCatalogImageDefinitionsClient object. + */ + ProjectCatalogImageDefinitionsClient getProjectCatalogImageDefinitions(); + + /** + * Gets the ProjectCatalogImageDefinitionBuildsClient object to access its operations. + * + * @return the ProjectCatalogImageDefinitionBuildsClient object. + */ + ProjectCatalogImageDefinitionBuildsClient getProjectCatalogImageDefinitionBuilds(); + + /** + * Gets the ProjectCatalogImageDefinitionBuildOperationsClient object to access its operations. + * + * @return the ProjectCatalogImageDefinitionBuildOperationsClient object. + */ + ProjectCatalogImageDefinitionBuildOperationsClient getProjectCatalogImageDefinitionBuildOperations(); /** * Gets the PoolsClient object to access its operations. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/EncryptionSetsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/EncryptionSetsClient.java new file mode 100644 index 000000000000..264dd6e0f977 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/EncryptionSetsClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.fluent.models.DevCenterEncryptionSetInner; +import com.azure.resourcemanager.devcenter.models.EncryptionSetUpdate; + +/** + * An instance of this class provides access to all the operations defined in EncryptionSetsClient. + */ +public interface EncryptionSetsClient { + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String devCenterName); + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String devCenterName, Integer top, + Context context); + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String devCenterName, + String encryptionSetName, Context context); + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevCenterEncryptionSetInner get(String resourceGroupName, String devCenterName, String encryptionSetName); + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevCenterEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner body); + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevCenterEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner body, + Context context); + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevCenterEncryptionSetInner createOrUpdate(String resourceGroupName, String devCenterName, String encryptionSetName, + DevCenterEncryptionSetInner body); + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevCenterEncryptionSetInner createOrUpdate(String resourceGroupName, String devCenterName, String encryptionSetName, + DevCenterEncryptionSetInner body, Context context); + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevCenterEncryptionSetInner> + beginUpdate(String resourceGroupName, String devCenterName, String encryptionSetName, EncryptionSetUpdate body); + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevCenterEncryptionSetInner> beginUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, EncryptionSetUpdate body, + Context context); + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevCenterEncryptionSetInner update(String resourceGroupName, String devCenterName, String encryptionSetName, + EncryptionSetUpdate body); + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevCenterEncryptionSetInner update(String resourceGroupName, String devCenterName, String encryptionSetName, + EncryptionSetUpdate body, Context context); + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 devCenterName, + String encryptionSetName); + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 devCenterName, + String encryptionSetName, Context context); + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String encryptionSetName); + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String encryptionSetName, Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImageVersionsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImageVersionsClient.java index 6f222cd6422c..f95d5c6914b1 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImageVersionsClient.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImageVersionsClient.java @@ -82,4 +82,66 @@ Response getWithResponse(String resourceGroupName, String dev @ServiceMethod(returns = ReturnType.SINGLE) ImageVersionInner get(String resourceGroupName, String devCenterName, String galleryName, String imageName, String versionName); + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProject(String resourceGroupName, String projectName, String imageName); + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProject(String resourceGroupName, String projectName, String imageName, + Context context); + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByProjectWithResponse(String resourceGroupName, String projectName, String imageName, + String versionName, Context context); + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageVersionInner getByProject(String resourceGroupName, String projectName, String imageName, String versionName); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImagesClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImagesClient.java index 9faa431269ad..df903eee7ad3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImagesClient.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ImagesClient.java @@ -106,4 +106,61 @@ Response getWithResponse(String resourceGroupName, String devCenterN */ @ServiceMethod(returns = ReturnType.SINGLE) ImageInner get(String resourceGroupName, String devCenterName, String galleryName, String imageName); + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProject(String resourceGroupName, String projectName); + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProject(String resourceGroupName, String projectName, Context context); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByProjectWithResponse(String resourceGroupName, String projectName, String imageName, + Context context); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner getByProject(String resourceGroupName, String projectName, String imageName); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionBuildOperationsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionBuildOperationsClient.java new file mode 100644 index 000000000000..aad028bdc699 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionBuildOperationsClient.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.devcenter.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; + +/** + * An instance of this class provides access to all the operations defined in + * ProjectCatalogImageDefinitionBuildOperationsClient. + */ +public interface ProjectCatalogImageDefinitionBuildOperationsClient { + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context); + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageDefinitionBuildInner get(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginCancel(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginCancel(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName, Context context); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildDetailsWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageDefinitionBuildDetailsInner getBuildDetails(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionBuildsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionBuildsClient.java new file mode 100644 index 000000000000..16c9ad25f9f5 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionBuildsClient.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.devcenter.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; + +/** + * An instance of this class provides access to all the operations defined in ProjectCatalogImageDefinitionBuildsClient. + */ +public interface ProjectCatalogImageDefinitionBuildsClient { + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName); + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionsClient.java new file mode 100644 index 000000000000..51d1723b42e3 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectCatalogImageDefinitionsClient.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.devcenter.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.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in ProjectCatalogImageDefinitionsClient. + */ +public interface ProjectCatalogImageDefinitionsClient { + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName); + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName, Integer top, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByProjectCatalogWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageDefinitionInner getByProjectCatalog(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getErrorDetailsWithResponse(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, Context context); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CatalogResourceValidationErrorDetailsInner getErrorDetails(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginBuildImage(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginBuildImage(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, Context context); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectPoliciesClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectPoliciesClient.java new file mode 100644 index 000000000000..9e873b9e5638 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectPoliciesClient.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.fluent.models.ProjectPolicyInner; +import com.azure.resourcemanager.devcenter.models.ProjectPolicyUpdate; + +/** + * An instance of this class provides access to all the operations defined in ProjectPoliciesClient. + */ +public interface ProjectPoliciesClient { + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDevCenter(String resourceGroupName, String devCenterName); + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDevCenter(String resourceGroupName, String devCenterName, Integer top, + Context context); + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String devCenterName, + String projectPolicyName, Context context); + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectPolicyInner get(String resourceGroupName, String devCenterName, String projectPolicyName); + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectPolicyInner> beginCreateOrUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyInner body); + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectPolicyInner> beginCreateOrUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyInner body, Context context); + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectPolicyInner createOrUpdate(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyInner body); + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectPolicyInner createOrUpdate(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyInner body, Context context); + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectPolicyInner> beginUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyUpdate body); + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectPolicyInner> beginUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyUpdate body, Context context); + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectPolicyInner update(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyUpdate body); + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectPolicyInner update(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyUpdate body, Context context); + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 devCenterName, + String projectPolicyName); + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 devCenterName, + String projectPolicyName, Context context); + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String projectPolicyName); + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String projectPolicyName, Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectsClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectsClient.java index 841b526fddd7..d4a91dc9850c 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectsClient.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/ProjectsClient.java @@ -11,6 +11,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.devcenter.fluent.models.InheritedSettingsForProjectInner; import com.azure.resourcemanager.devcenter.fluent.models.ProjectInner; import com.azure.resourcemanager.devcenter.models.ProjectUpdate; @@ -266,4 +267,32 @@ SyncPoller, ProjectInner> beginUpdate(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String projectName, Context context); + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInheritedSettingsWithResponse(String resourceGroupName, + String projectName, Context context); + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InheritedSettingsForProjectInner getInheritedSettings(String resourceGroupName, String projectName); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/SkusClient.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/SkusClient.java index c9c2024804bf..b9cd0d58bb47 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/SkusClient.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/SkusClient.java @@ -14,6 +14,33 @@ * An instance of this class provides access to all the operations defined in SkusClient. */ public interface SkusClient { + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProject(String resourceGroupName, String projectName); + + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProject(String resourceGroupName, String projectName, Context context); + /** * Lists the Microsoft.DevCenter SKUs available in a subscription. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/CustomizationTaskInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/CustomizationTaskInner.java new file mode 100644 index 000000000000..032a58bbd1e1 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/CustomizationTaskInner.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.devcenter.fluent.models; + +import com.azure.core.annotation.Immutable; +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.devcenter.models.CatalogResourceValidationStatus; +import com.azure.resourcemanager.devcenter.models.CustomizationTaskInput; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a Task to be used in customizing a Dev Box. + */ +@Immutable +public final class CustomizationTaskInner extends ProxyResource { + /* + * Task properties + */ + private CustomizationTaskProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CustomizationTaskInner class. + */ + public CustomizationTaskInner() { + } + + /** + * Get the innerProperties property: Task properties. + * + * @return the innerProperties value. + */ + private CustomizationTaskProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the inputs property: Inputs to the task. + * + * @return the inputs value. + */ + public Map inputs() { + return this.innerProperties() == null ? null : this.innerProperties().inputs(); + } + + /** + * Get the timeout property: The default timeout for the task. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.innerProperties() == null ? null : this.innerProperties().timeout(); + } + + /** + * Get the validationStatus property: Validation status for the Task. + * + * @return the validationStatus value. + */ + public CatalogResourceValidationStatus validationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().validationStatus(); + } + + /** + * 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.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizationTaskInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizationTaskInner 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 CustomizationTaskInner. + */ + public static CustomizationTaskInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizationTaskInner deserializedCustomizationTaskInner = new CustomizationTaskInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCustomizationTaskInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCustomizationTaskInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCustomizationTaskInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCustomizationTaskInner.innerProperties = CustomizationTaskProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCustomizationTaskInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizationTaskInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/CustomizationTaskProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/CustomizationTaskProperties.java new file mode 100644 index 000000000000..9b8010011b4a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/CustomizationTaskProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.models.CatalogResourceValidationStatus; +import com.azure.resourcemanager.devcenter.models.CustomizationTaskInput; +import java.io.IOException; +import java.util.Map; + +/** + * Properties of a Task. + */ +@Immutable +public final class CustomizationTaskProperties implements JsonSerializable { + /* + * Inputs to the task. + */ + private Map inputs; + + /* + * The default timeout for the task. + */ + private Integer timeout; + + /* + * Validation status for the Task. + */ + private CatalogResourceValidationStatus validationStatus; + + /** + * Creates an instance of CustomizationTaskProperties class. + */ + public CustomizationTaskProperties() { + } + + /** + * Get the inputs property: Inputs to the task. + * + * @return the inputs value. + */ + public Map inputs() { + return this.inputs; + } + + /** + * Get the timeout property: The default timeout for the task. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Get the validationStatus property: Validation status for the Task. + * + * @return the validationStatus value. + */ + public CatalogResourceValidationStatus validationStatus() { + return this.validationStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inputs() != null) { + inputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizationTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizationTaskProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomizationTaskProperties. + */ + public static CustomizationTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizationTaskProperties deserializedCustomizationTaskProperties = new CustomizationTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inputs".equals(fieldName)) { + Map inputs + = reader.readMap(reader1 -> CustomizationTaskInput.fromJson(reader1)); + deserializedCustomizationTaskProperties.inputs = inputs; + } else if ("timeout".equals(fieldName)) { + deserializedCustomizationTaskProperties.timeout = reader.getNullable(JsonReader::getInt); + } else if ("validationStatus".equals(fieldName)) { + deserializedCustomizationTaskProperties.validationStatus + = CatalogResourceValidationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizationTaskProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetInner.java new file mode 100644 index 000000000000..f6b0df5847e4 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetInner.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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.devcenter.models.DevboxDisksEncryptionEnableStatus; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a devcenter encryption set resource. + */ +@Fluent +public final class DevCenterEncryptionSetInner extends Resource { + /* + * Properties of a devcenter encryption set. + */ + private DevCenterEncryptionSetProperties innerProperties; + + /* + * Managed identity properties + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DevCenterEncryptionSetInner class. + */ + public DevCenterEncryptionSetInner() { + } + + /** + * Get the innerProperties property: Properties of a devcenter encryption set. + * + * @return the innerProperties value. + */ + private DevCenterEncryptionSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: Managed identity properties. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identity properties. + * + * @param identity the identity value to set. + * @return the DevCenterEncryptionSetInner object itself. + */ + public DevCenterEncryptionSetInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public DevCenterEncryptionSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DevCenterEncryptionSetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @return the devboxDisksEncryptionEnableStatus value. + */ + public DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus() { + return this.innerProperties() == null ? null : this.innerProperties().devboxDisksEncryptionEnableStatus(); + } + + /** + * Set the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @param devboxDisksEncryptionEnableStatus the devboxDisksEncryptionEnableStatus value to set. + * @return the DevCenterEncryptionSetInner object itself. + */ + public DevCenterEncryptionSetInner + withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterEncryptionSetProperties(); + } + this.innerProperties().withDevboxDisksEncryptionEnableStatus(devboxDisksEncryptionEnableStatus); + return this; + } + + /** + * Get the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @return the keyEncryptionKeyUrl value. + */ + public String keyEncryptionKeyUrl() { + return this.innerProperties() == null ? null : this.innerProperties().keyEncryptionKeyUrl(); + } + + /** + * Set the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @param keyEncryptionKeyUrl the keyEncryptionKeyUrl value to set. + * @return the DevCenterEncryptionSetInner object itself. + */ + public DevCenterEncryptionSetInner withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterEncryptionSetProperties(); + } + this.innerProperties().withKeyEncryptionKeyUrl(keyEncryptionKeyUrl); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@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); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevCenterEncryptionSetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevCenterEncryptionSetInner 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 DevCenterEncryptionSetInner. + */ + public static DevCenterEncryptionSetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevCenterEncryptionSetInner deserializedDevCenterEncryptionSetInner = new DevCenterEncryptionSetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDevCenterEncryptionSetInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.innerProperties + = DevCenterEncryptionSetProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDevCenterEncryptionSetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDevCenterEncryptionSetInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetProperties.java new file mode 100644 index 000000000000..ddef8d9340d3 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.fluent.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.devcenter.models.DevboxDisksEncryptionEnableStatus; +import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the devcenter encryption set. + */ +@Fluent +public final class DevCenterEncryptionSetProperties extends DevCenterEncryptionSetUpdateProperties { + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DevCenterEncryptionSetProperties class. + */ + public DevCenterEncryptionSetProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public DevCenterEncryptionSetProperties + withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus) { + super.withDevboxDisksEncryptionEnableStatus(devboxDisksEncryptionEnableStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DevCenterEncryptionSetProperties withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) { + super.withKeyEncryptionKeyUrl(keyEncryptionKeyUrl); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("devboxDisksEncryptionEnableStatus", + devboxDisksEncryptionEnableStatus() == null ? null : devboxDisksEncryptionEnableStatus().toString()); + jsonWriter.writeStringField("keyEncryptionKeyUrl", keyEncryptionKeyUrl()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevCenterEncryptionSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevCenterEncryptionSetProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DevCenterEncryptionSetProperties. + */ + public static DevCenterEncryptionSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevCenterEncryptionSetProperties deserializedDevCenterEncryptionSetProperties + = new DevCenterEncryptionSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("devboxDisksEncryptionEnableStatus".equals(fieldName)) { + deserializedDevCenterEncryptionSetProperties.withDevboxDisksEncryptionEnableStatus( + DevboxDisksEncryptionEnableStatus.fromString(reader.getString())); + } else if ("keyEncryptionKeyUrl".equals(fieldName)) { + deserializedDevCenterEncryptionSetProperties.withKeyEncryptionKeyUrl(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDevCenterEncryptionSetProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDevCenterEncryptionSetProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetUpdateProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetUpdateProperties.java new file mode 100644 index 000000000000..4bf92f6ceb40 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterEncryptionSetUpdateProperties.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.devcenter.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.devcenter.models.DevboxDisksEncryptionEnableStatus; +import java.io.IOException; + +/** + * Properties of the devcenter encryption set. These properties can be updated after the resource has been created. + */ +@Fluent +public class DevCenterEncryptionSetUpdateProperties + implements JsonSerializable { + /* + * Devbox disk encryption enable or disable status. Indicates if Devbox disks encryption using DevCenter CMK is + * enabled or not. + */ + private DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus; + + /* + * Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + */ + private String keyEncryptionKeyUrl; + + /** + * Creates an instance of DevCenterEncryptionSetUpdateProperties class. + */ + public DevCenterEncryptionSetUpdateProperties() { + } + + /** + * Get the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @return the devboxDisksEncryptionEnableStatus value. + */ + public DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus() { + return this.devboxDisksEncryptionEnableStatus; + } + + /** + * Set the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @param devboxDisksEncryptionEnableStatus the devboxDisksEncryptionEnableStatus value to set. + * @return the DevCenterEncryptionSetUpdateProperties object itself. + */ + public DevCenterEncryptionSetUpdateProperties + withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus) { + this.devboxDisksEncryptionEnableStatus = devboxDisksEncryptionEnableStatus; + return this; + } + + /** + * Get the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @return the keyEncryptionKeyUrl value. + */ + public String keyEncryptionKeyUrl() { + return this.keyEncryptionKeyUrl; + } + + /** + * Set the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @param keyEncryptionKeyUrl the keyEncryptionKeyUrl value to set. + * @return the DevCenterEncryptionSetUpdateProperties object itself. + */ + public DevCenterEncryptionSetUpdateProperties withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) { + this.keyEncryptionKeyUrl = keyEncryptionKeyUrl; + 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("devboxDisksEncryptionEnableStatus", + this.devboxDisksEncryptionEnableStatus == null ? null : this.devboxDisksEncryptionEnableStatus.toString()); + jsonWriter.writeStringField("keyEncryptionKeyUrl", this.keyEncryptionKeyUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevCenterEncryptionSetUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevCenterEncryptionSetUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DevCenterEncryptionSetUpdateProperties. + */ + public static DevCenterEncryptionSetUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevCenterEncryptionSetUpdateProperties deserializedDevCenterEncryptionSetUpdateProperties + = new DevCenterEncryptionSetUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("devboxDisksEncryptionEnableStatus".equals(fieldName)) { + deserializedDevCenterEncryptionSetUpdateProperties.devboxDisksEncryptionEnableStatus + = DevboxDisksEncryptionEnableStatus.fromString(reader.getString()); + } else if ("keyEncryptionKeyUrl".equals(fieldName)) { + deserializedDevCenterEncryptionSetUpdateProperties.keyEncryptionKeyUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDevCenterEncryptionSetUpdateProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterInner.java index 0545e4d4815a..ac7d158be7f0 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterInner.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterInner.java @@ -10,6 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.DevBoxProvisioningSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterNetworkSettings; import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; import com.azure.resourcemanager.devcenter.models.Encryption; import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; @@ -235,6 +237,56 @@ public DevCenterInner withProjectCatalogSettings(DevCenterProjectCatalogSettings return this; } + /** + * Get the networkSettings property: Network settings that will be enforced on network resources associated with the + * Dev Center. + * + * @return the networkSettings value. + */ + public DevCenterNetworkSettings networkSettings() { + return this.innerProperties() == null ? null : this.innerProperties().networkSettings(); + } + + /** + * Set the networkSettings property: Network settings that will be enforced on network resources associated with the + * Dev Center. + * + * @param networkSettings the networkSettings value to set. + * @return the DevCenterInner object itself. + */ + public DevCenterInner withNetworkSettings(DevCenterNetworkSettings networkSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterProperties(); + } + this.innerProperties().withNetworkSettings(networkSettings); + return this; + } + + /** + * Get the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev Boxes that belong + * to this dev center. + * + * @return the devBoxProvisioningSettings value. + */ + public DevBoxProvisioningSettings devBoxProvisioningSettings() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxProvisioningSettings(); + } + + /** + * Set the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev Boxes that belong + * to this dev center. + * + * @param devBoxProvisioningSettings the devBoxProvisioningSettings value to set. + * @return the DevCenterInner object itself. + */ + public DevCenterInner withDevBoxProvisioningSettings(DevBoxProvisioningSettings devBoxProvisioningSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterProperties(); + } + this.innerProperties().withDevBoxProvisioningSettings(devBoxProvisioningSettings); + return this; + } + /** * Validates the instance. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterProperties.java index f11ca96f5f93..939081f3c747 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterProperties.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterProperties.java @@ -8,6 +8,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.DevBoxProvisioningSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterNetworkSettings; import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; import com.azure.resourcemanager.devcenter.models.Encryption; import com.azure.resourcemanager.devcenter.models.ProvisioningState; @@ -79,6 +81,24 @@ public DevCenterProperties withProjectCatalogSettings(DevCenterProjectCatalogSet return this; } + /** + * {@inheritDoc} + */ + @Override + public DevCenterProperties withNetworkSettings(DevCenterNetworkSettings networkSettings) { + super.withNetworkSettings(networkSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DevCenterProperties withDevBoxProvisioningSettings(DevBoxProvisioningSettings devBoxProvisioningSettings) { + super.withDevBoxProvisioningSettings(devBoxProvisioningSettings); + return this; + } + /** * Validates the instance. * @@ -92,6 +112,12 @@ public void validate() { if (projectCatalogSettings() != null) { projectCatalogSettings().validate(); } + if (networkSettings() != null) { + networkSettings().validate(); + } + if (devBoxProvisioningSettings() != null) { + devBoxProvisioningSettings().validate(); + } } /** @@ -103,6 +129,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("encryption", encryption()); jsonWriter.writeStringField("displayName", displayName()); jsonWriter.writeJsonField("projectCatalogSettings", projectCatalogSettings()); + jsonWriter.writeJsonField("networkSettings", networkSettings()); + jsonWriter.writeJsonField("devBoxProvisioningSettings", devBoxProvisioningSettings()); return jsonWriter.writeEndObject(); } @@ -128,6 +156,11 @@ public static DevCenterProperties fromJson(JsonReader jsonReader) throws IOExcep } else if ("projectCatalogSettings".equals(fieldName)) { deserializedDevCenterProperties .withProjectCatalogSettings(DevCenterProjectCatalogSettings.fromJson(reader)); + } else if ("networkSettings".equals(fieldName)) { + deserializedDevCenterProperties.withNetworkSettings(DevCenterNetworkSettings.fromJson(reader)); + } else if ("devBoxProvisioningSettings".equals(fieldName)) { + deserializedDevCenterProperties + .withDevBoxProvisioningSettings(DevBoxProvisioningSettings.fromJson(reader)); } else if ("provisioningState".equals(fieldName)) { deserializedDevCenterProperties.provisioningState = ProvisioningState.fromString(reader.getString()); diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterUpdateProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterUpdateProperties.java index f2524ad885a4..684759adef7c 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterUpdateProperties.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/DevCenterUpdateProperties.java @@ -9,6 +9,8 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.DevBoxProvisioningSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterNetworkSettings; import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; import com.azure.resourcemanager.devcenter.models.Encryption; import java.io.IOException; @@ -34,6 +36,16 @@ public class DevCenterUpdateProperties implements JsonSerializable taskGroups; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ImageDefinitionBuildDetailsInner class. + */ + public ImageDefinitionBuildDetailsInner() { + } + + /** + * Get the imageReference property: The specific image version used by the build. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Get the status property: The status of the build. + * + * @return the status value. + */ + public ImageDefinitionBuildStatus status() { + return this.status; + } + + /** + * Get the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the task group. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the errorDetails property: Details for image creation error. Populated when the image creation is not + * successful. + * + * @return the errorDetails value. + */ + public ImageCreationErrorDetails errorDetails() { + return this.errorDetails; + } + + /** + * Get the taskGroups property: The list of task groups executed during the image definition build. + * + * @return the taskGroups value. + */ + public List taskGroups() { + return this.taskGroups; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (errorDetails() != null) { + errorDetails().validate(); + } + if (taskGroups() != null) { + taskGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionBuildDetailsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildDetailsInner 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 ImageDefinitionBuildDetailsInner. + */ + public static ImageDefinitionBuildDetailsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildDetailsInner deserializedImageDefinitionBuildDetailsInner + = new ImageDefinitionBuildDetailsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.type = reader.getString(); + } else if ("imageReference".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.imageReference = ImageReference.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.status + = ImageDefinitionBuildStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("errorDetails".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.errorDetails + = ImageCreationErrorDetails.fromJson(reader); + } else if ("taskGroups".equals(fieldName)) { + List taskGroups + = reader.readArray(reader1 -> ImageDefinitionBuildTaskGroup.fromJson(reader1)); + deserializedImageDefinitionBuildDetailsInner.taskGroups = taskGroups; + } else if ("systemData".equals(fieldName)) { + deserializedImageDefinitionBuildDetailsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildDetailsInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionBuildInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionBuildInner.java new file mode 100644 index 000000000000..677f2c398d12 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionBuildInner.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.devcenter.fluent.models; + +import com.azure.core.annotation.Immutable; +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.devcenter.models.ImageCreationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildStatus; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Represents a specific build of an Image Definition. + */ +@Immutable +public final class ImageDefinitionBuildInner extends ProxyResource { + /* + * Image Definition Build properties + */ + private ImageDefinitionBuildProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ImageDefinitionBuildInner class. + */ + public ImageDefinitionBuildInner() { + } + + /** + * Get the innerProperties property: Image Definition Build properties. + * + * @return the innerProperties value. + */ + private ImageDefinitionBuildProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the imageReference property: The specific image version used by the build. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.innerProperties() == null ? null : this.innerProperties().imageReference(); + } + + /** + * Get the status property: The status of the build. + * + * @return the status value. + */ + public ImageDefinitionBuildStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.innerProperties() == null ? null : this.innerProperties().startTime(); + } + + /** + * Get the endTime property: End time of the task group. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.innerProperties() == null ? null : this.innerProperties().endTime(); + } + + /** + * Get the errorDetails property: Details for image creation error. Populated when the image creation is not + * successful. + * + * @return the errorDetails value. + */ + public ImageCreationErrorDetails errorDetails() { + return this.innerProperties() == null ? null : this.innerProperties().errorDetails(); + } + + /** + * 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.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionBuildInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildInner 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 ImageDefinitionBuildInner. + */ + public static ImageDefinitionBuildInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildInner deserializedImageDefinitionBuildInner = new ImageDefinitionBuildInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImageDefinitionBuildInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImageDefinitionBuildInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedImageDefinitionBuildInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedImageDefinitionBuildInner.innerProperties + = ImageDefinitionBuildProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedImageDefinitionBuildInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionBuildProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionBuildProperties.java new file mode 100644 index 000000000000..132e6dc5c413 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionBuildProperties.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.devcenter.fluent.models; + +import com.azure.core.annotation.Immutable; +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 com.azure.resourcemanager.devcenter.models.ImageCreationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildStatus; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of an Image Definition Build. + */ +@Immutable +public final class ImageDefinitionBuildProperties implements JsonSerializable { + /* + * The specific image version used by the build. + */ + private ImageReference imageReference; + + /* + * The status of the build. + */ + private ImageDefinitionBuildStatus status; + + /* + * Start time of the task group. + */ + private OffsetDateTime startTime; + + /* + * End time of the task group. + */ + private OffsetDateTime endTime; + + /* + * Details for image creation error. Populated when the image creation is not successful. + */ + private ImageCreationErrorDetails errorDetails; + + /** + * Creates an instance of ImageDefinitionBuildProperties class. + */ + public ImageDefinitionBuildProperties() { + } + + /** + * Get the imageReference property: The specific image version used by the build. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Get the status property: The status of the build. + * + * @return the status value. + */ + public ImageDefinitionBuildStatus status() { + return this.status; + } + + /** + * Get the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the task group. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the errorDetails property: Details for image creation error. Populated when the image creation is not + * successful. + * + * @return the errorDetails value. + */ + public ImageCreationErrorDetails errorDetails() { + return this.errorDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (errorDetails() != null) { + errorDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionBuildProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageDefinitionBuildProperties. + */ + public static ImageDefinitionBuildProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildProperties deserializedImageDefinitionBuildProperties + = new ImageDefinitionBuildProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageReference".equals(fieldName)) { + deserializedImageDefinitionBuildProperties.imageReference = ImageReference.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedImageDefinitionBuildProperties.status + = ImageDefinitionBuildStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedImageDefinitionBuildProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedImageDefinitionBuildProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("errorDetails".equals(fieldName)) { + deserializedImageDefinitionBuildProperties.errorDetails + = ImageCreationErrorDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionInner.java new file mode 100644 index 000000000000..8df1ed1251fd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionInner.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.devcenter.fluent.models; + +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.devcenter.models.AutoImageBuildStatus; +import com.azure.resourcemanager.devcenter.models.CatalogResourceValidationStatus; +import com.azure.resourcemanager.devcenter.models.CustomizationTaskInstance; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionReference; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import com.azure.resourcemanager.devcenter.models.ImageValidationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageValidationStatus; +import com.azure.resourcemanager.devcenter.models.LatestImageBuild; +import java.io.IOException; +import java.util.List; + +/** + * Represents a definition for an Image. + */ +@Fluent +public final class ImageDefinitionInner extends ProxyResource { + /* + * Image Definition properties + */ + private ImageDefinitionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ImageDefinitionInner class. + */ + public ImageDefinitionInner() { + } + + /** + * Get the innerProperties property: Image Definition properties. + * + * @return the innerProperties value. + */ + private ImageDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the imageReference property: Image reference information. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.innerProperties() == null ? null : this.innerProperties().imageReference(); + } + + /** + * Set the imageReference property: Image reference information. + * + * @param imageReference the imageReference value to set. + * @return the ImageDefinitionInner object itself. + */ + public ImageDefinitionInner withImageReference(ImageReference imageReference) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageDefinitionProperties(); + } + this.innerProperties().withImageReference(imageReference); + return this; + } + + /** + * Get the fileUrl property: The URL to the repository file containing the image definition. + * + * @return the fileUrl value. + */ + public String fileUrl() { + return this.innerProperties() == null ? null : this.innerProperties().fileUrl(); + } + + /** + * Get the latestBuild property: Details about the latest build. + * + * @return the latestBuild value. + */ + public LatestImageBuild latestBuild() { + return this.innerProperties() == null ? null : this.innerProperties().latestBuild(); + } + + /** + * Set the latestBuild property: Details about the latest build. + * + * @param latestBuild the latestBuild value to set. + * @return the ImageDefinitionInner object itself. + */ + public ImageDefinitionInner withLatestBuild(LatestImageBuild latestBuild) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageDefinitionProperties(); + } + this.innerProperties().withLatestBuild(latestBuild); + return this; + } + + /** + * Get the imageValidationStatus property: Validation status of the configured image. + * + * @return the imageValidationStatus value. + */ + public ImageValidationStatus imageValidationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().imageValidationStatus(); + } + + /** + * Get the imageValidationErrorDetails property: Details for image validator error. Populated when the image + * validation is not successful. + * + * @return the imageValidationErrorDetails value. + */ + public ImageValidationErrorDetails imageValidationErrorDetails() { + return this.innerProperties() == null ? null : this.innerProperties().imageValidationErrorDetails(); + } + + /** + * Get the validationStatus property: Validation status for the Image Definition. + * + * @return the validationStatus value. + */ + public CatalogResourceValidationStatus validationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().validationStatus(); + } + + /** + * Get the activeImageReference property: Image reference information for the currently active image (only populated + * during updates). + * + * @return the activeImageReference value. + */ + public ImageReference activeImageReference() { + return this.innerProperties() == null ? null : this.innerProperties().activeImageReference(); + } + + /** + * Get the autoImageBuild property: Indicates if automatic image builds will be triggered for image definition + * updates. + * + * @return the autoImageBuild value. + */ + public AutoImageBuildStatus autoImageBuild() { + return this.innerProperties() == null ? null : this.innerProperties().autoImageBuild(); + } + + /** + * Get the tasks property: Tasks to run at Dev Box provisioning time. + * + * @return the tasks value. + */ + public List tasks() { + return this.innerProperties() == null ? null : this.innerProperties().tasks(); + } + + /** + * Set the tasks property: Tasks to run at Dev Box provisioning time. + * + * @param tasks the tasks value to set. + * @return the ImageDefinitionInner object itself. + */ + public ImageDefinitionInner withTasks(List tasks) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageDefinitionProperties(); + } + this.innerProperties().withTasks(tasks); + return this; + } + + /** + * Get the userTasks property: Tasks to run when a user first logs into a Dev Box. + * + * @return the userTasks value. + */ + public List userTasks() { + return this.innerProperties() == null ? null : this.innerProperties().userTasks(); + } + + /** + * Set the userTasks property: Tasks to run when a user first logs into a Dev Box. + * + * @param userTasks the userTasks value to set. + * @return the ImageDefinitionInner object itself. + */ + public ImageDefinitionInner withUserTasks(List userTasks) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageDefinitionProperties(); + } + this.innerProperties().withUserTasks(userTasks); + return this; + } + + /** + * Get the extendsProperty property: Another Image Definition that this one extends. + * + * @return the extendsProperty value. + */ + public ImageDefinitionReference extendsProperty() { + return this.innerProperties() == null ? null : this.innerProperties().extendsProperty(); + } + + /** + * Set the extendsProperty property: Another Image Definition that this one extends. + * + * @param extendsProperty the extendsProperty value to set. + * @return the ImageDefinitionInner object itself. + */ + public ImageDefinitionInner withExtendsProperty(ImageDefinitionReference extendsProperty) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageDefinitionProperties(); + } + this.innerProperties().withExtendsProperty(extendsProperty); + 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.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionInner 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 ImageDefinitionInner. + */ + public static ImageDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionInner deserializedImageDefinitionInner = new ImageDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImageDefinitionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImageDefinitionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedImageDefinitionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedImageDefinitionInner.innerProperties = ImageDefinitionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedImageDefinitionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionProperties.java new file mode 100644 index 000000000000..17974e76127c --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ImageDefinitionProperties.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.models.AutoImageBuildStatus; +import com.azure.resourcemanager.devcenter.models.CatalogResourceValidationStatus; +import com.azure.resourcemanager.devcenter.models.CustomizationTaskInstance; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionReference; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import com.azure.resourcemanager.devcenter.models.ImageValidationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageValidationStatus; +import com.azure.resourcemanager.devcenter.models.LatestImageBuild; +import java.io.IOException; +import java.util.List; + +/** + * Properties of an Image Definition. + */ +@Fluent +public final class ImageDefinitionProperties implements JsonSerializable { + /* + * Image reference information. + */ + private ImageReference imageReference; + + /* + * The URL to the repository file containing the image definition. + */ + private String fileUrl; + + /* + * Details about the latest build. + */ + private LatestImageBuild latestBuild; + + /* + * Validation status of the configured image. + */ + private ImageValidationStatus imageValidationStatus; + + /* + * Details for image validator error. Populated when the image validation is not successful. + */ + private ImageValidationErrorDetails imageValidationErrorDetails; + + /* + * Validation status for the Image Definition. + */ + private CatalogResourceValidationStatus validationStatus; + + /* + * Image reference information for the currently active image (only populated during updates). + */ + private ImageReference activeImageReference; + + /* + * Indicates if automatic image builds will be triggered for image definition updates + */ + private AutoImageBuildStatus autoImageBuild; + + /* + * Tasks to run at Dev Box provisioning time. + */ + private List tasks; + + /* + * Tasks to run when a user first logs into a Dev Box. + */ + private List userTasks; + + /* + * Another Image Definition that this one extends. + */ + private ImageDefinitionReference extendsProperty; + + /** + * Creates an instance of ImageDefinitionProperties class. + */ + public ImageDefinitionProperties() { + } + + /** + * Get the imageReference property: Image reference information. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Image reference information. + * + * @param imageReference the imageReference value to set. + * @return the ImageDefinitionProperties object itself. + */ + public ImageDefinitionProperties withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the fileUrl property: The URL to the repository file containing the image definition. + * + * @return the fileUrl value. + */ + public String fileUrl() { + return this.fileUrl; + } + + /** + * Get the latestBuild property: Details about the latest build. + * + * @return the latestBuild value. + */ + public LatestImageBuild latestBuild() { + return this.latestBuild; + } + + /** + * Set the latestBuild property: Details about the latest build. + * + * @param latestBuild the latestBuild value to set. + * @return the ImageDefinitionProperties object itself. + */ + public ImageDefinitionProperties withLatestBuild(LatestImageBuild latestBuild) { + this.latestBuild = latestBuild; + return this; + } + + /** + * Get the imageValidationStatus property: Validation status of the configured image. + * + * @return the imageValidationStatus value. + */ + public ImageValidationStatus imageValidationStatus() { + return this.imageValidationStatus; + } + + /** + * Get the imageValidationErrorDetails property: Details for image validator error. Populated when the image + * validation is not successful. + * + * @return the imageValidationErrorDetails value. + */ + public ImageValidationErrorDetails imageValidationErrorDetails() { + return this.imageValidationErrorDetails; + } + + /** + * Get the validationStatus property: Validation status for the Image Definition. + * + * @return the validationStatus value. + */ + public CatalogResourceValidationStatus validationStatus() { + return this.validationStatus; + } + + /** + * Get the activeImageReference property: Image reference information for the currently active image (only populated + * during updates). + * + * @return the activeImageReference value. + */ + public ImageReference activeImageReference() { + return this.activeImageReference; + } + + /** + * Get the autoImageBuild property: Indicates if automatic image builds will be triggered for image definition + * updates. + * + * @return the autoImageBuild value. + */ + public AutoImageBuildStatus autoImageBuild() { + return this.autoImageBuild; + } + + /** + * Get the tasks property: Tasks to run at Dev Box provisioning time. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Tasks to run at Dev Box provisioning time. + * + * @param tasks the tasks value to set. + * @return the ImageDefinitionProperties object itself. + */ + public ImageDefinitionProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Get the userTasks property: Tasks to run when a user first logs into a Dev Box. + * + * @return the userTasks value. + */ + public List userTasks() { + return this.userTasks; + } + + /** + * Set the userTasks property: Tasks to run when a user first logs into a Dev Box. + * + * @param userTasks the userTasks value to set. + * @return the ImageDefinitionProperties object itself. + */ + public ImageDefinitionProperties withUserTasks(List userTasks) { + this.userTasks = userTasks; + return this; + } + + /** + * Get the extendsProperty property: Another Image Definition that this one extends. + * + * @return the extendsProperty value. + */ + public ImageDefinitionReference extendsProperty() { + return this.extendsProperty; + } + + /** + * Set the extendsProperty property: Another Image Definition that this one extends. + * + * @param extendsProperty the extendsProperty value to set. + * @return the ImageDefinitionProperties object itself. + */ + public ImageDefinitionProperties withExtendsProperty(ImageDefinitionReference extendsProperty) { + this.extendsProperty = extendsProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (latestBuild() != null) { + latestBuild().validate(); + } + if (imageValidationErrorDetails() != null) { + imageValidationErrorDetails().validate(); + } + if (activeImageReference() != null) { + activeImageReference().validate(); + } + if (tasks() != null) { + tasks().forEach(e -> e.validate()); + } + if (userTasks() != null) { + userTasks().forEach(e -> e.validate()); + } + if (extendsProperty() != null) { + extendsProperty().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("imageReference", this.imageReference); + jsonWriter.writeJsonField("latestBuild", this.latestBuild); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("userTasks", this.userTasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("extends", this.extendsProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageDefinitionProperties. + */ + public static ImageDefinitionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionProperties deserializedImageDefinitionProperties = new ImageDefinitionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageReference".equals(fieldName)) { + deserializedImageDefinitionProperties.imageReference = ImageReference.fromJson(reader); + } else if ("fileUrl".equals(fieldName)) { + deserializedImageDefinitionProperties.fileUrl = reader.getString(); + } else if ("latestBuild".equals(fieldName)) { + deserializedImageDefinitionProperties.latestBuild = LatestImageBuild.fromJson(reader); + } else if ("imageValidationStatus".equals(fieldName)) { + deserializedImageDefinitionProperties.imageValidationStatus + = ImageValidationStatus.fromString(reader.getString()); + } else if ("imageValidationErrorDetails".equals(fieldName)) { + deserializedImageDefinitionProperties.imageValidationErrorDetails + = ImageValidationErrorDetails.fromJson(reader); + } else if ("validationStatus".equals(fieldName)) { + deserializedImageDefinitionProperties.validationStatus + = CatalogResourceValidationStatus.fromString(reader.getString()); + } else if ("activeImageReference".equals(fieldName)) { + deserializedImageDefinitionProperties.activeImageReference = ImageReference.fromJson(reader); + } else if ("autoImageBuild".equals(fieldName)) { + deserializedImageDefinitionProperties.autoImageBuild + = AutoImageBuildStatus.fromString(reader.getString()); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> CustomizationTaskInstance.fromJson(reader1)); + deserializedImageDefinitionProperties.tasks = tasks; + } else if ("userTasks".equals(fieldName)) { + List userTasks + = reader.readArray(reader1 -> CustomizationTaskInstance.fromJson(reader1)); + deserializedImageDefinitionProperties.userTasks = userTasks; + } else if ("extends".equals(fieldName)) { + deserializedImageDefinitionProperties.extendsProperty = ImageDefinitionReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/InheritedSettingsForProjectInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/InheritedSettingsForProjectInner.java new file mode 100644 index 000000000000..38afb962bf6d --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/InheritedSettingsForProjectInner.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.devcenter.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.devcenter.models.DevCenterProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.ProjectNetworkSettings; +import java.io.IOException; + +/** + * Applicable inherited settings for a project. + */ +@Immutable +public final class InheritedSettingsForProjectInner implements JsonSerializable { + /* + * Dev Center settings to be used when associating a project with a catalog. + */ + private DevCenterProjectCatalogSettings projectCatalogSettings; + + /* + * Network settings that will be enforced on this project. + */ + private ProjectNetworkSettings networkSettings; + + /** + * Creates an instance of InheritedSettingsForProjectInner class. + */ + public InheritedSettingsForProjectInner() { + } + + /** + * Get the projectCatalogSettings property: Dev Center settings to be used when associating a project with a + * catalog. + * + * @return the projectCatalogSettings value. + */ + public DevCenterProjectCatalogSettings projectCatalogSettings() { + return this.projectCatalogSettings; + } + + /** + * Get the networkSettings property: Network settings that will be enforced on this project. + * + * @return the networkSettings value. + */ + public ProjectNetworkSettings networkSettings() { + return this.networkSettings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (projectCatalogSettings() != null) { + projectCatalogSettings().validate(); + } + if (networkSettings() != null) { + networkSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InheritedSettingsForProjectInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InheritedSettingsForProjectInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InheritedSettingsForProjectInner. + */ + public static InheritedSettingsForProjectInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InheritedSettingsForProjectInner deserializedInheritedSettingsForProjectInner + = new InheritedSettingsForProjectInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectCatalogSettings".equals(fieldName)) { + deserializedInheritedSettingsForProjectInner.projectCatalogSettings + = DevCenterProjectCatalogSettings.fromJson(reader); + } else if ("networkSettings".equals(fieldName)) { + deserializedInheritedSettingsForProjectInner.networkSettings + = ProjectNetworkSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInheritedSettingsForProjectInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolInner.java index b4ba10eca6a8..0f9281e0d02b 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolInner.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolInner.java @@ -10,13 +10,18 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.ActiveHoursConfiguration; +import com.azure.resourcemanager.devcenter.models.DevBoxTunnelEnableStatus; import com.azure.resourcemanager.devcenter.models.HealthStatus; import com.azure.resourcemanager.devcenter.models.HealthStatusDetail; import com.azure.resourcemanager.devcenter.models.LicenseType; import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinitionType; import com.azure.resourcemanager.devcenter.models.ProvisioningState; import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectConfiguration; import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; import java.io.IOException; import java.util.List; @@ -163,7 +168,33 @@ public ProvisioningState provisioningState() { } /** - * Get the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Get the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * + * @return the devBoxDefinitionType value. + */ + public PoolDevBoxDefinitionType devBoxDefinitionType() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxDefinitionType(); + } + + /** + * Set the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * + * @param devBoxDefinitionType the devBoxDefinitionType value to set. + * @return the PoolInner object itself. + */ + public PoolInner withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolProperties(); + } + this.innerProperties().withDevBoxDefinitionType(devBoxDefinitionType); + return this; + } + + /** + * Get the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @return the devBoxDefinitionName value. */ @@ -172,7 +203,8 @@ public String devBoxDefinitionName() { } /** - * Set the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Set the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @param devBoxDefinitionName the devBoxDefinitionName value to set. * @return the PoolInner object itself. @@ -185,6 +217,31 @@ public PoolInner withDevBoxDefinitionName(String devBoxDefinitionName) { return this; } + /** + * Get the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @return the devBoxDefinition value. + */ + public PoolDevBoxDefinition devBoxDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxDefinition(); + } + + /** + * Set the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @param devBoxDefinition the devBoxDefinition value to set. + * @return the PoolInner object itself. + */ + public PoolInner withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolProperties(); + } + this.innerProperties().withDevBoxDefinition(devBoxDefinition); + return this; + } + /** * Get the networkConnectionName property: Name of a Network Connection in parent Project of this Pool. * @@ -281,6 +338,29 @@ public PoolInner withStopOnDisconnect(StopOnDisconnectConfiguration stopOnDiscon return this; } + /** + * Get the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @return the stopOnNoConnect value. + */ + public StopOnNoConnectConfiguration stopOnNoConnect() { + return this.innerProperties() == null ? null : this.innerProperties().stopOnNoConnect(); + } + + /** + * Set the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @param stopOnNoConnect the stopOnNoConnect value to set. + * @return the PoolInner object itself. + */ + public PoolInner withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolProperties(); + } + this.innerProperties().withStopOnNoConnect(stopOnNoConnect); + return this; + } + /** * Get the singleSignOnStatus property: Indicates whether Dev Boxes in this pool are created with single sign on * enabled. The also requires that single sign on be enabled on the tenant. @@ -379,6 +459,54 @@ public PoolInner withManagedVirtualNetworkRegions(List managedVirtualNet return this; } + /** + * Get the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @return the activeHoursConfiguration value. + */ + public ActiveHoursConfiguration activeHoursConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().activeHoursConfiguration(); + } + + /** + * Set the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @param activeHoursConfiguration the activeHoursConfiguration value to set. + * @return the PoolInner object itself. + */ + public PoolInner withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolProperties(); + } + this.innerProperties().withActiveHoursConfiguration(activeHoursConfiguration); + return this; + } + + /** + * Get the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @return the devBoxTunnelEnableStatus value. + */ + public DevBoxTunnelEnableStatus devBoxTunnelEnableStatus() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxTunnelEnableStatus(); + } + + /** + * Set the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @param devBoxTunnelEnableStatus the devBoxTunnelEnableStatus value to set. + * @return the PoolInner object itself. + */ + public PoolInner withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolProperties(); + } + this.innerProperties().withDevBoxTunnelEnableStatus(devBoxTunnelEnableStatus); + return this; + } + /** * Validates the instance. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolProperties.java index 9f375441aa85..e29d167aa9af 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolProperties.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolProperties.java @@ -8,13 +8,18 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.ActiveHoursConfiguration; +import com.azure.resourcemanager.devcenter.models.DevBoxTunnelEnableStatus; import com.azure.resourcemanager.devcenter.models.HealthStatus; import com.azure.resourcemanager.devcenter.models.HealthStatusDetail; import com.azure.resourcemanager.devcenter.models.LicenseType; import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinitionType; import com.azure.resourcemanager.devcenter.models.ProvisioningState; import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectConfiguration; import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; import java.io.IOException; import java.util.List; @@ -89,6 +94,15 @@ public ProvisioningState provisioningState() { return this.provisioningState; } + /** + * {@inheritDoc} + */ + @Override + public PoolProperties withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType) { + super.withDevBoxDefinitionType(devBoxDefinitionType); + return this; + } + /** * {@inheritDoc} */ @@ -98,6 +112,15 @@ public PoolProperties withDevBoxDefinitionName(String devBoxDefinitionName) { return this; } + /** + * {@inheritDoc} + */ + @Override + public PoolProperties withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition) { + super.withDevBoxDefinition(devBoxDefinition); + return this; + } + /** * {@inheritDoc} */ @@ -134,6 +157,15 @@ public PoolProperties withStopOnDisconnect(StopOnDisconnectConfiguration stopOnD return this; } + /** + * {@inheritDoc} + */ + @Override + public PoolProperties withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect) { + super.withStopOnNoConnect(stopOnNoConnect); + return this; + } + /** * {@inheritDoc} */ @@ -170,6 +202,24 @@ public PoolProperties withManagedVirtualNetworkRegions(List managedVirtu return this; } + /** + * {@inheritDoc} + */ + @Override + public PoolProperties withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration) { + super.withActiveHoursConfiguration(activeHoursConfiguration); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PoolProperties withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus) { + super.withDevBoxTunnelEnableStatus(devBoxTunnelEnableStatus); + return this; + } + /** * Validates the instance. * @@ -180,9 +230,18 @@ public void validate() { if (healthStatusDetails() != null) { healthStatusDetails().forEach(e -> e.validate()); } + if (devBoxDefinition() != null) { + devBoxDefinition().validate(); + } if (stopOnDisconnect() != null) { stopOnDisconnect().validate(); } + if (stopOnNoConnect() != null) { + stopOnNoConnect().validate(); + } + if (activeHoursConfiguration() != null) { + activeHoursConfiguration().validate(); + } } /** @@ -191,12 +250,16 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("devBoxDefinitionType", + devBoxDefinitionType() == null ? null : devBoxDefinitionType().toString()); jsonWriter.writeStringField("devBoxDefinitionName", devBoxDefinitionName()); + jsonWriter.writeJsonField("devBoxDefinition", devBoxDefinition()); jsonWriter.writeStringField("networkConnectionName", networkConnectionName()); jsonWriter.writeStringField("licenseType", licenseType() == null ? null : licenseType().toString()); jsonWriter.writeStringField("localAdministrator", localAdministrator() == null ? null : localAdministrator().toString()); jsonWriter.writeJsonField("stopOnDisconnect", stopOnDisconnect()); + jsonWriter.writeJsonField("stopOnNoConnect", stopOnNoConnect()); jsonWriter.writeStringField("singleSignOnStatus", singleSignOnStatus() == null ? null : singleSignOnStatus().toString()); jsonWriter.writeStringField("displayName", displayName()); @@ -204,6 +267,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { virtualNetworkType() == null ? null : virtualNetworkType().toString()); jsonWriter.writeArrayField("managedVirtualNetworkRegions", managedVirtualNetworkRegions(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("activeHoursConfiguration", activeHoursConfiguration()); + jsonWriter.writeStringField("devBoxTunnelEnableStatus", + devBoxTunnelEnableStatus() == null ? null : devBoxTunnelEnableStatus().toString()); return jsonWriter.writeEndObject(); } @@ -222,8 +288,13 @@ public static PoolProperties fromJson(JsonReader jsonReader) throws IOException String fieldName = reader.getFieldName(); reader.nextToken(); - if ("devBoxDefinitionName".equals(fieldName)) { + if ("devBoxDefinitionType".equals(fieldName)) { + deserializedPoolProperties + .withDevBoxDefinitionType(PoolDevBoxDefinitionType.fromString(reader.getString())); + } else if ("devBoxDefinitionName".equals(fieldName)) { deserializedPoolProperties.withDevBoxDefinitionName(reader.getString()); + } else if ("devBoxDefinition".equals(fieldName)) { + deserializedPoolProperties.withDevBoxDefinition(PoolDevBoxDefinition.fromJson(reader)); } else if ("networkConnectionName".equals(fieldName)) { deserializedPoolProperties.withNetworkConnectionName(reader.getString()); } else if ("licenseType".equals(fieldName)) { @@ -232,6 +303,8 @@ public static PoolProperties fromJson(JsonReader jsonReader) throws IOException deserializedPoolProperties.withLocalAdministrator(LocalAdminStatus.fromString(reader.getString())); } else if ("stopOnDisconnect".equals(fieldName)) { deserializedPoolProperties.withStopOnDisconnect(StopOnDisconnectConfiguration.fromJson(reader)); + } else if ("stopOnNoConnect".equals(fieldName)) { + deserializedPoolProperties.withStopOnNoConnect(StopOnNoConnectConfiguration.fromJson(reader)); } else if ("singleSignOnStatus".equals(fieldName)) { deserializedPoolProperties .withSingleSignOnStatus(SingleSignOnStatus.fromString(reader.getString())); @@ -243,6 +316,11 @@ public static PoolProperties fromJson(JsonReader jsonReader) throws IOException } else if ("managedVirtualNetworkRegions".equals(fieldName)) { List managedVirtualNetworkRegions = reader.readArray(reader1 -> reader1.getString()); deserializedPoolProperties.withManagedVirtualNetworkRegions(managedVirtualNetworkRegions); + } else if ("activeHoursConfiguration".equals(fieldName)) { + deserializedPoolProperties.withActiveHoursConfiguration(ActiveHoursConfiguration.fromJson(reader)); + } else if ("devBoxTunnelEnableStatus".equals(fieldName)) { + deserializedPoolProperties + .withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus.fromString(reader.getString())); } else if ("healthStatus".equals(fieldName)) { deserializedPoolProperties.healthStatus = HealthStatus.fromString(reader.getString()); } else if ("healthStatusDetails".equals(fieldName)) { diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolUpdateProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolUpdateProperties.java index 776741ada037..d66057eeeef0 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolUpdateProperties.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/PoolUpdateProperties.java @@ -9,10 +9,15 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.ActiveHoursConfiguration; +import com.azure.resourcemanager.devcenter.models.DevBoxTunnelEnableStatus; import com.azure.resourcemanager.devcenter.models.LicenseType; import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinitionType; import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectConfiguration; import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; import java.io.IOException; import java.util.List; @@ -23,10 +28,21 @@ @Fluent public class PoolUpdateProperties implements JsonSerializable { /* - * Name of a Dev Box definition in parent Project of this Pool + * Indicates if the pool is created from an existing Dev Box Definition or if one is provided directly. + */ + private PoolDevBoxDefinitionType devBoxDefinitionType; + + /* + * Name of a Dev Box definition in parent Project of this Pool. Will be ignored if devBoxDefinitionType is Value. */ private String devBoxDefinitionName; + /* + * A definition of the machines that are created from this Pool. Will be ignored if devBoxDefinitionType is + * Reference or not provided. + */ + private PoolDevBoxDefinition devBoxDefinition; + /* * Name of a Network Connection in parent Project of this Pool */ @@ -48,6 +64,11 @@ public class PoolUpdateProperties implements JsonSerializable managedVirtualNetworkRegions; + /* + * Active hours configuration settings for Dev Boxes created in this pool. + */ + private ActiveHoursConfiguration activeHoursConfiguration; + + /* + * Indicates whether Dev Box Tunnel is enabled for a the pool. + */ + private DevBoxTunnelEnableStatus devBoxTunnelEnableStatus; + /** * Creates an instance of PoolUpdateProperties class. */ @@ -76,7 +107,30 @@ public PoolUpdateProperties() { } /** - * Get the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Get the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * + * @return the devBoxDefinitionType value. + */ + public PoolDevBoxDefinitionType devBoxDefinitionType() { + return this.devBoxDefinitionType; + } + + /** + * Set the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * + * @param devBoxDefinitionType the devBoxDefinitionType value to set. + * @return the PoolUpdateProperties object itself. + */ + public PoolUpdateProperties withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType) { + this.devBoxDefinitionType = devBoxDefinitionType; + return this; + } + + /** + * Get the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @return the devBoxDefinitionName value. */ @@ -85,7 +139,8 @@ public String devBoxDefinitionName() { } /** - * Set the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Set the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @param devBoxDefinitionName the devBoxDefinitionName value to set. * @return the PoolUpdateProperties object itself. @@ -95,6 +150,28 @@ public PoolUpdateProperties withDevBoxDefinitionName(String devBoxDefinitionName return this; } + /** + * Get the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @return the devBoxDefinition value. + */ + public PoolDevBoxDefinition devBoxDefinition() { + return this.devBoxDefinition; + } + + /** + * Set the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @param devBoxDefinition the devBoxDefinition value to set. + * @return the PoolUpdateProperties object itself. + */ + public PoolUpdateProperties withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition) { + this.devBoxDefinition = devBoxDefinition; + return this; + } + /** * Get the networkConnectionName property: Name of a Network Connection in parent Project of this Pool. * @@ -179,6 +256,26 @@ public PoolUpdateProperties withStopOnDisconnect(StopOnDisconnectConfiguration s return this; } + /** + * Get the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @return the stopOnNoConnect value. + */ + public StopOnNoConnectConfiguration stopOnNoConnect() { + return this.stopOnNoConnect; + } + + /** + * Set the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @param stopOnNoConnect the stopOnNoConnect value to set. + * @return the PoolUpdateProperties object itself. + */ + public PoolUpdateProperties withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect) { + this.stopOnNoConnect = stopOnNoConnect; + return this; + } + /** * Get the singleSignOnStatus property: Indicates whether Dev Boxes in this pool are created with single sign on * enabled. The also requires that single sign on be enabled on the tenant. @@ -265,15 +362,66 @@ public PoolUpdateProperties withManagedVirtualNetworkRegions(List manage return this; } + /** + * Get the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @return the activeHoursConfiguration value. + */ + public ActiveHoursConfiguration activeHoursConfiguration() { + return this.activeHoursConfiguration; + } + + /** + * Set the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @param activeHoursConfiguration the activeHoursConfiguration value to set. + * @return the PoolUpdateProperties object itself. + */ + public PoolUpdateProperties withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration) { + this.activeHoursConfiguration = activeHoursConfiguration; + return this; + } + + /** + * Get the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @return the devBoxTunnelEnableStatus value. + */ + public DevBoxTunnelEnableStatus devBoxTunnelEnableStatus() { + return this.devBoxTunnelEnableStatus; + } + + /** + * Set the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @param devBoxTunnelEnableStatus the devBoxTunnelEnableStatus value to set. + * @return the PoolUpdateProperties object itself. + */ + public PoolUpdateProperties withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus) { + this.devBoxTunnelEnableStatus = devBoxTunnelEnableStatus; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (devBoxDefinition() != null) { + devBoxDefinition().validate(); + } if (stopOnDisconnect() != null) { stopOnDisconnect().validate(); } + if (stopOnNoConnect() != null) { + stopOnNoConnect().validate(); + } + if (activeHoursConfiguration() != null) { + activeHoursConfiguration().validate(); + } } /** @@ -282,12 +430,16 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("devBoxDefinitionType", + this.devBoxDefinitionType == null ? null : this.devBoxDefinitionType.toString()); jsonWriter.writeStringField("devBoxDefinitionName", this.devBoxDefinitionName); + jsonWriter.writeJsonField("devBoxDefinition", this.devBoxDefinition); jsonWriter.writeStringField("networkConnectionName", this.networkConnectionName); jsonWriter.writeStringField("licenseType", this.licenseType == null ? null : this.licenseType.toString()); jsonWriter.writeStringField("localAdministrator", this.localAdministrator == null ? null : this.localAdministrator.toString()); jsonWriter.writeJsonField("stopOnDisconnect", this.stopOnDisconnect); + jsonWriter.writeJsonField("stopOnNoConnect", this.stopOnNoConnect); jsonWriter.writeStringField("singleSignOnStatus", this.singleSignOnStatus == null ? null : this.singleSignOnStatus.toString()); jsonWriter.writeStringField("displayName", this.displayName); @@ -295,6 +447,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.virtualNetworkType == null ? null : this.virtualNetworkType.toString()); jsonWriter.writeArrayField("managedVirtualNetworkRegions", this.managedVirtualNetworkRegions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("activeHoursConfiguration", this.activeHoursConfiguration); + jsonWriter.writeStringField("devBoxTunnelEnableStatus", + this.devBoxTunnelEnableStatus == null ? null : this.devBoxTunnelEnableStatus.toString()); return jsonWriter.writeEndObject(); } @@ -313,8 +468,13 @@ public static PoolUpdateProperties fromJson(JsonReader jsonReader) throws IOExce String fieldName = reader.getFieldName(); reader.nextToken(); - if ("devBoxDefinitionName".equals(fieldName)) { + if ("devBoxDefinitionType".equals(fieldName)) { + deserializedPoolUpdateProperties.devBoxDefinitionType + = PoolDevBoxDefinitionType.fromString(reader.getString()); + } else if ("devBoxDefinitionName".equals(fieldName)) { deserializedPoolUpdateProperties.devBoxDefinitionName = reader.getString(); + } else if ("devBoxDefinition".equals(fieldName)) { + deserializedPoolUpdateProperties.devBoxDefinition = PoolDevBoxDefinition.fromJson(reader); } else if ("networkConnectionName".equals(fieldName)) { deserializedPoolUpdateProperties.networkConnectionName = reader.getString(); } else if ("licenseType".equals(fieldName)) { @@ -324,6 +484,8 @@ public static PoolUpdateProperties fromJson(JsonReader jsonReader) throws IOExce = LocalAdminStatus.fromString(reader.getString()); } else if ("stopOnDisconnect".equals(fieldName)) { deserializedPoolUpdateProperties.stopOnDisconnect = StopOnDisconnectConfiguration.fromJson(reader); + } else if ("stopOnNoConnect".equals(fieldName)) { + deserializedPoolUpdateProperties.stopOnNoConnect = StopOnNoConnectConfiguration.fromJson(reader); } else if ("singleSignOnStatus".equals(fieldName)) { deserializedPoolUpdateProperties.singleSignOnStatus = SingleSignOnStatus.fromString(reader.getString()); @@ -335,6 +497,12 @@ public static PoolUpdateProperties fromJson(JsonReader jsonReader) throws IOExce } else if ("managedVirtualNetworkRegions".equals(fieldName)) { List managedVirtualNetworkRegions = reader.readArray(reader1 -> reader1.getString()); deserializedPoolUpdateProperties.managedVirtualNetworkRegions = managedVirtualNetworkRegions; + } else if ("activeHoursConfiguration".equals(fieldName)) { + deserializedPoolUpdateProperties.activeHoursConfiguration + = ActiveHoursConfiguration.fromJson(reader); + } else if ("devBoxTunnelEnableStatus".equals(fieldName)) { + deserializedPoolUpdateProperties.devBoxTunnelEnableStatus + = DevBoxTunnelEnableStatus.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectInner.java index e9c1d42441ca..6d868da08904 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectInner.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectInner.java @@ -10,9 +10,14 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.AzureAiServicesSettings; +import com.azure.resourcemanager.devcenter.models.DevBoxAutoDeleteSettings; import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationSettings; import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import com.azure.resourcemanager.devcenter.models.ServerlessGpuSessionsSettings; +import com.azure.resourcemanager.devcenter.models.WorkspaceStorageSettings; import java.io.IOException; import java.util.Map; @@ -278,6 +283,121 @@ public ProjectInner withCatalogSettings(ProjectCatalogSettings catalogSettings) return this; } + /** + * Get the customizationSettings property: Settings to be used for customizations. + * + * @return the customizationSettings value. + */ + public ProjectCustomizationSettings customizationSettings() { + return this.innerProperties() == null ? null : this.innerProperties().customizationSettings(); + } + + /** + * Set the customizationSettings property: Settings to be used for customizations. + * + * @param customizationSettings the customizationSettings value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withCustomizationSettings(ProjectCustomizationSettings customizationSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withCustomizationSettings(customizationSettings); + return this; + } + + /** + * Get the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings. + * + * @return the devBoxAutoDeleteSettings value. + */ + public DevBoxAutoDeleteSettings devBoxAutoDeleteSettings() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxAutoDeleteSettings(); + } + + /** + * Set the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings. + * + * @param devBoxAutoDeleteSettings the devBoxAutoDeleteSettings value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings devBoxAutoDeleteSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withDevBoxAutoDeleteSettings(devBoxAutoDeleteSettings); + return this; + } + + /** + * Get the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a project. + * + * @return the azureAiServicesSettings value. + */ + public AzureAiServicesSettings azureAiServicesSettings() { + return this.innerProperties() == null ? null : this.innerProperties().azureAiServicesSettings(); + } + + /** + * Set the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a project. + * + * @param azureAiServicesSettings the azureAiServicesSettings value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withAzureAiServicesSettings(AzureAiServicesSettings azureAiServicesSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withAzureAiServicesSettings(azureAiServicesSettings); + return this; + } + + /** + * Get the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU. + * + * @return the serverlessGpuSessionsSettings value. + */ + public ServerlessGpuSessionsSettings serverlessGpuSessionsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().serverlessGpuSessionsSettings(); + } + + /** + * Set the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU. + * + * @param serverlessGpuSessionsSettings the serverlessGpuSessionsSettings value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings serverlessGpuSessionsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withServerlessGpuSessionsSettings(serverlessGpuSessionsSettings); + return this; + } + + /** + * Get the workspaceStorageSettings property: Settings to be used for workspace storage. + * + * @return the workspaceStorageSettings value. + */ + public WorkspaceStorageSettings workspaceStorageSettings() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceStorageSettings(); + } + + /** + * Set the workspaceStorageSettings property: Settings to be used for workspace storage. + * + * @param workspaceStorageSettings the workspaceStorageSettings value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withWorkspaceStorageSettings(WorkspaceStorageSettings workspaceStorageSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withWorkspaceStorageSettings(workspaceStorageSettings); + return this; + } + /** * Validates the instance. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyInner.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyInner.java new file mode 100644 index 000000000000..c4ef0d89f953 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyInner.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.devcenter.fluent.models; + +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.devcenter.models.ProvisioningState; +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.io.IOException; +import java.util.List; + +/** + * Represents an project policy resource. + */ +@Fluent +public final class ProjectPolicyInner extends ProxyResource { + /* + * Properties of an project policy. + */ + private ProjectPolicyProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProjectPolicyInner class. + */ + public ProjectPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of an project policy. + * + * @return the innerProperties value. + */ + private ProjectPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @return the resourcePolicies value. + */ + public List resourcePolicies() { + return this.innerProperties() == null ? null : this.innerProperties().resourcePolicies(); + } + + /** + * Set the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @param resourcePolicies the resourcePolicies value to set. + * @return the ProjectPolicyInner object itself. + */ + public ProjectPolicyInner withResourcePolicies(List resourcePolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectPolicyProperties(); + } + this.innerProperties().withResourcePolicies(resourcePolicies); + return this; + } + + /** + * Get the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @return the scopes value. + */ + public List scopes() { + return this.innerProperties() == null ? null : this.innerProperties().scopes(); + } + + /** + * Set the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @param scopes the scopes value to set. + * @return the ProjectPolicyInner object itself. + */ + public ProjectPolicyInner withScopes(List scopes) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectPolicyProperties(); + } + this.innerProperties().withScopes(scopes); + 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.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectPolicyInner 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 ProjectPolicyInner. + */ + public static ProjectPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectPolicyInner deserializedProjectPolicyInner = new ProjectPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProjectPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProjectPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProjectPolicyInner.innerProperties = ProjectPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectPolicyInner; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyProperties.java new file mode 100644 index 000000000000..82401eaae683 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyProperties.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.devcenter.fluent.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.devcenter.models.ProvisioningState; +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.io.IOException; +import java.util.List; + +/** + * Properties of an project policy. + */ +@Fluent +public final class ProjectPolicyProperties extends ProjectPolicyUpdateProperties { + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ProjectPolicyProperties class. + */ + public ProjectPolicyProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public ProjectPolicyProperties withResourcePolicies(List resourcePolicies) { + super.withResourcePolicies(resourcePolicies); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProjectPolicyProperties withScopes(List scopes) { + super.withScopes(scopes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (resourcePolicies() != null) { + resourcePolicies().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourcePolicies", resourcePolicies(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scopes", scopes(), (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectPolicyProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectPolicyProperties. + */ + public static ProjectPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectPolicyProperties deserializedProjectPolicyProperties = new ProjectPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourcePolicies".equals(fieldName)) { + List resourcePolicies + = reader.readArray(reader1 -> ResourcePolicy.fromJson(reader1)); + deserializedProjectPolicyProperties.withResourcePolicies(resourcePolicies); + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedProjectPolicyProperties.withScopes(scopes); + } else if ("provisioningState".equals(fieldName)) { + deserializedProjectPolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectPolicyProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyUpdateProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyUpdateProperties.java new file mode 100644 index 000000000000..31e6eb4e6e05 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectPolicyUpdateProperties.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.devcenter.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.devcenter.models.ResourcePolicy; +import java.io.IOException; +import java.util.List; + +/** + * Properties of an project policy. These properties can be updated after the resource has been created. + */ +@Fluent +public class ProjectPolicyUpdateProperties implements JsonSerializable { + /* + * Resource policies that are a part of this project policy. + */ + private List resourcePolicies; + + /* + * Resources that have access to the shared resources that are a part of this project policy. + */ + private List scopes; + + /** + * Creates an instance of ProjectPolicyUpdateProperties class. + */ + public ProjectPolicyUpdateProperties() { + } + + /** + * Get the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @return the resourcePolicies value. + */ + public List resourcePolicies() { + return this.resourcePolicies; + } + + /** + * Set the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @param resourcePolicies the resourcePolicies value to set. + * @return the ProjectPolicyUpdateProperties object itself. + */ + public ProjectPolicyUpdateProperties withResourcePolicies(List resourcePolicies) { + this.resourcePolicies = resourcePolicies; + return this; + } + + /** + * Get the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @param scopes the scopes value to set. + * @return the ProjectPolicyUpdateProperties object itself. + */ + public ProjectPolicyUpdateProperties withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourcePolicies() != null) { + resourcePolicies().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourcePolicies", this.resourcePolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectPolicyUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectPolicyUpdateProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectPolicyUpdateProperties. + */ + public static ProjectPolicyUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectPolicyUpdateProperties deserializedProjectPolicyUpdateProperties + = new ProjectPolicyUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourcePolicies".equals(fieldName)) { + List resourcePolicies + = reader.readArray(reader1 -> ResourcePolicy.fromJson(reader1)); + deserializedProjectPolicyUpdateProperties.resourcePolicies = resourcePolicies; + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedProjectPolicyUpdateProperties.scopes = scopes; + } else { + reader.skipChildren(); + } + } + + return deserializedProjectPolicyUpdateProperties; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectProperties.java index 04ce44bbe311..65187ab8e3b9 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectProperties.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectProperties.java @@ -8,8 +8,13 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.AzureAiServicesSettings; +import com.azure.resourcemanager.devcenter.models.DevBoxAutoDeleteSettings; import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationSettings; import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import com.azure.resourcemanager.devcenter.models.ServerlessGpuSessionsSettings; +import com.azure.resourcemanager.devcenter.models.WorkspaceStorageSettings; import java.io.IOException; /** @@ -96,6 +101,52 @@ public ProjectProperties withCatalogSettings(ProjectCatalogSettings catalogSetti return this; } + /** + * {@inheritDoc} + */ + @Override + public ProjectProperties withCustomizationSettings(ProjectCustomizationSettings customizationSettings) { + super.withCustomizationSettings(customizationSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProjectProperties withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings devBoxAutoDeleteSettings) { + super.withDevBoxAutoDeleteSettings(devBoxAutoDeleteSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProjectProperties withAzureAiServicesSettings(AzureAiServicesSettings azureAiServicesSettings) { + super.withAzureAiServicesSettings(azureAiServicesSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProjectProperties + withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings serverlessGpuSessionsSettings) { + super.withServerlessGpuSessionsSettings(serverlessGpuSessionsSettings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProjectProperties withWorkspaceStorageSettings(WorkspaceStorageSettings workspaceStorageSettings) { + super.withWorkspaceStorageSettings(workspaceStorageSettings); + return this; + } + /** * Validates the instance. * @@ -106,6 +157,21 @@ public void validate() { if (catalogSettings() != null) { catalogSettings().validate(); } + if (customizationSettings() != null) { + customizationSettings().validate(); + } + if (devBoxAutoDeleteSettings() != null) { + devBoxAutoDeleteSettings().validate(); + } + if (azureAiServicesSettings() != null) { + azureAiServicesSettings().validate(); + } + if (serverlessGpuSessionsSettings() != null) { + serverlessGpuSessionsSettings().validate(); + } + if (workspaceStorageSettings() != null) { + workspaceStorageSettings().validate(); + } } /** @@ -119,6 +185,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("maxDevBoxesPerUser", maxDevBoxesPerUser()); jsonWriter.writeStringField("displayName", displayName()); jsonWriter.writeJsonField("catalogSettings", catalogSettings()); + jsonWriter.writeJsonField("customizationSettings", customizationSettings()); + jsonWriter.writeJsonField("devBoxAutoDeleteSettings", devBoxAutoDeleteSettings()); + jsonWriter.writeJsonField("azureAiServicesSettings", azureAiServicesSettings()); + jsonWriter.writeJsonField("serverlessGpuSessionsSettings", serverlessGpuSessionsSettings()); + jsonWriter.writeJsonField("workspaceStorageSettings", workspaceStorageSettings()); return jsonWriter.writeEndObject(); } @@ -147,6 +218,20 @@ public static ProjectProperties fromJson(JsonReader jsonReader) throws IOExcepti deserializedProjectProperties.withDisplayName(reader.getString()); } else if ("catalogSettings".equals(fieldName)) { deserializedProjectProperties.withCatalogSettings(ProjectCatalogSettings.fromJson(reader)); + } else if ("customizationSettings".equals(fieldName)) { + deserializedProjectProperties + .withCustomizationSettings(ProjectCustomizationSettings.fromJson(reader)); + } else if ("devBoxAutoDeleteSettings".equals(fieldName)) { + deserializedProjectProperties + .withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings.fromJson(reader)); + } else if ("azureAiServicesSettings".equals(fieldName)) { + deserializedProjectProperties.withAzureAiServicesSettings(AzureAiServicesSettings.fromJson(reader)); + } else if ("serverlessGpuSessionsSettings".equals(fieldName)) { + deserializedProjectProperties + .withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings.fromJson(reader)); + } else if ("workspaceStorageSettings".equals(fieldName)) { + deserializedProjectProperties + .withWorkspaceStorageSettings(WorkspaceStorageSettings.fromJson(reader)); } else if ("provisioningState".equals(fieldName)) { deserializedProjectProperties.provisioningState = ProvisioningState.fromString(reader.getString()); } else if ("devCenterUri".equals(fieldName)) { diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectUpdateProperties.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectUpdateProperties.java index 7c8893e678f5..b8c63278e6a2 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectUpdateProperties.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/ProjectUpdateProperties.java @@ -9,7 +9,12 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.devcenter.models.AzureAiServicesSettings; +import com.azure.resourcemanager.devcenter.models.DevBoxAutoDeleteSettings; import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationSettings; +import com.azure.resourcemanager.devcenter.models.ServerlessGpuSessionsSettings; +import com.azure.resourcemanager.devcenter.models.WorkspaceStorageSettings; import java.io.IOException; /** @@ -43,6 +48,31 @@ public class ProjectUpdateProperties implements JsonSerializable inputs() { + Map inner = this.innerModel().inputs(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer timeout() { + return this.innerModel().timeout(); + } + + public CatalogResourceValidationStatus validationStatus() { + return this.innerModel().validationStatus(); + } + + public CustomizationTaskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/CustomizationTasksClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/CustomizationTasksClientImpl.java new file mode 100644 index 000000000000..13c357a2ddbd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/CustomizationTasksClientImpl.java @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.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.devcenter.fluent.CustomizationTasksClient; +import com.azure.resourcemanager.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.CustomizationTaskInner; +import com.azure.resourcemanager.devcenter.models.CustomizationTaskListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CustomizationTasksClient. + */ +public final class CustomizationTasksClientImpl implements CustomizationTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final CustomizationTasksService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of CustomizationTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomizationTasksClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(CustomizationTasksService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientCustomizationTasks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface CustomizationTasksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/tasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/tasks/{taskName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("taskName") String taskName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/tasks/{taskName}/getErrorDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getErrorDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("taskName") String taskName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCatalogNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, + String devCenterName, String catalogName, Integer top) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, top, 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 Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, + String devCenterName, String catalogName, Integer top, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, catalogName, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName, Integer top) { + return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, devCenterName, catalogName, top), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); + } + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName) { + final Integer top = null; + return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, devCenterName, catalogName, top), + nextLink -> listByCatalogNextSinglePageAsync(nextLink)); + } + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByCatalogSinglePageAsync(resourceGroupName, devCenterName, catalogName, top, context), + nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); + } + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCatalog(String resourceGroupName, String devCenterName, + String catalogName) { + final Integer top = null; + return new PagedIterable<>(listByCatalogAsync(resourceGroupName, devCenterName, catalogName, top)); + } + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context) { + return new PagedIterable<>(listByCatalogAsync(resourceGroupName, devCenterName, catalogName, top, context)); + } + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String devCenterName, + String catalogName, String taskName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, taskName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String devCenterName, + String catalogName, String taskName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, catalogName, taskName, accept, context); + } + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String devCenterName, String catalogName, + String taskName) { + return getWithResponseAsync(resourceGroupName, devCenterName, catalogName, taskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String taskName, Context context) { + return getWithResponseAsync(resourceGroupName, devCenterName, catalogName, taskName, context).block(); + } + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomizationTaskInner get(String resourceGroupName, String devCenterName, String catalogName, + String taskName) { + return getWithResponse(resourceGroupName, devCenterName, catalogName, taskName, Context.NONE).getValue(); + } + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getErrorDetailsWithResponseAsync( + String resourceGroupName, String devCenterName, String catalogName, String taskName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getErrorDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, taskName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getErrorDetailsWithResponseAsync( + String resourceGroupName, String devCenterName, String catalogName, String taskName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getErrorDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, taskName, accept, context); + } + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getErrorDetailsAsync(String resourceGroupName, + String devCenterName, String catalogName, String taskName) { + return getErrorDetailsWithResponseAsync(resourceGroupName, devCenterName, catalogName, taskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String taskName, Context context) { + return getErrorDetailsWithResponseAsync(resourceGroupName, devCenterName, catalogName, taskName, context) + .block(); + } + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CatalogResourceValidationErrorDetailsInner getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String taskName) { + return getErrorDetailsWithResponse(resourceGroupName, devCenterName, catalogName, taskName, 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 results of the Task list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCatalogNextSinglePageAsync(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.listByCatalogNext(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 results of the Task list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCatalogNextSinglePageAsync(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.listByCatalogNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/CustomizationTasksImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/CustomizationTasksImpl.java new file mode 100644 index 000000000000..4f4056b09d52 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/CustomizationTasksImpl.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.devcenter.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.devcenter.fluent.CustomizationTasksClient; +import com.azure.resourcemanager.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.CustomizationTaskInner; +import com.azure.resourcemanager.devcenter.models.CatalogResourceValidationErrorDetails; +import com.azure.resourcemanager.devcenter.models.CustomizationTask; +import com.azure.resourcemanager.devcenter.models.CustomizationTasks; + +public final class CustomizationTasksImpl implements CustomizationTasks { + private static final ClientLogger LOGGER = new ClientLogger(CustomizationTasksImpl.class); + + private final CustomizationTasksClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public CustomizationTasksImpl(CustomizationTasksClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCatalog(String resourceGroupName, String devCenterName, + String catalogName) { + PagedIterable inner + = this.serviceClient().listByCatalog(resourceGroupName, devCenterName, catalogName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomizationTaskImpl(inner1, this.manager())); + } + + public PagedIterable listByCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context) { + PagedIterable inner + = this.serviceClient().listByCatalog(resourceGroupName, devCenterName, catalogName, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomizationTaskImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String taskName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, devCenterName, catalogName, taskName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CustomizationTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomizationTask get(String resourceGroupName, String devCenterName, String catalogName, String taskName) { + CustomizationTaskInner inner + = this.serviceClient().get(resourceGroupName, devCenterName, catalogName, taskName); + if (inner != null) { + return new CustomizationTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String taskName, Context context) { + Response inner = this.serviceClient() + .getErrorDetailsWithResponse(resourceGroupName, devCenterName, catalogName, taskName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CatalogResourceValidationErrorDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CatalogResourceValidationErrorDetails getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String taskName) { + CatalogResourceValidationErrorDetailsInner inner + = this.serviceClient().getErrorDetails(resourceGroupName, devCenterName, catalogName, taskName); + if (inner != null) { + return new CatalogResourceValidationErrorDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + private CustomizationTasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildOperationsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildOperationsClientImpl.java new file mode 100644 index 000000000000..ce815586a65e --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildOperationsClientImpl.java @@ -0,0 +1,683 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.devcenter.fluent.DevCenterCatalogImageDefinitionBuildOperationsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +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 + * DevCenterCatalogImageDefinitionBuildOperationsClient. + */ +public final class DevCenterCatalogImageDefinitionBuildOperationsClientImpl + implements DevCenterCatalogImageDefinitionBuildOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DevCenterCatalogImageDefinitionBuildOperationsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of DevCenterCatalogImageDefinitionBuildOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevCenterCatalogImageDefinitionBuildOperationsClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(DevCenterCatalogImageDefinitionBuildOperationsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * DevCenterManagementClientDevCenterCatalogImageDefinitionBuildOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface DevCenterCatalogImageDefinitionBuildOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds/{buildName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds/{buildName}/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds/{buildName}/getBuildDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, accept, context); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName) { + return getWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + return getWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, + context).block(); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageDefinitionBuildInner get(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName) { + return getWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, + Context.NONE).getValue(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> cancelWithResponseAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> cancelWithResponseAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, accept, context); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancelAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName) { + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancelAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = cancelWithResponseAsync(resourceGroupName, devCenterName, catalogName, + imageDefinitionName, buildName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancel(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName) { + return this.beginCancelAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName) + .getSyncPoller(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancel(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + return this + .beginCancelAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, context) + .getSyncPoller(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cancelAsync(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName) { + return beginCancelAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cancelAsync(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName, Context context) { + return beginCancelAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName) { + cancelAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName).block(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName, Context context) { + cancelAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, context).block(); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildDetailsWithResponseAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBuildDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildDetailsWithResponseAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBuildDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName, accept, context); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildDetailsAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName) { + return getBuildDetailsWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName, Context context) { + return getBuildDetailsWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName, context).block(); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageDefinitionBuildDetailsInner getBuildDetails(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName) { + return getBuildDetailsWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + buildName, Context.NONE).getValue(); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildOperationsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildOperationsImpl.java new file mode 100644 index 000000000000..c36100ef17b2 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildOperationsImpl.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.fluent.DevCenterCatalogImageDefinitionBuildOperationsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.DevCenterCatalogImageDefinitionBuildOperations; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuild; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildDetails; + +public final class DevCenterCatalogImageDefinitionBuildOperationsImpl + implements DevCenterCatalogImageDefinitionBuildOperations { + private static final ClientLogger LOGGER + = new ClientLogger(DevCenterCatalogImageDefinitionBuildOperationsImpl.class); + + private final DevCenterCatalogImageDefinitionBuildOperationsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public DevCenterCatalogImageDefinitionBuildOperationsImpl( + DevCenterCatalogImageDefinitionBuildOperationsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageDefinitionBuildImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageDefinitionBuild get(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName) { + ImageDefinitionBuildInner inner + = this.serviceClient().get(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName); + if (inner != null) { + return new ImageDefinitionBuildImpl(inner, this.manager()); + } else { + return null; + } + } + + public void cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName) { + this.serviceClient().cancel(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName); + } + + public void cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName, Context context) { + this.serviceClient() + .cancel(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, context); + } + + public Response getBuildDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, String buildName, Context context) { + Response inner = this.serviceClient() + .getBuildDetailsWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageDefinitionBuildDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageDefinitionBuildDetails getBuildDetails(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName) { + ImageDefinitionBuildDetailsInner inner = this.serviceClient() + .getBuildDetails(resourceGroupName, devCenterName, catalogName, imageDefinitionName, buildName); + if (inner != null) { + return new ImageDefinitionBuildDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + private DevCenterCatalogImageDefinitionBuildOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildsClientImpl.java new file mode 100644 index 000000000000..b3623eacf67f --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildsClientImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.fluent.DevCenterCatalogImageDefinitionBuildsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * DevCenterCatalogImageDefinitionBuildsClient. + */ +public final class DevCenterCatalogImageDefinitionBuildsClientImpl + implements DevCenterCatalogImageDefinitionBuildsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DevCenterCatalogImageDefinitionBuildsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of DevCenterCatalogImageDefinitionBuildsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevCenterCatalogImageDefinitionBuildsClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(DevCenterCatalogImageDefinitionBuildsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientDevCenterCatalogImageDefinitionBuilds to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface DevCenterCatalogImageDefinitionBuildsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByImageDefinition(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByImageDefinitionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionSinglePageAsync( + String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByImageDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, devCenterName, + catalogName, imageDefinitionName, 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 builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionSinglePageAsync( + String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByImageDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByImageDefinitionAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName) { + return new PagedFlux<>(() -> listByImageDefinitionSinglePageAsync(resourceGroupName, devCenterName, catalogName, + imageDefinitionName), nextLink -> listByImageDefinitionNextSinglePageAsync(nextLink)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByImageDefinitionAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context) { + return new PagedFlux<>(() -> listByImageDefinitionSinglePageAsync(resourceGroupName, devCenterName, catalogName, + imageDefinitionName, context), nextLink -> listByImageDefinitionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByImageDefinition(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName) { + return new PagedIterable<>( + listByImageDefinitionAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByImageDefinition(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context) { + return new PagedIterable<>( + listByImageDefinitionAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context)); + } + + /** + * 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 results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionNextSinglePageAsync(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.listByImageDefinitionNext(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 results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionNextSinglePageAsync(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.listByImageDefinitionNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildsImpl.java new file mode 100644 index 000000000000..a554736cb48b --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionBuildsImpl.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.devcenter.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devcenter.fluent.DevCenterCatalogImageDefinitionBuildsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.DevCenterCatalogImageDefinitionBuilds; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuild; + +public final class DevCenterCatalogImageDefinitionBuildsImpl implements DevCenterCatalogImageDefinitionBuilds { + private static final ClientLogger LOGGER = new ClientLogger(DevCenterCatalogImageDefinitionBuildsImpl.class); + + private final DevCenterCatalogImageDefinitionBuildsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public DevCenterCatalogImageDefinitionBuildsImpl(DevCenterCatalogImageDefinitionBuildsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByImageDefinition(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + PagedIterable inner = this.serviceClient() + .listByImageDefinition(resourceGroupName, devCenterName, catalogName, imageDefinitionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionBuildImpl(inner1, this.manager())); + } + + public PagedIterable listByImageDefinition(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context) { + PagedIterable inner = this.serviceClient() + .listByImageDefinition(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionBuildImpl(inner1, this.manager())); + } + + private DevCenterCatalogImageDefinitionBuildsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionsClientImpl.java new file mode 100644 index 000000000000..cdf1e67883ac --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionsClientImpl.java @@ -0,0 +1,909 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.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.devcenter.fluent.DevCenterCatalogImageDefinitionsClient; +import com.azure.resourcemanager.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionListResult; +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 DevCenterCatalogImageDefinitionsClient. + */ +public final class DevCenterCatalogImageDefinitionsClientImpl implements DevCenterCatalogImageDefinitionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DevCenterCatalogImageDefinitionsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of DevCenterCatalogImageDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevCenterCatalogImageDefinitionsClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(DevCenterCatalogImageDefinitionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientDevCenterCatalogImageDefinitions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface DevCenterCatalogImageDefinitionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDevCenterCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByDevCenterCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/getErrorDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getErrorDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/buildImage") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> buildImage(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDevCenterCatalogNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterCatalogSinglePageAsync(String resourceGroupName, + String devCenterName, String catalogName, Integer top) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDevCenterCatalog(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, devCenterName, + catalogName, top, 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 Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterCatalogSinglePageAsync(String resourceGroupName, + String devCenterName, String catalogName, Integer top, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDevCenterCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDevCenterCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName, Integer top) { + return new PagedFlux<>( + () -> listByDevCenterCatalogSinglePageAsync(resourceGroupName, devCenterName, catalogName, top), + nextLink -> listByDevCenterCatalogNextSinglePageAsync(nextLink)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDevCenterCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByDevCenterCatalogSinglePageAsync(resourceGroupName, devCenterName, catalogName, top), + nextLink -> listByDevCenterCatalogNextSinglePageAsync(nextLink)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDevCenterCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByDevCenterCatalogSinglePageAsync(resourceGroupName, devCenterName, catalogName, top, context), + nextLink -> listByDevCenterCatalogNextSinglePageAsync(nextLink, context)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName) { + final Integer top = null; + return new PagedIterable<>(listByDevCenterCatalogAsync(resourceGroupName, devCenterName, catalogName, top)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context) { + return new PagedIterable<>( + listByDevCenterCatalogAsync(resourceGroupName, devCenterName, catalogName, top, context)); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByDevCenterCatalogWithResponseAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByDevCenterCatalog(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, devCenterName, + catalogName, imageDefinitionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByDevCenterCatalogWithResponseAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByDevCenterCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, accept, + context); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByDevCenterCatalogAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + return getByDevCenterCatalogWithResponseAsync(resourceGroupName, devCenterName, catalogName, + imageDefinitionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByDevCenterCatalogWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context) { + return getByDevCenterCatalogWithResponseAsync(resourceGroupName, devCenterName, catalogName, + imageDefinitionName, context).block(); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageDefinitionInner getByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + return getByDevCenterCatalogWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + Context.NONE).getValue(); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getErrorDetailsWithResponseAsync( + String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getErrorDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getErrorDetailsWithResponseAsync( + String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getErrorDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, accept, + context); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getErrorDetailsAsync(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName) { + return getErrorDetailsWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context) { + return getErrorDetailsWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + context).block(); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CatalogResourceValidationErrorDetailsInner getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + return getErrorDetailsWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + Context.NONE).getValue(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> buildImageWithResponseAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.buildImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> buildImageWithResponseAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.buildImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, catalogName, imageDefinitionName, accept, + context); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImageAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + Mono>> mono + = buildImageWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImageAsync(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = buildImageWithResponseAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImage(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + return this.beginBuildImageAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName) + .getSyncPoller(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImage(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context) { + return this.beginBuildImageAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context) + .getSyncPoller(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 buildImageAsync(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName) { + return beginBuildImageAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 buildImageAsync(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, Context context) { + return beginBuildImageAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 buildImage(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName) { + buildImageAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName).block(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 buildImage(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, Context context) { + buildImageAsync(resourceGroupName, devCenterName, catalogName, imageDefinitionName, 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 results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterCatalogNextSinglePageAsync(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.listByDevCenterCatalogNext(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 results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterCatalogNextSinglePageAsync(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.listByDevCenterCatalogNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionsImpl.java new file mode 100644 index 000000000000..7456ab73840b --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterCatalogImageDefinitionsImpl.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.devcenter.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.devcenter.fluent.DevCenterCatalogImageDefinitionsClient; +import com.azure.resourcemanager.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; +import com.azure.resourcemanager.devcenter.models.CatalogResourceValidationErrorDetails; +import com.azure.resourcemanager.devcenter.models.DevCenterCatalogImageDefinitions; +import com.azure.resourcemanager.devcenter.models.ImageDefinition; + +public final class DevCenterCatalogImageDefinitionsImpl implements DevCenterCatalogImageDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(DevCenterCatalogImageDefinitionsImpl.class); + + private final DevCenterCatalogImageDefinitionsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public DevCenterCatalogImageDefinitionsImpl(DevCenterCatalogImageDefinitionsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName) { + PagedIterable inner + = this.serviceClient().listByDevCenterCatalog(resourceGroupName, devCenterName, catalogName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context) { + PagedIterable inner + = this.serviceClient().listByDevCenterCatalog(resourceGroupName, devCenterName, catalogName, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionImpl(inner1, this.manager())); + } + + public Response getByDevCenterCatalogWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context) { + Response inner = this.serviceClient() + .getByDevCenterCatalogWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageDefinition getByDevCenterCatalog(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName) { + ImageDefinitionInner inner = this.serviceClient() + .getByDevCenterCatalog(resourceGroupName, devCenterName, catalogName, imageDefinitionName); + if (inner != null) { + return new ImageDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context) { + Response inner = this.serviceClient() + .getErrorDetailsWithResponse(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CatalogResourceValidationErrorDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CatalogResourceValidationErrorDetails getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName) { + CatalogResourceValidationErrorDetailsInner inner + = this.serviceClient().getErrorDetails(resourceGroupName, devCenterName, catalogName, imageDefinitionName); + if (inner != null) { + return new CatalogResourceValidationErrorDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public void buildImage(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName) { + this.serviceClient().buildImage(resourceGroupName, devCenterName, catalogName, imageDefinitionName); + } + + public void buildImage(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, Context context) { + this.serviceClient().buildImage(resourceGroupName, devCenterName, catalogName, imageDefinitionName, context); + } + + private DevCenterCatalogImageDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterEncryptionSetImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterEncryptionSetImpl.java new file mode 100644 index 000000000000..92eea03d3682 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterEncryptionSetImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devcenter.fluent.models.DevCenterEncryptionSetInner; +import com.azure.resourcemanager.devcenter.models.DevCenterEncryptionSet; +import com.azure.resourcemanager.devcenter.models.DevboxDisksEncryptionEnableStatus; +import com.azure.resourcemanager.devcenter.models.EncryptionSetUpdate; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class DevCenterEncryptionSetImpl + implements DevCenterEncryptionSet, DevCenterEncryptionSet.Definition, DevCenterEncryptionSet.Update { + private DevCenterEncryptionSetInner innerObject; + + private final com.azure.resourcemanager.devcenter.DevCenterManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus() { + return this.innerModel().devboxDisksEncryptionEnableStatus(); + } + + public String keyEncryptionKeyUrl() { + return this.innerModel().keyEncryptionKeyUrl(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DevCenterEncryptionSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String devCenterName; + + private String encryptionSetName; + + private EncryptionSetUpdate updateBody; + + public DevCenterEncryptionSetImpl withExistingDevcenter(String resourceGroupName, String devCenterName) { + this.resourceGroupName = resourceGroupName; + this.devCenterName = devCenterName; + return this; + } + + public DevCenterEncryptionSet create() { + this.innerObject = serviceManager.serviceClient() + .getEncryptionSets() + .createOrUpdate(resourceGroupName, devCenterName, encryptionSetName, this.innerModel(), Context.NONE); + return this; + } + + public DevCenterEncryptionSet create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEncryptionSets() + .createOrUpdate(resourceGroupName, devCenterName, encryptionSetName, this.innerModel(), context); + return this; + } + + DevCenterEncryptionSetImpl(String name, com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerObject = new DevCenterEncryptionSetInner(); + this.serviceManager = serviceManager; + this.encryptionSetName = name; + } + + public DevCenterEncryptionSetImpl update() { + this.updateBody = new EncryptionSetUpdate(); + return this; + } + + public DevCenterEncryptionSet apply() { + this.innerObject = serviceManager.serviceClient() + .getEncryptionSets() + .update(resourceGroupName, devCenterName, encryptionSetName, updateBody, Context.NONE); + return this; + } + + public DevCenterEncryptionSet apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEncryptionSets() + .update(resourceGroupName, devCenterName, encryptionSetName, updateBody, context); + return this; + } + + DevCenterEncryptionSetImpl(DevCenterEncryptionSetInner innerObject, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.devCenterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "devcenters"); + this.encryptionSetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "encryptionSets"); + } + + public DevCenterEncryptionSet refresh() { + this.innerObject = serviceManager.serviceClient() + .getEncryptionSets() + .getWithResponse(resourceGroupName, devCenterName, encryptionSetName, Context.NONE) + .getValue(); + return this; + } + + public DevCenterEncryptionSet refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEncryptionSets() + .getWithResponse(resourceGroupName, devCenterName, encryptionSetName, context) + .getValue(); + return this; + } + + public DevCenterEncryptionSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DevCenterEncryptionSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DevCenterEncryptionSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public DevCenterEncryptionSetImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBody.withIdentity(identity); + return this; + } + } + + public DevCenterEncryptionSetImpl + withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus) { + if (isInCreateMode()) { + this.innerModel().withDevboxDisksEncryptionEnableStatus(devboxDisksEncryptionEnableStatus); + return this; + } else { + this.updateBody.withDevboxDisksEncryptionEnableStatus(devboxDisksEncryptionEnableStatus); + return this; + } + } + + public DevCenterEncryptionSetImpl withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) { + if (isInCreateMode()) { + this.innerModel().withKeyEncryptionKeyUrl(keyEncryptionKeyUrl); + return this; + } else { + this.updateBody.withKeyEncryptionKeyUrl(keyEncryptionKeyUrl); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterImpl.java index 81c1e87a8f94..d7515dc11091 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterImpl.java @@ -8,7 +8,9 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devcenter.fluent.models.DevCenterInner; +import com.azure.resourcemanager.devcenter.models.DevBoxProvisioningSettings; import com.azure.resourcemanager.devcenter.models.DevCenter; +import com.azure.resourcemanager.devcenter.models.DevCenterNetworkSettings; import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; import com.azure.resourcemanager.devcenter.models.DevCenterUpdate; import com.azure.resourcemanager.devcenter.models.Encryption; @@ -75,6 +77,14 @@ public DevCenterProjectCatalogSettings projectCatalogSettings() { return this.innerModel().projectCatalogSettings(); } + public DevCenterNetworkSettings networkSettings() { + return this.innerModel().networkSettings(); + } + + public DevBoxProvisioningSettings devBoxProvisioningSettings() { + return this.innerModel().devBoxProvisioningSettings(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -228,6 +238,26 @@ public DevCenterImpl withProjectCatalogSettings(DevCenterProjectCatalogSettings } } + public DevCenterImpl withNetworkSettings(DevCenterNetworkSettings networkSettings) { + if (isInCreateMode()) { + this.innerModel().withNetworkSettings(networkSettings); + return this; + } else { + this.updateBody.withNetworkSettings(networkSettings); + return this; + } + } + + public DevCenterImpl withDevBoxProvisioningSettings(DevBoxProvisioningSettings devBoxProvisioningSettings) { + if (isInCreateMode()) { + this.innerModel().withDevBoxProvisioningSettings(devBoxProvisioningSettings); + return this; + } else { + this.updateBody.withDevBoxProvisioningSettings(devBoxProvisioningSettings); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterManagementClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterManagementClientImpl.java index 1f31375d0e64..5b66a3cd5938 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterManagementClientImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/DevCenterManagementClientImpl.java @@ -27,9 +27,14 @@ import com.azure.resourcemanager.devcenter.fluent.CatalogsClient; import com.azure.resourcemanager.devcenter.fluent.CheckNameAvailabilitiesClient; import com.azure.resourcemanager.devcenter.fluent.CheckScopedNameAvailabilitiesClient; +import com.azure.resourcemanager.devcenter.fluent.CustomizationTasksClient; import com.azure.resourcemanager.devcenter.fluent.DevBoxDefinitionsClient; +import com.azure.resourcemanager.devcenter.fluent.DevCenterCatalogImageDefinitionBuildOperationsClient; +import com.azure.resourcemanager.devcenter.fluent.DevCenterCatalogImageDefinitionBuildsClient; +import com.azure.resourcemanager.devcenter.fluent.DevCenterCatalogImageDefinitionsClient; import com.azure.resourcemanager.devcenter.fluent.DevCenterManagementClient; import com.azure.resourcemanager.devcenter.fluent.DevCentersClient; +import com.azure.resourcemanager.devcenter.fluent.EncryptionSetsClient; import com.azure.resourcemanager.devcenter.fluent.EnvironmentDefinitionsClient; import com.azure.resourcemanager.devcenter.fluent.EnvironmentTypesClient; import com.azure.resourcemanager.devcenter.fluent.GalleriesClient; @@ -41,8 +46,12 @@ import com.azure.resourcemanager.devcenter.fluent.PoolsClient; import com.azure.resourcemanager.devcenter.fluent.ProjectAllowedEnvironmentTypesClient; import com.azure.resourcemanager.devcenter.fluent.ProjectCatalogEnvironmentDefinitionsClient; +import com.azure.resourcemanager.devcenter.fluent.ProjectCatalogImageDefinitionBuildOperationsClient; +import com.azure.resourcemanager.devcenter.fluent.ProjectCatalogImageDefinitionBuildsClient; +import com.azure.resourcemanager.devcenter.fluent.ProjectCatalogImageDefinitionsClient; import com.azure.resourcemanager.devcenter.fluent.ProjectCatalogsClient; import com.azure.resourcemanager.devcenter.fluent.ProjectEnvironmentTypesClient; +import com.azure.resourcemanager.devcenter.fluent.ProjectPoliciesClient; import com.azure.resourcemanager.devcenter.fluent.ProjectsClient; import com.azure.resourcemanager.devcenter.fluent.SchedulesClient; import com.azure.resourcemanager.devcenter.fluent.SkusClient; @@ -159,6 +168,34 @@ public DevCentersClient getDevCenters() { return this.devCenters; } + /** + * The EncryptionSetsClient object to access its operations. + */ + private final EncryptionSetsClient encryptionSets; + + /** + * Gets the EncryptionSetsClient object to access its operations. + * + * @return the EncryptionSetsClient object. + */ + public EncryptionSetsClient getEncryptionSets() { + return this.encryptionSets; + } + + /** + * The ProjectPoliciesClient object to access its operations. + */ + private final ProjectPoliciesClient projectPolicies; + + /** + * Gets the ProjectPoliciesClient object to access its operations. + * + * @return the ProjectPoliciesClient object. + */ + public ProjectPoliciesClient getProjectPolicies() { + return this.projectPolicies; + } + /** * The ProjectsClient object to access its operations. */ @@ -271,6 +308,20 @@ public ImageVersionsClient getImageVersions() { return this.imageVersions; } + /** + * The SkusClient object to access its operations. + */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + /** * The CatalogsClient object to access its operations. */ @@ -412,17 +463,101 @@ public CheckScopedNameAvailabilitiesClient getCheckScopedNameAvailabilities() { } /** - * The SkusClient object to access its operations. + * The CustomizationTasksClient object to access its operations. */ - private final SkusClient skus; + private final CustomizationTasksClient customizationTasks; /** - * Gets the SkusClient object to access its operations. + * Gets the CustomizationTasksClient object to access its operations. * - * @return the SkusClient object. + * @return the CustomizationTasksClient object. */ - public SkusClient getSkus() { - return this.skus; + public CustomizationTasksClient getCustomizationTasks() { + return this.customizationTasks; + } + + /** + * The DevCenterCatalogImageDefinitionsClient object to access its operations. + */ + private final DevCenterCatalogImageDefinitionsClient devCenterCatalogImageDefinitions; + + /** + * Gets the DevCenterCatalogImageDefinitionsClient object to access its operations. + * + * @return the DevCenterCatalogImageDefinitionsClient object. + */ + public DevCenterCatalogImageDefinitionsClient getDevCenterCatalogImageDefinitions() { + return this.devCenterCatalogImageDefinitions; + } + + /** + * The DevCenterCatalogImageDefinitionBuildsClient object to access its operations. + */ + private final DevCenterCatalogImageDefinitionBuildsClient devCenterCatalogImageDefinitionBuilds; + + /** + * Gets the DevCenterCatalogImageDefinitionBuildsClient object to access its operations. + * + * @return the DevCenterCatalogImageDefinitionBuildsClient object. + */ + public DevCenterCatalogImageDefinitionBuildsClient getDevCenterCatalogImageDefinitionBuilds() { + return this.devCenterCatalogImageDefinitionBuilds; + } + + /** + * The DevCenterCatalogImageDefinitionBuildOperationsClient object to access its operations. + */ + private final DevCenterCatalogImageDefinitionBuildOperationsClient devCenterCatalogImageDefinitionBuildOperations; + + /** + * Gets the DevCenterCatalogImageDefinitionBuildOperationsClient object to access its operations. + * + * @return the DevCenterCatalogImageDefinitionBuildOperationsClient object. + */ + public DevCenterCatalogImageDefinitionBuildOperationsClient getDevCenterCatalogImageDefinitionBuildOperations() { + return this.devCenterCatalogImageDefinitionBuildOperations; + } + + /** + * The ProjectCatalogImageDefinitionsClient object to access its operations. + */ + private final ProjectCatalogImageDefinitionsClient projectCatalogImageDefinitions; + + /** + * Gets the ProjectCatalogImageDefinitionsClient object to access its operations. + * + * @return the ProjectCatalogImageDefinitionsClient object. + */ + public ProjectCatalogImageDefinitionsClient getProjectCatalogImageDefinitions() { + return this.projectCatalogImageDefinitions; + } + + /** + * The ProjectCatalogImageDefinitionBuildsClient object to access its operations. + */ + private final ProjectCatalogImageDefinitionBuildsClient projectCatalogImageDefinitionBuilds; + + /** + * Gets the ProjectCatalogImageDefinitionBuildsClient object to access its operations. + * + * @return the ProjectCatalogImageDefinitionBuildsClient object. + */ + public ProjectCatalogImageDefinitionBuildsClient getProjectCatalogImageDefinitionBuilds() { + return this.projectCatalogImageDefinitionBuilds; + } + + /** + * The ProjectCatalogImageDefinitionBuildOperationsClient object to access its operations. + */ + private final ProjectCatalogImageDefinitionBuildOperationsClient projectCatalogImageDefinitionBuildOperations; + + /** + * Gets the ProjectCatalogImageDefinitionBuildOperationsClient object to access its operations. + * + * @return the ProjectCatalogImageDefinitionBuildOperationsClient object. + */ + public ProjectCatalogImageDefinitionBuildOperationsClient getProjectCatalogImageDefinitionBuildOperations() { + return this.projectCatalogImageDefinitionBuildOperations; } /** @@ -484,8 +619,10 @@ public NetworkConnectionsClient getNetworkConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-02-01"; + this.apiVersion = "2025-04-01-preview"; this.devCenters = new DevCentersClientImpl(this); + this.encryptionSets = new EncryptionSetsClientImpl(this); + this.projectPolicies = new ProjectPoliciesClientImpl(this); this.projects = new ProjectsClientImpl(this); this.attachedNetworks = new AttachedNetworksClientImpl(this); this.projectCatalogs = new ProjectCatalogsClientImpl(this); @@ -494,6 +631,7 @@ public NetworkConnectionsClient getNetworkConnections() { this.galleries = new GalleriesClientImpl(this); this.images = new ImagesClientImpl(this); this.imageVersions = new ImageVersionsClientImpl(this); + this.skus = new SkusClientImpl(this); this.catalogs = new CatalogsClientImpl(this); this.environmentTypes = new EnvironmentTypesClientImpl(this); this.projectAllowedEnvironmentTypes = new ProjectAllowedEnvironmentTypesClientImpl(this); @@ -504,7 +642,15 @@ public NetworkConnectionsClient getNetworkConnections() { this.usages = new UsagesClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); this.checkScopedNameAvailabilities = new CheckScopedNameAvailabilitiesClientImpl(this); - this.skus = new SkusClientImpl(this); + this.customizationTasks = new CustomizationTasksClientImpl(this); + this.devCenterCatalogImageDefinitions = new DevCenterCatalogImageDefinitionsClientImpl(this); + this.devCenterCatalogImageDefinitionBuilds = new DevCenterCatalogImageDefinitionBuildsClientImpl(this); + this.devCenterCatalogImageDefinitionBuildOperations + = new DevCenterCatalogImageDefinitionBuildOperationsClientImpl(this); + this.projectCatalogImageDefinitions = new ProjectCatalogImageDefinitionsClientImpl(this); + this.projectCatalogImageDefinitionBuilds = new ProjectCatalogImageDefinitionBuildsClientImpl(this); + this.projectCatalogImageDefinitionBuildOperations + = new ProjectCatalogImageDefinitionBuildOperationsClientImpl(this); this.pools = new PoolsClientImpl(this); this.schedules = new SchedulesClientImpl(this); this.networkConnections = new NetworkConnectionsClientImpl(this); diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/EncryptionSetsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/EncryptionSetsClientImpl.java new file mode 100644 index 000000000000..f7d692dfb711 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/EncryptionSetsClientImpl.java @@ -0,0 +1,1224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.devcenter.fluent.EncryptionSetsClient; +import com.azure.resourcemanager.devcenter.fluent.models.DevCenterEncryptionSetInner; +import com.azure.resourcemanager.devcenter.models.EncryptionSetListResult; +import com.azure.resourcemanager.devcenter.models.EncryptionSetUpdate; +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 EncryptionSetsClient. + */ +public final class EncryptionSetsClientImpl implements EncryptionSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EncryptionSetsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of EncryptionSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EncryptionSetsClientImpl(DevCenterManagementClientImpl client) { + this.service + = RestProxy.create(EncryptionSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientEncryptionSets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface EncryptionSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/encryptionSets") + @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("devCenterName") String devCenterName, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/encryptionSets/{encryptionSetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("encryptionSetName") String encryptionSetName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/encryptionSets/{encryptionSetName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("encryptionSetName") String encryptionSetName, + @BodyParam("application/json") DevCenterEncryptionSetInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/encryptionSets/{encryptionSetName}") + @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("devCenterName") String devCenterName, + @PathParam("encryptionSetName") String encryptionSetName, + @BodyParam("application/json") EncryptionSetUpdate body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/encryptionSets/{encryptionSetName}") + @ExpectedResponses({ 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("devCenterName") String devCenterName, + @PathParam("encryptionSetName") String encryptionSetName, @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 all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String devCenterName, Integer top) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName 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(), resourceGroupName, devCenterName, top, 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 encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String devCenterName, Integer top, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName 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(), + resourceGroupName, devCenterName, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String devCenterName, + Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, devCenterName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String devCenterName) { + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, devCenterName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String devCenterName, + Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, devCenterName, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String devCenterName) { + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, devCenterName, top)); + } + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String devCenterName, Integer top, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, devCenterName, top, context)); + } + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String devCenterName, String encryptionSetName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, encryptionSetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String devCenterName, String encryptionSetName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, encryptionSetName, accept, context); + } + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String devCenterName, + String encryptionSetName) { + return getWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String devCenterName, + String encryptionSetName, Context context) { + return getWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName, context).block(); + } + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevCenterEncryptionSetInner get(String resourceGroupName, String devCenterName, String encryptionSetName) { + return getWithResponse(resourceGroupName, devCenterName, encryptionSetName, Context.NONE).getValue(); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, encryptionSetName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, encryptionSetName, body, accept, + context); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevCenterEncryptionSetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DevCenterEncryptionSetInner.class, DevCenterEncryptionSetInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevCenterEncryptionSetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DevCenterEncryptionSetInner.class, DevCenterEncryptionSetInner.class, + context); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevCenterEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body).getSyncPoller(); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevCenterEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, DevCenterEncryptionSetInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body, context) + .getSyncPoller(); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String devCenterName, + String encryptionSetName, DevCenterEncryptionSetInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String devCenterName, + String encryptionSetName, DevCenterEncryptionSetInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevCenterEncryptionSetInner createOrUpdate(String resourceGroupName, String devCenterName, + String encryptionSetName, DevCenterEncryptionSetInner body) { + return createOrUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body).block(); + } + + /** + * Creates or updates a devcenter encryption set resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Represents a devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevCenterEncryptionSetInner createOrUpdate(String resourceGroupName, String devCenterName, + String encryptionSetName, DevCenterEncryptionSetInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body, context).block(); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String devCenterName, + String encryptionSetName, EncryptionSetUpdate 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, encryptionSetName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String devCenterName, + String encryptionSetName, EncryptionSetUpdate 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName 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.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, encryptionSetName, body, accept, context); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevCenterEncryptionSetInner> beginUpdateAsync( + String resourceGroupName, String devCenterName, String encryptionSetName, EncryptionSetUpdate body) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DevCenterEncryptionSetInner.class, DevCenterEncryptionSetInner.class, + this.client.getContext()); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevCenterEncryptionSetInner> beginUpdateAsync( + String resourceGroupName, String devCenterName, String encryptionSetName, EncryptionSetUpdate body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DevCenterEncryptionSetInner.class, DevCenterEncryptionSetInner.class, + context); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevCenterEncryptionSetInner> beginUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, EncryptionSetUpdate body) { + return this.beginUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body).getSyncPoller(); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevCenterEncryptionSetInner> beginUpdate( + String resourceGroupName, String devCenterName, String encryptionSetName, EncryptionSetUpdate body, + Context context) { + return this.beginUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body, context) + .getSyncPoller(); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String devCenterName, + String encryptionSetName, EncryptionSetUpdate body) { + return beginUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String devCenterName, + String encryptionSetName, EncryptionSetUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, devCenterName, encryptionSetName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevCenterEncryptionSetInner update(String resourceGroupName, String devCenterName, String encryptionSetName, + EncryptionSetUpdate body) { + return updateAsync(resourceGroupName, devCenterName, encryptionSetName, body).block(); + } + + /** + * Partially updates a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param body Updatable devcenter encryption set properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a devcenter encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevCenterEncryptionSetInner update(String resourceGroupName, String devCenterName, String encryptionSetName, + EncryptionSetUpdate body, Context context) { + return updateAsync(resourceGroupName, devCenterName, encryptionSetName, body, context).block(); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String encryptionSetName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, encryptionSetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String encryptionSetName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (encryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionSetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, encryptionSetName, accept, context); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String encryptionSetName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String encryptionSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, devCenterName, encryptionSetName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String encryptionSetName) { + return this.beginDeleteAsync(resourceGroupName, devCenterName, encryptionSetName).getSyncPoller(); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String encryptionSetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, devCenterName, encryptionSetName, context).getSyncPoller(); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 devCenterName, String encryptionSetName) { + return beginDeleteAsync(resourceGroupName, devCenterName, encryptionSetName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 devCenterName, String encryptionSetName, + Context context) { + return beginDeleteAsync(resourceGroupName, devCenterName, encryptionSetName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 devCenterName, String encryptionSetName) { + deleteAsync(resourceGroupName, devCenterName, encryptionSetName).block(); + } + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 devCenterName, String encryptionSetName, Context context) { + deleteAsync(resourceGroupName, devCenterName, encryptionSetName, 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 result of the list devcenter encryption set operation 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 result of the list devcenter encryption set operation 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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/EncryptionSetsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/EncryptionSetsImpl.java new file mode 100644 index 000000000000..a7ddeb36923f --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/EncryptionSetsImpl.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.devcenter.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.devcenter.fluent.EncryptionSetsClient; +import com.azure.resourcemanager.devcenter.fluent.models.DevCenterEncryptionSetInner; +import com.azure.resourcemanager.devcenter.models.DevCenterEncryptionSet; +import com.azure.resourcemanager.devcenter.models.EncryptionSets; + +public final class EncryptionSetsImpl implements EncryptionSets { + private static final ClientLogger LOGGER = new ClientLogger(EncryptionSetsImpl.class); + + private final EncryptionSetsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public EncryptionSetsImpl(EncryptionSetsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String devCenterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, devCenterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DevCenterEncryptionSetImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String devCenterName, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, devCenterName, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DevCenterEncryptionSetImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String devCenterName, + String encryptionSetName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, devCenterName, encryptionSetName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DevCenterEncryptionSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DevCenterEncryptionSet get(String resourceGroupName, String devCenterName, String encryptionSetName) { + DevCenterEncryptionSetInner inner + = this.serviceClient().get(resourceGroupName, devCenterName, encryptionSetName); + if (inner != null) { + return new DevCenterEncryptionSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String devCenterName, String encryptionSetName) { + this.serviceClient().delete(resourceGroupName, devCenterName, encryptionSetName); + } + + public void delete(String resourceGroupName, String devCenterName, String encryptionSetName, Context context) { + this.serviceClient().delete(resourceGroupName, devCenterName, encryptionSetName, context); + } + + public DevCenterEncryptionSet 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String encryptionSetName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionSets"); + if (encryptionSetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionSets'.", id))); + } + return this.getWithResponse(resourceGroupName, devCenterName, encryptionSetName, 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String encryptionSetName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionSets"); + if (encryptionSetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionSets'.", id))); + } + return this.getWithResponse(resourceGroupName, devCenterName, encryptionSetName, 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String encryptionSetName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionSets"); + if (encryptionSetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionSets'.", id))); + } + this.delete(resourceGroupName, devCenterName, encryptionSetName, 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String encryptionSetName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionSets"); + if (encryptionSetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionSets'.", id))); + } + this.delete(resourceGroupName, devCenterName, encryptionSetName, context); + } + + private EncryptionSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } + + public DevCenterEncryptionSetImpl define(String name) { + return new DevCenterEncryptionSetImpl(name, this.manager()); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionBuildDetailsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionBuildDetailsImpl.java new file mode 100644 index 000000000000..b77651bf4a68 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionBuildDetailsImpl.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.devcenter.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.models.ImageCreationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildDetails; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildStatus; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildTaskGroup; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ImageDefinitionBuildDetailsImpl implements ImageDefinitionBuildDetails { + private ImageDefinitionBuildDetailsInner innerObject; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + ImageDefinitionBuildDetailsImpl(ImageDefinitionBuildDetailsInner innerObject, + com.azure.resourcemanager.devcenter.DevCenterManager 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 ImageReference imageReference() { + return this.innerModel().imageReference(); + } + + public ImageDefinitionBuildStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public ImageCreationErrorDetails errorDetails() { + return this.innerModel().errorDetails(); + } + + public List taskGroups() { + List inner = this.innerModel().taskGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ImageDefinitionBuildDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionBuildImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionBuildImpl.java new file mode 100644 index 000000000000..04d92d970f49 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionBuildImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.ImageCreationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuild; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildStatus; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import java.time.OffsetDateTime; + +public final class ImageDefinitionBuildImpl implements ImageDefinitionBuild { + private ImageDefinitionBuildInner innerObject; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + ImageDefinitionBuildImpl(ImageDefinitionBuildInner innerObject, + com.azure.resourcemanager.devcenter.DevCenterManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ImageReference imageReference() { + return this.innerModel().imageReference(); + } + + public ImageDefinitionBuildStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public ImageCreationErrorDetails errorDetails() { + return this.innerModel().errorDetails(); + } + + public ImageDefinitionBuildInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionImpl.java new file mode 100644 index 000000000000..1252c78fe9dc --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageDefinitionImpl.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.devcenter.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; +import com.azure.resourcemanager.devcenter.models.AutoImageBuildStatus; +import com.azure.resourcemanager.devcenter.models.CatalogResourceValidationStatus; +import com.azure.resourcemanager.devcenter.models.CustomizationTaskInstance; +import com.azure.resourcemanager.devcenter.models.ImageDefinition; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionReference; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import com.azure.resourcemanager.devcenter.models.ImageValidationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageValidationStatus; +import com.azure.resourcemanager.devcenter.models.LatestImageBuild; +import java.util.Collections; +import java.util.List; + +public final class ImageDefinitionImpl implements ImageDefinition { + private ImageDefinitionInner innerObject; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + ImageDefinitionImpl(ImageDefinitionInner innerObject, + com.azure.resourcemanager.devcenter.DevCenterManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public ImageReference imageReference() { + return this.innerModel().imageReference(); + } + + public String fileUrl() { + return this.innerModel().fileUrl(); + } + + public LatestImageBuild latestBuild() { + return this.innerModel().latestBuild(); + } + + public ImageValidationStatus imageValidationStatus() { + return this.innerModel().imageValidationStatus(); + } + + public ImageValidationErrorDetails imageValidationErrorDetails() { + return this.innerModel().imageValidationErrorDetails(); + } + + public CatalogResourceValidationStatus validationStatus() { + return this.innerModel().validationStatus(); + } + + public ImageReference activeImageReference() { + return this.innerModel().activeImageReference(); + } + + public AutoImageBuildStatus autoImageBuild() { + return this.innerModel().autoImageBuild(); + } + + public List tasks() { + List inner = this.innerModel().tasks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List userTasks() { + List inner = this.innerModel().userTasks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ImageDefinitionReference extendsProperty() { + return this.innerModel().extendsProperty(); + } + + public ImageDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsClientImpl.java index 7c2b9106272f..73f9c95fac1d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsClientImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsClientImpl.java @@ -82,6 +82,25 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("galleryName") String galleryName, @PathParam("imageName") String imageName, @PathParam("versionName") String versionName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/images/{imageName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProject(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/images/{imageName}/versions/{versionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByProject(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("imageName") String imageName, @PathParam("versionName") String versionName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -89,6 +108,14 @@ Mono> get(@HostParam("$host") String endpoint, Mono> listByImageNext( @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> listByProjectNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -419,6 +446,307 @@ public ImageVersionInner get(String resourceGroupName, String devCenterName, Str .getValue(); } + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectSinglePageAsync(String resourceGroupName, + String projectName, String imageName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, imageName, 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 versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectSinglePageAsync(String resourceGroupName, + String projectName, String imageName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProject(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, imageName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectAsync(String resourceGroupName, String projectName, + String imageName) { + return new PagedFlux<>(() -> listByProjectSinglePageAsync(resourceGroupName, projectName, imageName), + nextLink -> listByProjectNextSinglePageAsync(nextLink)); + } + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectAsync(String resourceGroupName, String projectName, + String imageName, Context context) { + return new PagedFlux<>(() -> listByProjectSinglePageAsync(resourceGroupName, projectName, imageName, context), + nextLink -> listByProjectNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProject(String resourceGroupName, String projectName, + String imageName) { + return new PagedIterable<>(listByProjectAsync(resourceGroupName, projectName, imageName)); + } + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProject(String resourceGroupName, String projectName, + String imageName, Context context) { + return new PagedIterable<>(listByProjectAsync(resourceGroupName, projectName, imageName, context)); + } + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByProjectWithResponseAsync(String resourceGroupName, + String projectName, String imageName, String versionName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (versionName == null) { + return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, imageName, versionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByProjectWithResponseAsync(String resourceGroupName, + String projectName, String imageName, String versionName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (versionName == null) { + return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, imageName, versionName, accept, context); + } + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByProjectAsync(String resourceGroupName, String projectName, String imageName, + String versionName) { + return getByProjectWithResponseAsync(resourceGroupName, projectName, imageName, versionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByProjectWithResponse(String resourceGroupName, String projectName, + String imageName, String versionName, Context context) { + return getByProjectWithResponseAsync(resourceGroupName, projectName, imageName, versionName, context).block(); + } + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageVersionInner getByProject(String resourceGroupName, String projectName, String imageName, + String versionName) { + return getByProjectWithResponse(resourceGroupName, projectName, imageName, versionName, Context.NONE) + .getValue(); + } + /** * Get the next page of items. * @@ -472,4 +800,58 @@ private Mono> listByImageNextSinglePageAsync(St .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 results of the image version list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectNextSinglePageAsync(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.listByProjectNext(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 results of the image version list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectNextSinglePageAsync(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.listByProjectNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsImpl.java index a65df05c40d6..019f31c0d516 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImageVersionsImpl.java @@ -64,6 +64,42 @@ public ImageVersion get(String resourceGroupName, String devCenterName, String g } } + public PagedIterable listByProject(String resourceGroupName, String projectName, String imageName) { + PagedIterable inner + = this.serviceClient().listByProject(resourceGroupName, projectName, imageName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByProject(String resourceGroupName, String projectName, String imageName, + Context context) { + PagedIterable inner + = this.serviceClient().listByProject(resourceGroupName, projectName, imageName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageVersionImpl(inner1, this.manager())); + } + + public Response getByProjectWithResponse(String resourceGroupName, String projectName, + String imageName, String versionName, Context context) { + Response inner = this.serviceClient() + .getByProjectWithResponse(resourceGroupName, projectName, imageName, versionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageVersion getByProject(String resourceGroupName, String projectName, String imageName, + String versionName) { + ImageVersionInner inner + = this.serviceClient().getByProject(resourceGroupName, projectName, imageName, versionName); + if (inner != null) { + return new ImageVersionImpl(inner, this.manager()); + } else { + return null; + } + } + private ImageVersionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesClientImpl.java index b29c1ee49b2e..91a63347beab 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesClientImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesClientImpl.java @@ -90,6 +90,24 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("galleryName") String galleryName, @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/images") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProject(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/images/{imageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByProject(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -105,6 +123,14 @@ Mono> listByDevCenterNext( Mono> listByGalleryNext( @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> listByProjectNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -595,6 +621,275 @@ public ImageInner get(String resourceGroupName, String devCenterName, String gal return getWithResponse(resourceGroupName, devCenterName, galleryName, imageName, Context.NONE).getValue(); } + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectSinglePageAsync(String resourceGroupName, String projectName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, 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 images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectSinglePageAsync(String resourceGroupName, String projectName, + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProject(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByProjectSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByProjectNextSinglePageAsync(nextLink)); + } + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectAsync(String resourceGroupName, String projectName, Context context) { + return new PagedFlux<>(() -> listByProjectSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByProjectNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProject(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByProjectAsync(resourceGroupName, projectName)); + } + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProject(String resourceGroupName, String projectName, Context context) { + return new PagedIterable<>(listByProjectAsync(resourceGroupName, projectName, context)); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByProjectWithResponseAsync(String resourceGroupName, String projectName, + String imageName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, imageName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByProjectWithResponseAsync(String resourceGroupName, String projectName, + String imageName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, imageName, accept, context); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByProjectAsync(String resourceGroupName, String projectName, String imageName) { + return getByProjectWithResponseAsync(resourceGroupName, projectName, imageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByProjectWithResponse(String resourceGroupName, String projectName, String imageName, + Context context) { + return getByProjectWithResponseAsync(resourceGroupName, projectName, imageName, context).block(); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner getByProject(String resourceGroupName, String projectName, String imageName) { + return getByProjectWithResponse(resourceGroupName, projectName, imageName, Context.NONE).getValue(); + } + /** * Get the next page of items. * @@ -702,4 +997,58 @@ private Mono> listByGalleryNextSinglePageAsync(String .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 results of the image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectNextSinglePageAsync(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.listByProjectNext(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 results of the image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectNextSinglePageAsync(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.listByProjectNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesImpl.java index 5b4f06be4a47..2d7e11303cd0 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ImagesImpl.java @@ -72,6 +72,37 @@ public Image get(String resourceGroupName, String devCenterName, String galleryN } } + public PagedIterable listByProject(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByProject(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public PagedIterable listByProject(String resourceGroupName, String projectName, Context context) { + PagedIterable inner = this.serviceClient().listByProject(resourceGroupName, projectName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public Response getByProjectWithResponse(String resourceGroupName, String projectName, String imageName, + Context context) { + Response inner + = this.serviceClient().getByProjectWithResponse(resourceGroupName, projectName, imageName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Image getByProject(String resourceGroupName, String projectName, String imageName) { + ImageInner inner = this.serviceClient().getByProject(resourceGroupName, projectName, imageName); + if (inner != null) { + return new ImageImpl(inner, this.manager()); + } else { + return null; + } + } + private ImagesClient serviceClient() { return this.innerClient; } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/InheritedSettingsForProjectImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/InheritedSettingsForProjectImpl.java new file mode 100644 index 000000000000..9d516ef6d910 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/InheritedSettingsForProjectImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.implementation; + +import com.azure.resourcemanager.devcenter.fluent.models.InheritedSettingsForProjectInner; +import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.InheritedSettingsForProject; +import com.azure.resourcemanager.devcenter.models.ProjectNetworkSettings; + +public final class InheritedSettingsForProjectImpl implements InheritedSettingsForProject { + private InheritedSettingsForProjectInner innerObject; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + InheritedSettingsForProjectImpl(InheritedSettingsForProjectInner innerObject, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public DevCenterProjectCatalogSettings projectCatalogSettings() { + return this.innerModel().projectCatalogSettings(); + } + + public ProjectNetworkSettings networkSettings() { + return this.innerModel().networkSettings(); + } + + public InheritedSettingsForProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/PoolImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/PoolImpl.java index 89651d6c43af..9df524262d2e 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/PoolImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/PoolImpl.java @@ -8,15 +8,20 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devcenter.fluent.models.PoolInner; +import com.azure.resourcemanager.devcenter.models.ActiveHoursConfiguration; +import com.azure.resourcemanager.devcenter.models.DevBoxTunnelEnableStatus; import com.azure.resourcemanager.devcenter.models.HealthStatus; import com.azure.resourcemanager.devcenter.models.HealthStatusDetail; import com.azure.resourcemanager.devcenter.models.LicenseType; import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; import com.azure.resourcemanager.devcenter.models.Pool; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinitionType; import com.azure.resourcemanager.devcenter.models.PoolUpdate; import com.azure.resourcemanager.devcenter.models.ProvisioningState; import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectConfiguration; import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; import java.util.Collections; import java.util.List; @@ -77,10 +82,18 @@ public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public PoolDevBoxDefinitionType devBoxDefinitionType() { + return this.innerModel().devBoxDefinitionType(); + } + public String devBoxDefinitionName() { return this.innerModel().devBoxDefinitionName(); } + public PoolDevBoxDefinition devBoxDefinition() { + return this.innerModel().devBoxDefinition(); + } + public String networkConnectionName() { return this.innerModel().networkConnectionName(); } @@ -97,6 +110,10 @@ public StopOnDisconnectConfiguration stopOnDisconnect() { return this.innerModel().stopOnDisconnect(); } + public StopOnNoConnectConfiguration stopOnNoConnect() { + return this.innerModel().stopOnNoConnect(); + } + public SingleSignOnStatus singleSignOnStatus() { return this.innerModel().singleSignOnStatus(); } @@ -118,6 +135,14 @@ public List managedVirtualNetworkRegions() { } } + public ActiveHoursConfiguration activeHoursConfiguration() { + return this.innerModel().activeHoursConfiguration(); + } + + public DevBoxTunnelEnableStatus devBoxTunnelEnableStatus() { + return this.innerModel().devBoxTunnelEnableStatus(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -243,6 +268,16 @@ public PoolImpl withTags(Map tags) { } } + public PoolImpl withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType) { + if (isInCreateMode()) { + this.innerModel().withDevBoxDefinitionType(devBoxDefinitionType); + return this; + } else { + this.updateBody.withDevBoxDefinitionType(devBoxDefinitionType); + return this; + } + } + public PoolImpl withDevBoxDefinitionName(String devBoxDefinitionName) { if (isInCreateMode()) { this.innerModel().withDevBoxDefinitionName(devBoxDefinitionName); @@ -253,6 +288,16 @@ public PoolImpl withDevBoxDefinitionName(String devBoxDefinitionName) { } } + public PoolImpl withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition) { + if (isInCreateMode()) { + this.innerModel().withDevBoxDefinition(devBoxDefinition); + return this; + } else { + this.updateBody.withDevBoxDefinition(devBoxDefinition); + return this; + } + } + public PoolImpl withNetworkConnectionName(String networkConnectionName) { if (isInCreateMode()) { this.innerModel().withNetworkConnectionName(networkConnectionName); @@ -293,6 +338,16 @@ public PoolImpl withStopOnDisconnect(StopOnDisconnectConfiguration stopOnDisconn } } + public PoolImpl withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect) { + if (isInCreateMode()) { + this.innerModel().withStopOnNoConnect(stopOnNoConnect); + return this; + } else { + this.updateBody.withStopOnNoConnect(stopOnNoConnect); + return this; + } + } + public PoolImpl withSingleSignOnStatus(SingleSignOnStatus singleSignOnStatus) { if (isInCreateMode()) { this.innerModel().withSingleSignOnStatus(singleSignOnStatus); @@ -333,6 +388,26 @@ public PoolImpl withManagedVirtualNetworkRegions(List managedVirtualNetw } } + public PoolImpl withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration) { + if (isInCreateMode()) { + this.innerModel().withActiveHoursConfiguration(activeHoursConfiguration); + return this; + } else { + this.updateBody.withActiveHoursConfiguration(activeHoursConfiguration); + return this; + } + } + + public PoolImpl withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus) { + if (isInCreateMode()) { + this.innerModel().withDevBoxTunnelEnableStatus(devBoxTunnelEnableStatus); + return this; + } else { + this.updateBody.withDevBoxTunnelEnableStatus(devBoxTunnelEnableStatus); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildOperationsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildOperationsClientImpl.java new file mode 100644 index 000000000000..18fe4df2f8a4 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildOperationsClientImpl.java @@ -0,0 +1,682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.devcenter.fluent.ProjectCatalogImageDefinitionBuildOperationsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +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 + * ProjectCatalogImageDefinitionBuildOperationsClient. + */ +public final class ProjectCatalogImageDefinitionBuildOperationsClientImpl + implements ProjectCatalogImageDefinitionBuildOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectCatalogImageDefinitionBuildOperationsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of ProjectCatalogImageDefinitionBuildOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectCatalogImageDefinitionBuildOperationsClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(ProjectCatalogImageDefinitionBuildOperationsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientProjectCatalogImageDefinitionBuildOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface ProjectCatalogImageDefinitionBuildOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds/{buildName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds/{buildName}/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds/{buildName}/getBuildDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, accept, context); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName) { + return getWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, + context).block(); + } + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageDefinitionBuildInner get(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName) { + return getWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, + Context.NONE).getValue(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> cancelWithResponseAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> cancelWithResponseAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, accept, context); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancelAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName) { + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancelAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = cancelWithResponseAsync(resourceGroupName, projectName, catalogName, + imageDefinitionName, buildName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancel(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName) { + return this.beginCancelAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName) + .getSyncPoller(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginCancel(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + return this + .beginCancelAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, context) + .getSyncPoller(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cancelAsync(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName) { + return beginCancelAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cancelAsync(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName, Context context) { + return beginCancelAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName) { + cancelAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName).block(); + } + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName, Context context) { + cancelAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, context).block(); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildDetailsWithResponseAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, String buildName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBuildDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildDetailsWithResponseAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, String buildName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBuildDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + buildName, accept, context); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildDetailsAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName) { + return getBuildDetailsWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, + buildName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildDetailsWithResponse(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, String buildName, Context context) { + return getBuildDetailsWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, + buildName, context).block(); + } + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageDefinitionBuildDetailsInner getBuildDetails(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName) { + return getBuildDetailsWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, + Context.NONE).getValue(); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildOperationsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildOperationsImpl.java new file mode 100644 index 000000000000..cc9c154db2be --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildOperationsImpl.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.devcenter.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.devcenter.fluent.ProjectCatalogImageDefinitionBuildOperationsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuild; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildDetails; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogImageDefinitionBuildOperations; + +public final class ProjectCatalogImageDefinitionBuildOperationsImpl + implements ProjectCatalogImageDefinitionBuildOperations { + private static final ClientLogger LOGGER = new ClientLogger(ProjectCatalogImageDefinitionBuildOperationsImpl.class); + + private final ProjectCatalogImageDefinitionBuildOperationsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public ProjectCatalogImageDefinitionBuildOperationsImpl( + ProjectCatalogImageDefinitionBuildOperationsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageDefinitionBuildImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageDefinitionBuild get(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName) { + ImageDefinitionBuildInner inner + = this.serviceClient().get(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName); + if (inner != null) { + return new ImageDefinitionBuildImpl(inner, this.manager()); + } else { + return null; + } + } + + public void cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName) { + this.serviceClient().cancel(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName); + } + + public void cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName, Context context) { + this.serviceClient() + .cancel(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, context); + } + + public Response getBuildDetailsWithResponse(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, String buildName, Context context) { + Response inner = this.serviceClient() + .getBuildDetailsWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageDefinitionBuildDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageDefinitionBuildDetails getBuildDetails(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName) { + ImageDefinitionBuildDetailsInner inner = this.serviceClient() + .getBuildDetails(resourceGroupName, projectName, catalogName, imageDefinitionName, buildName); + if (inner != null) { + return new ImageDefinitionBuildDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProjectCatalogImageDefinitionBuildOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildsClientImpl.java new file mode 100644 index 000000000000..902e34dda2d1 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildsClientImpl.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.devcenter.fluent.ProjectCatalogImageDefinitionBuildsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuildListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProjectCatalogImageDefinitionBuildsClient. + */ +public final class ProjectCatalogImageDefinitionBuildsClientImpl implements ProjectCatalogImageDefinitionBuildsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectCatalogImageDefinitionBuildsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of ProjectCatalogImageDefinitionBuildsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectCatalogImageDefinitionBuildsClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(ProjectCatalogImageDefinitionBuildsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientProjectCatalogImageDefinitionBuilds to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface ProjectCatalogImageDefinitionBuildsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/builds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByImageDefinition(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByImageDefinitionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionSinglePageAsync( + String resourceGroupName, String projectName, String catalogName, String imageDefinitionName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByImageDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, projectName, + catalogName, imageDefinitionName, 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 builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionSinglePageAsync( + String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByImageDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByImageDefinitionAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName) { + return new PagedFlux<>(() -> listByImageDefinitionSinglePageAsync(resourceGroupName, projectName, catalogName, + imageDefinitionName), nextLink -> listByImageDefinitionNextSinglePageAsync(nextLink)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByImageDefinitionAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, Context context) { + return new PagedFlux<>(() -> listByImageDefinitionSinglePageAsync(resourceGroupName, projectName, catalogName, + imageDefinitionName, context), nextLink -> listByImageDefinitionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + return new PagedIterable<>( + listByImageDefinitionAsync(resourceGroupName, projectName, catalogName, imageDefinitionName)); + } + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context) { + return new PagedIterable<>( + listByImageDefinitionAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, context)); + } + + /** + * 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 results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionNextSinglePageAsync(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.listByImageDefinitionNext(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 results of the Image Definition Build list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByImageDefinitionNextSinglePageAsync(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.listByImageDefinitionNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildsImpl.java new file mode 100644 index 000000000000..c25bad47f837 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionBuildsImpl.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.devcenter.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devcenter.fluent.ProjectCatalogImageDefinitionBuildsClient; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionBuild; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogImageDefinitionBuilds; + +public final class ProjectCatalogImageDefinitionBuildsImpl implements ProjectCatalogImageDefinitionBuilds { + private static final ClientLogger LOGGER = new ClientLogger(ProjectCatalogImageDefinitionBuildsImpl.class); + + private final ProjectCatalogImageDefinitionBuildsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public ProjectCatalogImageDefinitionBuildsImpl(ProjectCatalogImageDefinitionBuildsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + PagedIterable inner = this.serviceClient() + .listByImageDefinition(resourceGroupName, projectName, catalogName, imageDefinitionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionBuildImpl(inner1, this.manager())); + } + + public PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context) { + PagedIterable inner = this.serviceClient() + .listByImageDefinition(resourceGroupName, projectName, catalogName, imageDefinitionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionBuildImpl(inner1, this.manager())); + } + + private ProjectCatalogImageDefinitionBuildsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionsClientImpl.java new file mode 100644 index 000000000000..f216cd3e14dd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionsClientImpl.java @@ -0,0 +1,907 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.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.devcenter.fluent.ProjectCatalogImageDefinitionsClient; +import com.azure.resourcemanager.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; +import com.azure.resourcemanager.devcenter.models.ImageDefinitionListResult; +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 ProjectCatalogImageDefinitionsClient. + */ +public final class ProjectCatalogImageDefinitionsClientImpl implements ProjectCatalogImageDefinitionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectCatalogImageDefinitionsService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of ProjectCatalogImageDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectCatalogImageDefinitionsClientImpl(DevCenterManagementClientImpl client) { + this.service = RestProxy.create(ProjectCatalogImageDefinitionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientProjectCatalogImageDefinitions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface ProjectCatalogImageDefinitionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProjectCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByProjectCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/getErrorDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getErrorDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/catalogs/{catalogName}/imageDefinitions/{imageDefinitionName}/buildImage") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> buildImage(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("catalogName") String catalogName, @PathParam("imageDefinitionName") String imageDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProjectCatalogNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectCatalogSinglePageAsync(String resourceGroupName, + String projectName, String catalogName, Integer top) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProjectCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, top, 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 Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectCatalogSinglePageAsync(String resourceGroupName, + String projectName, String catalogName, Integer top, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProjectCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectCatalogAsync(String resourceGroupName, String projectName, + String catalogName, Integer top) { + return new PagedFlux<>( + () -> listByProjectCatalogSinglePageAsync(resourceGroupName, projectName, catalogName, top), + nextLink -> listByProjectCatalogNextSinglePageAsync(nextLink)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectCatalogAsync(String resourceGroupName, String projectName, + String catalogName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByProjectCatalogSinglePageAsync(resourceGroupName, projectName, catalogName, top), + nextLink -> listByProjectCatalogNextSinglePageAsync(nextLink)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectCatalogAsync(String resourceGroupName, String projectName, + String catalogName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByProjectCatalogSinglePageAsync(resourceGroupName, projectName, catalogName, top, context), + nextLink -> listByProjectCatalogNextSinglePageAsync(nextLink, context)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName) { + final Integer top = null; + return new PagedIterable<>(listByProjectCatalogAsync(resourceGroupName, projectName, catalogName, top)); + } + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName, Integer top, Context context) { + return new PagedIterable<>( + listByProjectCatalogAsync(resourceGroupName, projectName, catalogName, top, context)); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByProjectCatalogWithResponseAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByProjectCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByProjectCatalogWithResponseAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByProjectCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, accept, + context); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByProjectCatalogAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + return getByProjectCatalogWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByProjectCatalogWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context) { + return getByProjectCatalogWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, + context).block(); + } + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Image Definition from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageDefinitionInner getByProjectCatalog(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName) { + return getByProjectCatalogWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, + Context.NONE).getValue(); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getErrorDetailsWithResponseAsync( + String resourceGroupName, String projectName, String catalogName, String imageDefinitionName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getErrorDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getErrorDetailsWithResponseAsync( + String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getErrorDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, accept, + context); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getErrorDetailsAsync(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName) { + return getErrorDetailsWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getErrorDetailsWithResponse(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, Context context) { + return getErrorDetailsWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, + context).block(); + } + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CatalogResourceValidationErrorDetailsInner getErrorDetails(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + return getErrorDetailsWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, + Context.NONE).getValue(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> buildImageWithResponseAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.buildImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> buildImageWithResponseAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (imageDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter imageDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.buildImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, catalogName, imageDefinitionName, accept, + context); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImageAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + Mono>> mono + = buildImageWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImageAsync(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = buildImageWithResponseAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImage(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + return this.beginBuildImageAsync(resourceGroupName, projectName, catalogName, imageDefinitionName) + .getSyncPoller(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginBuildImage(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context) { + return this.beginBuildImageAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, context) + .getSyncPoller(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 buildImageAsync(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName) { + return beginBuildImageAsync(resourceGroupName, projectName, catalogName, imageDefinitionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 buildImageAsync(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, Context context) { + return beginBuildImageAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 buildImage(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName) { + buildImageAsync(resourceGroupName, projectName, catalogName, imageDefinitionName).block(); + } + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 buildImage(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + Context context) { + buildImageAsync(resourceGroupName, projectName, catalogName, imageDefinitionName, 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 results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectCatalogNextSinglePageAsync(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.listByProjectCatalogNext(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 results of the Image Definition list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectCatalogNextSinglePageAsync(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.listByProjectCatalogNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionsImpl.java new file mode 100644 index 000000000000..5461ebcf11a9 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectCatalogImageDefinitionsImpl.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.devcenter.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.devcenter.fluent.ProjectCatalogImageDefinitionsClient; +import com.azure.resourcemanager.devcenter.fluent.models.CatalogResourceValidationErrorDetailsInner; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; +import com.azure.resourcemanager.devcenter.models.CatalogResourceValidationErrorDetails; +import com.azure.resourcemanager.devcenter.models.ImageDefinition; +import com.azure.resourcemanager.devcenter.models.ProjectCatalogImageDefinitions; + +public final class ProjectCatalogImageDefinitionsImpl implements ProjectCatalogImageDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(ProjectCatalogImageDefinitionsImpl.class); + + private final ProjectCatalogImageDefinitionsClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public ProjectCatalogImageDefinitionsImpl(ProjectCatalogImageDefinitionsClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName) { + PagedIterable inner + = this.serviceClient().listByProjectCatalog(resourceGroupName, projectName, catalogName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName, Integer top, Context context) { + PagedIterable inner + = this.serviceClient().listByProjectCatalog(resourceGroupName, projectName, catalogName, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageDefinitionImpl(inner1, this.manager())); + } + + public Response getByProjectCatalogWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context) { + Response inner = this.serviceClient() + .getByProjectCatalogWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImageDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImageDefinition getByProjectCatalog(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName) { + ImageDefinitionInner inner = this.serviceClient() + .getByProjectCatalog(resourceGroupName, projectName, catalogName, imageDefinitionName); + if (inner != null) { + return new ImageDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getErrorDetailsWithResponse(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, Context context) { + Response inner = this.serviceClient() + .getErrorDetailsWithResponse(resourceGroupName, projectName, catalogName, imageDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CatalogResourceValidationErrorDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CatalogResourceValidationErrorDetails getErrorDetails(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName) { + CatalogResourceValidationErrorDetailsInner inner + = this.serviceClient().getErrorDetails(resourceGroupName, projectName, catalogName, imageDefinitionName); + if (inner != null) { + return new CatalogResourceValidationErrorDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public void buildImage(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName) { + this.serviceClient().buildImage(resourceGroupName, projectName, catalogName, imageDefinitionName); + } + + public void buildImage(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + Context context) { + this.serviceClient().buildImage(resourceGroupName, projectName, catalogName, imageDefinitionName, context); + } + + private ProjectCatalogImageDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectImpl.java index 1f9fe4f06a36..d631ce663649 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectImpl.java @@ -4,15 +4,22 @@ package com.azure.resourcemanager.devcenter.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.devcenter.fluent.models.ProjectInner; +import com.azure.resourcemanager.devcenter.models.AzureAiServicesSettings; +import com.azure.resourcemanager.devcenter.models.DevBoxAutoDeleteSettings; +import com.azure.resourcemanager.devcenter.models.InheritedSettingsForProject; import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; import com.azure.resourcemanager.devcenter.models.Project; import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationSettings; import com.azure.resourcemanager.devcenter.models.ProjectUpdate; import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import com.azure.resourcemanager.devcenter.models.ServerlessGpuSessionsSettings; +import com.azure.resourcemanager.devcenter.models.WorkspaceStorageSettings; import java.util.Collections; import java.util.Map; @@ -82,6 +89,26 @@ public ProjectCatalogSettings catalogSettings() { return this.innerModel().catalogSettings(); } + public ProjectCustomizationSettings customizationSettings() { + return this.innerModel().customizationSettings(); + } + + public DevBoxAutoDeleteSettings devBoxAutoDeleteSettings() { + return this.innerModel().devBoxAutoDeleteSettings(); + } + + public AzureAiServicesSettings azureAiServicesSettings() { + return this.innerModel().azureAiServicesSettings(); + } + + public ServerlessGpuSessionsSettings serverlessGpuSessionsSettings() { + return this.innerModel().serverlessGpuSessionsSettings(); + } + + public WorkspaceStorageSettings workspaceStorageSettings() { + return this.innerModel().workspaceStorageSettings(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -174,6 +201,14 @@ public Project refresh(Context context) { return this; } + public Response getInheritedSettingsWithResponse(Context context) { + return serviceManager.projects().getInheritedSettingsWithResponse(resourceGroupName, projectName, context); + } + + public InheritedSettingsForProject getInheritedSettings() { + return serviceManager.projects().getInheritedSettings(resourceGroupName, projectName); + } + public ProjectImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -254,6 +289,56 @@ public ProjectImpl withCatalogSettings(ProjectCatalogSettings catalogSettings) { } } + public ProjectImpl withCustomizationSettings(ProjectCustomizationSettings customizationSettings) { + if (isInCreateMode()) { + this.innerModel().withCustomizationSettings(customizationSettings); + return this; + } else { + this.updateBody.withCustomizationSettings(customizationSettings); + return this; + } + } + + public ProjectImpl withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings devBoxAutoDeleteSettings) { + if (isInCreateMode()) { + this.innerModel().withDevBoxAutoDeleteSettings(devBoxAutoDeleteSettings); + return this; + } else { + this.updateBody.withDevBoxAutoDeleteSettings(devBoxAutoDeleteSettings); + return this; + } + } + + public ProjectImpl withAzureAiServicesSettings(AzureAiServicesSettings azureAiServicesSettings) { + if (isInCreateMode()) { + this.innerModel().withAzureAiServicesSettings(azureAiServicesSettings); + return this; + } else { + this.updateBody.withAzureAiServicesSettings(azureAiServicesSettings); + return this; + } + } + + public ProjectImpl withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings serverlessGpuSessionsSettings) { + if (isInCreateMode()) { + this.innerModel().withServerlessGpuSessionsSettings(serverlessGpuSessionsSettings); + return this; + } else { + this.updateBody.withServerlessGpuSessionsSettings(serverlessGpuSessionsSettings); + return this; + } + } + + public ProjectImpl withWorkspaceStorageSettings(WorkspaceStorageSettings workspaceStorageSettings) { + if (isInCreateMode()) { + this.innerModel().withWorkspaceStorageSettings(workspaceStorageSettings); + return this; + } else { + this.updateBody.withWorkspaceStorageSettings(workspaceStorageSettings); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPoliciesClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPoliciesClientImpl.java new file mode 100644 index 000000000000..8494afeead49 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPoliciesClientImpl.java @@ -0,0 +1,1220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.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.devcenter.fluent.ProjectPoliciesClient; +import com.azure.resourcemanager.devcenter.fluent.models.ProjectPolicyInner; +import com.azure.resourcemanager.devcenter.models.ProjectPolicyListResult; +import com.azure.resourcemanager.devcenter.models.ProjectPolicyUpdate; +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 ProjectPoliciesClient. + */ +public final class ProjectPoliciesClientImpl implements ProjectPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final DevCenterManagementClientImpl client; + + /** + * Initializes an instance of ProjectPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectPoliciesClientImpl(DevCenterManagementClientImpl client) { + this.service + = RestProxy.create(ProjectPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevCenterManagementClientProjectPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevCenterManagementC") + public interface ProjectPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/projectPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDevCenter(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/projectPolicies/{projectPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("projectPolicyName") String projectPolicyName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/projectPolicies/{projectPolicyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName, + @PathParam("projectPolicyName") String projectPolicyName, + @BodyParam("application/json") ProjectPolicyInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/projectPolicies/{projectPolicyName}") + @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("devCenterName") String devCenterName, + @PathParam("projectPolicyName") String projectPolicyName, + @BodyParam("application/json") ProjectPolicyUpdate body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/projectPolicies/{projectPolicyName}") + @ExpectedResponses({ 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("devCenterName") String devCenterName, + @PathParam("projectPolicyName") String projectPolicyName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDevCenterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterSinglePageAsync(String resourceGroupName, + String devCenterName, Integer top) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDevCenter(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, top, 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 project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterSinglePageAsync(String resourceGroupName, + String devCenterName, Integer top, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDevCenter(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDevCenterAsync(String resourceGroupName, String devCenterName, + Integer top) { + return new PagedFlux<>(() -> listByDevCenterSinglePageAsync(resourceGroupName, devCenterName, top), + nextLink -> listByDevCenterNextSinglePageAsync(nextLink)); + } + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDevCenterAsync(String resourceGroupName, String devCenterName) { + final Integer top = null; + return new PagedFlux<>(() -> listByDevCenterSinglePageAsync(resourceGroupName, devCenterName, top), + nextLink -> listByDevCenterNextSinglePageAsync(nextLink)); + } + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDevCenterAsync(String resourceGroupName, String devCenterName, + Integer top, Context context) { + return new PagedFlux<>(() -> listByDevCenterSinglePageAsync(resourceGroupName, devCenterName, top, context), + nextLink -> listByDevCenterNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDevCenter(String resourceGroupName, String devCenterName) { + final Integer top = null; + return new PagedIterable<>(listByDevCenterAsync(resourceGroupName, devCenterName, top)); + } + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDevCenter(String resourceGroupName, String devCenterName, + Integer top, Context context) { + return new PagedIterable<>(listByDevCenterAsync(resourceGroupName, devCenterName, top, context)); + } + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String devCenterName, + String projectPolicyName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, projectPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, projectPolicyName, accept, context); + } + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String devCenterName, + String projectPolicyName) { + return getWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String devCenterName, + String projectPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName, context).block(); + } + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectPolicyInner get(String resourceGroupName, String devCenterName, String projectPolicyName) { + return getWithResponse(resourceGroupName, devCenterName, projectPolicyName, Context.NONE).getValue(); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyInner 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, projectPolicyName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyInner 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, projectPolicyName, body, accept, + context); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String devCenterName, String projectPolicyName, ProjectPolicyInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectPolicyInner.class, ProjectPolicyInner.class, this.client.getContext()); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String devCenterName, String projectPolicyName, ProjectPolicyInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectPolicyInner.class, ProjectPolicyInner.class, context); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectPolicyInner> beginCreateOrUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body).getSyncPoller(); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectPolicyInner> beginCreateOrUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body, context) + .getSyncPoller(); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, ProjectPolicyInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, ProjectPolicyInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectPolicyInner createOrUpdate(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyInner body) { + return createOrUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body).block(); + } + + /** + * Creates or updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Represents an project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectPolicyInner createOrUpdate(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body, context).block(); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, ProjectPolicyUpdate 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, projectPolicyName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, ProjectPolicyUpdate 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName 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.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, projectPolicyName, body, accept, context); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectPolicyInner> beginUpdateAsync(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyUpdate body) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectPolicyInner.class, ProjectPolicyInner.class, this.client.getContext()); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectPolicyInner> beginUpdateAsync(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectPolicyInner.class, ProjectPolicyInner.class, context); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectPolicyInner> beginUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyUpdate body) { + return this.beginUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body).getSyncPoller(); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectPolicyInner> beginUpdate(String resourceGroupName, + String devCenterName, String projectPolicyName, ProjectPolicyUpdate body, Context context) { + return this.beginUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body, context) + .getSyncPoller(); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, ProjectPolicyUpdate body) { + return beginUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String devCenterName, + String projectPolicyName, ProjectPolicyUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, devCenterName, projectPolicyName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectPolicyInner update(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyUpdate body) { + return updateAsync(resourceGroupName, devCenterName, projectPolicyName, body).block(); + } + + /** + * Partially updates an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param body Updatable project policy properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents an project policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectPolicyInner update(String resourceGroupName, String devCenterName, String projectPolicyName, + ProjectPolicyUpdate body, Context context) { + return updateAsync(resourceGroupName, devCenterName, projectPolicyName, body, context).block(); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String projectPolicyName) { + 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, devCenterName, projectPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String projectPolicyName, 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 (devCenterName == null) { + return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null.")); + } + if (projectPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter projectPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, devCenterName, projectPolicyName, accept, context); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String projectPolicyName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String projectPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, devCenterName, projectPolicyName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String projectPolicyName) { + return this.beginDeleteAsync(resourceGroupName, devCenterName, projectPolicyName).getSyncPoller(); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 devCenterName, + String projectPolicyName, Context context) { + return this.beginDeleteAsync(resourceGroupName, devCenterName, projectPolicyName, context).getSyncPoller(); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 devCenterName, String projectPolicyName) { + return beginDeleteAsync(resourceGroupName, devCenterName, projectPolicyName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 devCenterName, String projectPolicyName, + Context context) { + return beginDeleteAsync(resourceGroupName, devCenterName, projectPolicyName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 devCenterName, String projectPolicyName) { + deleteAsync(resourceGroupName, devCenterName, projectPolicyName).block(); + } + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 devCenterName, String projectPolicyName, Context context) { + deleteAsync(resourceGroupName, devCenterName, projectPolicyName, 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 results of the project policy list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterNextSinglePageAsync(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.listByDevCenterNext(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 results of the project policy list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDevCenterNextSinglePageAsync(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.listByDevCenterNext(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/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPoliciesImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPoliciesImpl.java new file mode 100644 index 000000000000..f59c915c029c --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPoliciesImpl.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.devcenter.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.devcenter.fluent.ProjectPoliciesClient; +import com.azure.resourcemanager.devcenter.fluent.models.ProjectPolicyInner; +import com.azure.resourcemanager.devcenter.models.ProjectPolicies; +import com.azure.resourcemanager.devcenter.models.ProjectPolicy; + +public final class ProjectPoliciesImpl implements ProjectPolicies { + private static final ClientLogger LOGGER = new ClientLogger(ProjectPoliciesImpl.class); + + private final ProjectPoliciesClient innerClient; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public ProjectPoliciesImpl(ProjectPoliciesClient innerClient, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDevCenter(String resourceGroupName, String devCenterName) { + PagedIterable inner + = this.serviceClient().listByDevCenter(resourceGroupName, devCenterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByDevCenter(String resourceGroupName, String devCenterName, Integer top, + Context context) { + PagedIterable inner + = this.serviceClient().listByDevCenter(resourceGroupName, devCenterName, top, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectPolicyImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String devCenterName, + String projectPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, devCenterName, projectPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProjectPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectPolicy get(String resourceGroupName, String devCenterName, String projectPolicyName) { + ProjectPolicyInner inner = this.serviceClient().get(resourceGroupName, devCenterName, projectPolicyName); + if (inner != null) { + return new ProjectPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String devCenterName, String projectPolicyName) { + this.serviceClient().delete(resourceGroupName, devCenterName, projectPolicyName); + } + + public void delete(String resourceGroupName, String devCenterName, String projectPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, devCenterName, projectPolicyName, context); + } + + public ProjectPolicy 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String projectPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "projectPolicies"); + if (projectPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projectPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, devCenterName, projectPolicyName, 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String projectPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "projectPolicies"); + if (projectPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projectPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, devCenterName, projectPolicyName, 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String projectPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "projectPolicies"); + if (projectPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projectPolicies'.", id))); + } + this.delete(resourceGroupName, devCenterName, projectPolicyName, 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 devCenterName = ResourceManagerUtils.getValueFromIdByName(id, "devcenters"); + if (devCenterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devcenters'.", id))); + } + String projectPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "projectPolicies"); + if (projectPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projectPolicies'.", id))); + } + this.delete(resourceGroupName, devCenterName, projectPolicyName, context); + } + + private ProjectPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } + + public ProjectPolicyImpl define(String name) { + return new ProjectPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPolicyImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPolicyImpl.java new file mode 100644 index 000000000000..bcaff193608e --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectPolicyImpl.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.devcenter.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devcenter.fluent.models.ProjectPolicyInner; +import com.azure.resourcemanager.devcenter.models.ProjectPolicy; +import com.azure.resourcemanager.devcenter.models.ProjectPolicyUpdate; +import com.azure.resourcemanager.devcenter.models.ProvisioningState; +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.util.Collections; +import java.util.List; + +public final class ProjectPolicyImpl implements ProjectPolicy, ProjectPolicy.Definition, ProjectPolicy.Update { + private ProjectPolicyInner innerObject; + + private final com.azure.resourcemanager.devcenter.DevCenterManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List resourcePolicies() { + List inner = this.innerModel().resourcePolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scopes() { + List inner = this.innerModel().scopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProjectPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devcenter.DevCenterManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String devCenterName; + + private String projectPolicyName; + + private ProjectPolicyUpdate updateBody; + + public ProjectPolicyImpl withExistingDevcenter(String resourceGroupName, String devCenterName) { + this.resourceGroupName = resourceGroupName; + this.devCenterName = devCenterName; + return this; + } + + public ProjectPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getProjectPolicies() + .createOrUpdate(resourceGroupName, devCenterName, projectPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ProjectPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjectPolicies() + .createOrUpdate(resourceGroupName, devCenterName, projectPolicyName, this.innerModel(), context); + return this; + } + + ProjectPolicyImpl(String name, com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerObject = new ProjectPolicyInner(); + this.serviceManager = serviceManager; + this.projectPolicyName = name; + } + + public ProjectPolicyImpl update() { + this.updateBody = new ProjectPolicyUpdate(); + return this; + } + + public ProjectPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getProjectPolicies() + .update(resourceGroupName, devCenterName, projectPolicyName, updateBody, Context.NONE); + return this; + } + + public ProjectPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjectPolicies() + .update(resourceGroupName, devCenterName, projectPolicyName, updateBody, context); + return this; + } + + ProjectPolicyImpl(ProjectPolicyInner innerObject, + com.azure.resourcemanager.devcenter.DevCenterManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.devCenterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "devcenters"); + this.projectPolicyName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projectPolicies"); + } + + public ProjectPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getProjectPolicies() + .getWithResponse(resourceGroupName, devCenterName, projectPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ProjectPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjectPolicies() + .getWithResponse(resourceGroupName, devCenterName, projectPolicyName, context) + .getValue(); + return this; + } + + public ProjectPolicyImpl withResourcePolicies(List resourcePolicies) { + if (isInCreateMode()) { + this.innerModel().withResourcePolicies(resourcePolicies); + return this; + } else { + this.updateBody.withResourcePolicies(resourcePolicies); + return this; + } + } + + public ProjectPolicyImpl withScopes(List scopes) { + if (isInCreateMode()) { + this.innerModel().withScopes(scopes); + return this; + } else { + this.updateBody.withScopes(scopes); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsClientImpl.java index 12d2010efafe..334c5b25617b 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsClientImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsClientImpl.java @@ -14,6 +14,7 @@ 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; @@ -33,6 +34,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devcenter.fluent.ProjectsClient; +import com.azure.resourcemanager.devcenter.fluent.models.InheritedSettingsForProjectInner; import com.azure.resourcemanager.devcenter.fluent.models.ProjectInner; import com.azure.resourcemanager.devcenter.models.ProjectListResult; import com.azure.resourcemanager.devcenter.models.ProjectUpdate; @@ -124,6 +126,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/getInheritedSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInheritedSettings(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -1195,6 +1206,127 @@ public void delete(String resourceGroupName, String projectName, Context context deleteAsync(resourceGroupName, projectName, context).block(); } + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getInheritedSettingsWithResponseAsync(String resourceGroupName, String projectName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getInheritedSettings(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getInheritedSettingsWithResponseAsync(String resourceGroupName, String projectName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getInheritedSettings(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context); + } + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInheritedSettingsAsync(String resourceGroupName, + String projectName) { + return getInheritedSettingsWithResponseAsync(resourceGroupName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInheritedSettingsWithResponse(String resourceGroupName, + String projectName, Context context) { + return getInheritedSettingsWithResponseAsync(resourceGroupName, projectName, context).block(); + } + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InheritedSettingsForProjectInner getInheritedSettings(String resourceGroupName, String projectName) { + return getInheritedSettingsWithResponse(resourceGroupName, projectName, Context.NONE).getValue(); + } + /** * Get the next page of items. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsImpl.java index b6f3c0333585..68d72ff9b475 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/ProjectsImpl.java @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devcenter.fluent.ProjectsClient; +import com.azure.resourcemanager.devcenter.fluent.models.InheritedSettingsForProjectInner; import com.azure.resourcemanager.devcenter.fluent.models.ProjectInner; +import com.azure.resourcemanager.devcenter.models.InheritedSettingsForProject; import com.azure.resourcemanager.devcenter.models.Project; import com.azure.resourcemanager.devcenter.models.Projects; @@ -76,6 +78,28 @@ public void delete(String resourceGroupName, String projectName, Context context this.serviceClient().delete(resourceGroupName, projectName, context); } + public Response getInheritedSettingsWithResponse(String resourceGroupName, + String projectName, Context context) { + Response inner + = this.serviceClient().getInheritedSettingsWithResponse(resourceGroupName, projectName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new InheritedSettingsForProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public InheritedSettingsForProject getInheritedSettings(String resourceGroupName, String projectName) { + InheritedSettingsForProjectInner inner + = this.serviceClient().getInheritedSettings(resourceGroupName, projectName); + if (inner != null) { + return new InheritedSettingsForProjectImpl(inner, this.manager()); + } else { + return null; + } + } + public Project getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusClientImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusClientImpl.java index 3e3898baa254..4c38c67a1ea5 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusClientImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusClientImpl.java @@ -11,6 +11,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.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,6 +62,15 @@ public final class SkusClientImpl implements SkusClient { @Host("{$host}") @ServiceInterface(name = "DevCenterManagementC") public interface SkusService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/listSkus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProject(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/skus") @ExpectedResponses({ 200 }) @@ -69,6 +79,13 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProjectNext(@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 }) @@ -78,6 +95,149 @@ Mono> listBySubscriptionNext( @HeaderParam("Accept") String accept, Context context); } + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectSinglePageAsync(String resourceGroupName, + String projectName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByProject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, 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 SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectSinglePageAsync(String resourceGroupName, + String projectName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProject(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByProjectSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByProjectNextSinglePageAsync(nextLink)); + } + + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProjectAsync(String resourceGroupName, String projectName, + Context context) { + return new PagedFlux<>(() -> listByProjectSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByProjectNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProject(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByProjectAsync(resourceGroupName, projectName)); + } + + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProject(String resourceGroupName, String projectName, + Context context) { + return new PagedIterable<>(listByProjectAsync(resourceGroupName, projectName, context)); + } + /** * Lists the Microsoft.DevCenter SKUs available in a subscription. * @@ -210,6 +370,60 @@ public PagedIterable list(Integer top, Context context) { return new PagedIterable<>(listAsync(top, context)); } + /** + * 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 results of the Microsoft.DevCenter SKU list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectNextSinglePageAsync(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.listByProjectNext(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 results of the Microsoft.DevCenter SKU list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProjectNextSinglePageAsync(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.listByProjectNext(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. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusImpl.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusImpl.java index 4a7803b12f14..c61202e33297 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusImpl.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/implementation/SkusImpl.java @@ -24,6 +24,17 @@ public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.devcenter.DevC this.serviceManager = serviceManager; } + public PagedIterable listByProject(String resourceGroupName, String projectName) { + PagedIterable inner = this.serviceClient().listByProject(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DevCenterSkuImpl(inner1, this.manager())); + } + + public PagedIterable listByProject(String resourceGroupName, String projectName, Context context) { + PagedIterable inner + = this.serviceClient().listByProject(resourceGroupName, projectName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DevCenterSkuImpl(inner1, this.manager())); + } + public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); return ResourceManagerUtils.mapPage(inner, inner1 -> new DevCenterSkuImpl(inner1, this.manager())); diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ActiveHoursConfiguration.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ActiveHoursConfiguration.java new file mode 100644 index 000000000000..4f54bb81ef33 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ActiveHoursConfiguration.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.devcenter.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; + +/** + * Active hours configuration. + */ +@Fluent +public final class ActiveHoursConfiguration implements JsonSerializable { + /* + * Enables or disables whether the Dev Box should be kept awake during active hours. + */ + private KeepAwakeEnableStatus keepAwakeEnableStatus; + + /* + * Enables or disables whether the Dev Box should be automatically started at commencement of active hours. + */ + private AutoStartEnableStatus autoStartEnableStatus; + + /* + * The default IANA timezone id of the active hours. + */ + private String defaultTimeZone; + + /* + * The default start time of the active hours. + */ + private Integer defaultStartTimeHour; + + /* + * The default end time of the active hours + */ + private Integer defaultEndTimeHour; + + /** + * Creates an instance of ActiveHoursConfiguration class. + */ + public ActiveHoursConfiguration() { + } + + /** + * Get the keepAwakeEnableStatus property: Enables or disables whether the Dev Box should be kept awake during + * active hours. + * + * @return the keepAwakeEnableStatus value. + */ + public KeepAwakeEnableStatus keepAwakeEnableStatus() { + return this.keepAwakeEnableStatus; + } + + /** + * Set the keepAwakeEnableStatus property: Enables or disables whether the Dev Box should be kept awake during + * active hours. + * + * @param keepAwakeEnableStatus the keepAwakeEnableStatus value to set. + * @return the ActiveHoursConfiguration object itself. + */ + public ActiveHoursConfiguration withKeepAwakeEnableStatus(KeepAwakeEnableStatus keepAwakeEnableStatus) { + this.keepAwakeEnableStatus = keepAwakeEnableStatus; + return this; + } + + /** + * Get the autoStartEnableStatus property: Enables or disables whether the Dev Box should be automatically started + * at commencement of active hours. + * + * @return the autoStartEnableStatus value. + */ + public AutoStartEnableStatus autoStartEnableStatus() { + return this.autoStartEnableStatus; + } + + /** + * Set the autoStartEnableStatus property: Enables or disables whether the Dev Box should be automatically started + * at commencement of active hours. + * + * @param autoStartEnableStatus the autoStartEnableStatus value to set. + * @return the ActiveHoursConfiguration object itself. + */ + public ActiveHoursConfiguration withAutoStartEnableStatus(AutoStartEnableStatus autoStartEnableStatus) { + this.autoStartEnableStatus = autoStartEnableStatus; + return this; + } + + /** + * Get the defaultTimeZone property: The default IANA timezone id of the active hours. + * + * @return the defaultTimeZone value. + */ + public String defaultTimeZone() { + return this.defaultTimeZone; + } + + /** + * Set the defaultTimeZone property: The default IANA timezone id of the active hours. + * + * @param defaultTimeZone the defaultTimeZone value to set. + * @return the ActiveHoursConfiguration object itself. + */ + public ActiveHoursConfiguration withDefaultTimeZone(String defaultTimeZone) { + this.defaultTimeZone = defaultTimeZone; + return this; + } + + /** + * Get the defaultStartTimeHour property: The default start time of the active hours. + * + * @return the defaultStartTimeHour value. + */ + public Integer defaultStartTimeHour() { + return this.defaultStartTimeHour; + } + + /** + * Set the defaultStartTimeHour property: The default start time of the active hours. + * + * @param defaultStartTimeHour the defaultStartTimeHour value to set. + * @return the ActiveHoursConfiguration object itself. + */ + public ActiveHoursConfiguration withDefaultStartTimeHour(Integer defaultStartTimeHour) { + this.defaultStartTimeHour = defaultStartTimeHour; + return this; + } + + /** + * Get the defaultEndTimeHour property: The default end time of the active hours. + * + * @return the defaultEndTimeHour value. + */ + public Integer defaultEndTimeHour() { + return this.defaultEndTimeHour; + } + + /** + * Set the defaultEndTimeHour property: The default end time of the active hours. + * + * @param defaultEndTimeHour the defaultEndTimeHour value to set. + * @return the ActiveHoursConfiguration object itself. + */ + public ActiveHoursConfiguration withDefaultEndTimeHour(Integer defaultEndTimeHour) { + this.defaultEndTimeHour = defaultEndTimeHour; + 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("keepAwakeEnableStatus", + this.keepAwakeEnableStatus == null ? null : this.keepAwakeEnableStatus.toString()); + jsonWriter.writeStringField("autoStartEnableStatus", + this.autoStartEnableStatus == null ? null : this.autoStartEnableStatus.toString()); + jsonWriter.writeStringField("defaultTimeZone", this.defaultTimeZone); + jsonWriter.writeNumberField("defaultStartTimeHour", this.defaultStartTimeHour); + jsonWriter.writeNumberField("defaultEndTimeHour", this.defaultEndTimeHour); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveHoursConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveHoursConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveHoursConfiguration. + */ + public static ActiveHoursConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveHoursConfiguration deserializedActiveHoursConfiguration = new ActiveHoursConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keepAwakeEnableStatus".equals(fieldName)) { + deserializedActiveHoursConfiguration.keepAwakeEnableStatus + = KeepAwakeEnableStatus.fromString(reader.getString()); + } else if ("autoStartEnableStatus".equals(fieldName)) { + deserializedActiveHoursConfiguration.autoStartEnableStatus + = AutoStartEnableStatus.fromString(reader.getString()); + } else if ("defaultTimeZone".equals(fieldName)) { + deserializedActiveHoursConfiguration.defaultTimeZone = reader.getString(); + } else if ("defaultStartTimeHour".equals(fieldName)) { + deserializedActiveHoursConfiguration.defaultStartTimeHour = reader.getNullable(JsonReader::getInt); + } else if ("defaultEndTimeHour".equals(fieldName)) { + deserializedActiveHoursConfiguration.defaultEndTimeHour = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveHoursConfiguration; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AutoImageBuildStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AutoImageBuildStatus.java new file mode 100644 index 000000000000..a77f15a16125 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AutoImageBuildStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether auto image build is enabled/disabled. + */ +public final class AutoImageBuildStatus extends ExpandableStringEnum { + /** + * Static value Disabled for AutoImageBuildStatus. + */ + public static final AutoImageBuildStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for AutoImageBuildStatus. + */ + public static final AutoImageBuildStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of AutoImageBuildStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoImageBuildStatus() { + } + + /** + * Creates or finds a AutoImageBuildStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoImageBuildStatus. + */ + public static AutoImageBuildStatus fromString(String name) { + return fromString(name, AutoImageBuildStatus.class); + } + + /** + * Gets known AutoImageBuildStatus values. + * + * @return known AutoImageBuildStatus values. + */ + public static Collection values() { + return values(AutoImageBuildStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AutoStartEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AutoStartEnableStatus.java new file mode 100644 index 000000000000..d45fc7d783f2 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AutoStartEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enables or disables whether Dev Boxes should be automatically started at commencement of active hours. + */ +public final class AutoStartEnableStatus extends ExpandableStringEnum { + /** + * Static value Enabled for AutoStartEnableStatus. + */ + public static final AutoStartEnableStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for AutoStartEnableStatus. + */ + public static final AutoStartEnableStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AutoStartEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoStartEnableStatus() { + } + + /** + * Creates or finds a AutoStartEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoStartEnableStatus. + */ + public static AutoStartEnableStatus fromString(String name) { + return fromString(name, AutoStartEnableStatus.class); + } + + /** + * Gets known AutoStartEnableStatus values. + * + * @return known AutoStartEnableStatus values. + */ + public static Collection values() { + return values(AutoStartEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AzureAiServicesMode.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AzureAiServicesMode.java new file mode 100644 index 000000000000..95f18891ac3b --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AzureAiServicesMode.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether Azure AI services are enabled for a project. + */ +public final class AzureAiServicesMode extends ExpandableStringEnum { + /** + * Static value Disabled for AzureAiServicesMode. + */ + public static final AzureAiServicesMode DISABLED = fromString("Disabled"); + + /** + * Static value AutoDeploy for AzureAiServicesMode. + */ + public static final AzureAiServicesMode AUTO_DEPLOY = fromString("AutoDeploy"); + + /** + * Creates a new instance of AzureAiServicesMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureAiServicesMode() { + } + + /** + * Creates or finds a AzureAiServicesMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureAiServicesMode. + */ + public static AzureAiServicesMode fromString(String name) { + return fromString(name, AzureAiServicesMode.class); + } + + /** + * Gets known AzureAiServicesMode values. + * + * @return known AzureAiServicesMode values. + */ + public static Collection values() { + return values(AzureAiServicesMode.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AzureAiServicesSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AzureAiServicesSettings.java new file mode 100644 index 000000000000..299d4429b422 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/AzureAiServicesSettings.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.devcenter.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; + +/** + * Configures Azure AI related services for the project. + */ +@Fluent +public final class AzureAiServicesSettings implements JsonSerializable { + /* + * The property indicates whether Azure AI services is enabled. + */ + private AzureAiServicesMode azureAiServicesMode; + + /** + * Creates an instance of AzureAiServicesSettings class. + */ + public AzureAiServicesSettings() { + } + + /** + * Get the azureAiServicesMode property: The property indicates whether Azure AI services is enabled. + * + * @return the azureAiServicesMode value. + */ + public AzureAiServicesMode azureAiServicesMode() { + return this.azureAiServicesMode; + } + + /** + * Set the azureAiServicesMode property: The property indicates whether Azure AI services is enabled. + * + * @param azureAiServicesMode the azureAiServicesMode value to set. + * @return the AzureAiServicesSettings object itself. + */ + public AzureAiServicesSettings withAzureAiServicesMode(AzureAiServicesMode azureAiServicesMode) { + this.azureAiServicesMode = azureAiServicesMode; + 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("azureAiServicesMode", + this.azureAiServicesMode == null ? null : this.azureAiServicesMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAiServicesSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAiServicesSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureAiServicesSettings. + */ + public static AzureAiServicesSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureAiServicesSettings deserializedAzureAiServicesSettings = new AzureAiServicesSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureAiServicesMode".equals(fieldName)) { + deserializedAzureAiServicesSettings.azureAiServicesMode + = AzureAiServicesMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureAiServicesSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CatalogItemType.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CatalogItemType.java index 4e8dfc5ca1c5..9398f3c184bb 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CatalogItemType.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CatalogItemType.java @@ -16,6 +16,11 @@ public final class CatalogItemType extends ExpandableStringEnum */ public static final CatalogItemType ENVIRONMENT_DEFINITION = fromString("EnvironmentDefinition"); + /** + * Static value ImageDefinition for CatalogItemType. + */ + public static final CatalogItemType IMAGE_DEFINITION = fromString("ImageDefinition"); + /** * Creates a new instance of CatalogItemType value. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTask.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTask.java new file mode 100644 index 000000000000..cf74777886aa --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTask.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.CustomizationTaskInner; +import java.util.Map; + +/** + * An immutable client-side representation of CustomizationTask. + */ +public interface CustomizationTask { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inputs property: Inputs to the task. + * + * @return the inputs value. + */ + Map inputs(); + + /** + * Gets the timeout property: The default timeout for the task. + * + * @return the timeout value. + */ + Integer timeout(); + + /** + * Gets the validationStatus property: Validation status for the Task. + * + * @return the validationStatus value. + */ + CatalogResourceValidationStatus validationStatus(); + + /** + * Gets the inner com.azure.resourcemanager.devcenter.fluent.models.CustomizationTaskInner object. + * + * @return the inner object. + */ + CustomizationTaskInner innerModel(); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInput.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInput.java new file mode 100644 index 000000000000..34bb532198a6 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInput.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.devcenter.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; + +/** + * Input for a Task. + */ +@Immutable +public final class CustomizationTaskInput implements JsonSerializable { + /* + * Description of the input. + */ + private String description; + + /* + * Type of the input. + */ + private CustomizationTaskInputType type; + + /* + * Whether or not the input is required. + */ + private Boolean required; + + /** + * Creates an instance of CustomizationTaskInput class. + */ + public CustomizationTaskInput() { + } + + /** + * Get the description property: Description of the input. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the type property: Type of the input. + * + * @return the type value. + */ + public CustomizationTaskInputType type() { + return this.type; + } + + /** + * Get the required property: Whether or not the input is required. + * + * @return the required value. + */ + public Boolean required() { + return this.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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizationTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizationTaskInput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomizationTaskInput. + */ + public static CustomizationTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizationTaskInput deserializedCustomizationTaskInput = new CustomizationTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCustomizationTaskInput.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCustomizationTaskInput.type = CustomizationTaskInputType.fromString(reader.getString()); + } else if ("required".equals(fieldName)) { + deserializedCustomizationTaskInput.required = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizationTaskInput; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInputType.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInputType.java new file mode 100644 index 000000000000..88240bad67c0 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInputType.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the input. + */ +public final class CustomizationTaskInputType extends ExpandableStringEnum { + /** + * Static value string for CustomizationTaskInputType. + */ + public static final CustomizationTaskInputType STRING = fromString("string"); + + /** + * Static value number for CustomizationTaskInputType. + */ + public static final CustomizationTaskInputType NUMBER = fromString("number"); + + /** + * Static value boolean for CustomizationTaskInputType. + */ + public static final CustomizationTaskInputType BOOLEAN = fromString("boolean"); + + /** + * Creates a new instance of CustomizationTaskInputType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomizationTaskInputType() { + } + + /** + * Creates or finds a CustomizationTaskInputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomizationTaskInputType. + */ + public static CustomizationTaskInputType fromString(String name) { + return fromString(name, CustomizationTaskInputType.class); + } + + /** + * Gets known CustomizationTaskInputType values. + * + * @return known CustomizationTaskInputType values. + */ + public static Collection values() { + return values(CustomizationTaskInputType.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInstance.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInstance.java new file mode 100644 index 000000000000..63d8be54e0d7 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskInstance.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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; + +/** + * A customization task to run. + */ +@Fluent +public final class CustomizationTaskInstance implements JsonSerializable { + /* + * Name of the task. + */ + private String name; + + /* + * Parameters for the task. + */ + private List parameters; + + /* + * Display name to help differentiate multiple instances of the same task. + */ + private String displayName; + + /* + * Timeout, in seconds. Overrides any timeout provided on the task definition. + */ + private Integer timeoutInSeconds; + + /* + * An expression that must evaluate to true in order for the task to run. + */ + private String condition; + + /** + * Creates an instance of CustomizationTaskInstance class. + */ + public CustomizationTaskInstance() { + } + + /** + * Get the name property: Name of the task. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the task. + * + * @param name the name value to set. + * @return the CustomizationTaskInstance object itself. + */ + public CustomizationTaskInstance withName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameters property: Parameters for the task. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters for the task. + * + * @param parameters the parameters value to set. + * @return the CustomizationTaskInstance object itself. + */ + public CustomizationTaskInstance withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the displayName property: Display name to help differentiate multiple instances of the same task. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name to help differentiate multiple instances of the same task. + * + * @param displayName the displayName value to set. + * @return the CustomizationTaskInstance object itself. + */ + public CustomizationTaskInstance withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the timeoutInSeconds property: Timeout, in seconds. Overrides any timeout provided on the task definition. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: Timeout, in seconds. Overrides any timeout provided on the task definition. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the CustomizationTaskInstance object itself. + */ + public CustomizationTaskInstance withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the condition property: An expression that must evaluate to true in order for the task to run. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: An expression that must evaluate to true in order for the task to run. + * + * @param condition the condition value to set. + * @return the CustomizationTaskInstance object itself. + */ + public CustomizationTaskInstance withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model CustomizationTaskInstance")); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomizationTaskInstance.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeStringField("condition", this.condition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizationTaskInstance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizationTaskInstance 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 CustomizationTaskInstance. + */ + public static CustomizationTaskInstance fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizationTaskInstance deserializedCustomizationTaskInstance = new CustomizationTaskInstance(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomizationTaskInstance.name = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> DefinitionParametersItem.fromJson(reader1)); + deserializedCustomizationTaskInstance.parameters = parameters; + } else if ("displayName".equals(fieldName)) { + deserializedCustomizationTaskInstance.displayName = reader.getString(); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedCustomizationTaskInstance.timeoutInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("condition".equals(fieldName)) { + deserializedCustomizationTaskInstance.condition = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizationTaskInstance; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskListResult.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskListResult.java new file mode 100644 index 000000000000..cd7745f266dd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTaskListResult.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.devcenter.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.devcenter.fluent.models.CustomizationTaskInner; +import java.io.IOException; +import java.util.List; + +/** + * Results of the Task list operation. + */ +@Immutable +public final class CustomizationTaskListResult implements JsonSerializable { + /* + * Current page of results. + */ + private List value; + + /* + * URL to get the next set of results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of CustomizationTaskListResult class. + */ + public CustomizationTaskListResult() { + } + + /** + * Get the value property: Current page of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of 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 CustomizationTaskListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizationTaskListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomizationTaskListResult. + */ + public static CustomizationTaskListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizationTaskListResult deserializedCustomizationTaskListResult = new CustomizationTaskListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CustomizationTaskInner.fromJson(reader1)); + deserializedCustomizationTaskListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCustomizationTaskListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizationTaskListResult; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTasks.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTasks.java new file mode 100644 index 000000000000..96536ec72ce2 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/CustomizationTasks.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.devcenter.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 CustomizationTasks. + */ +public interface CustomizationTasks { + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCatalog(String resourceGroupName, String devCenterName, String catalogName); + + /** + * List Tasks in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Task list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCatalog(String resourceGroupName, String devCenterName, String catalogName, + Integer top, Context context); + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String devCenterName, String catalogName, + String taskName, Context context); + + /** + * Gets a Task from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task from the catalog. + */ + CustomizationTask get(String resourceGroupName, String devCenterName, String catalogName, String taskName); + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details along with {@link Response}. + */ + Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String taskName, Context context); + + /** + * Gets Customization Task error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param taskName The name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customization Task error details. + */ + CatalogResourceValidationErrorDetails getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String taskName); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DefinitionParametersItem.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DefinitionParametersItem.java new file mode 100644 index 000000000000..93d3d72570ac --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DefinitionParametersItem.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.devcenter.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 DefinitionParametersItem model. + */ +@Fluent +public final class DefinitionParametersItem implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * The value property. + */ + private String value; + + /** + * Creates an instance of DefinitionParametersItem class. + */ + public DefinitionParametersItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the DefinitionParametersItem object itself. + */ + public DefinitionParametersItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the DefinitionParametersItem object itself. + */ + public DefinitionParametersItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DefinitionParametersItem")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DefinitionParametersItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DefinitionParametersItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefinitionParametersItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefinitionParametersItem 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 DefinitionParametersItem. + */ + public static DefinitionParametersItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefinitionParametersItem deserializedDefinitionParametersItem = new DefinitionParametersItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDefinitionParametersItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDefinitionParametersItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDefinitionParametersItem; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxAutoDeleteSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxAutoDeleteSettings.java new file mode 100644 index 000000000000..3e8c9b395b27 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxAutoDeleteSettings.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.devcenter.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 controlling the auto deletion of inactive dev boxes. + */ +@Fluent +public final class DevBoxAutoDeleteSettings implements JsonSerializable { + /* + * Indicates the delete mode for Dev Boxes within this project. + */ + private DevBoxDeleteMode deleteMode; + + /* + * ISO8601 duration required for the dev box to not be inactive prior to it being scheduled for deletion. ISO8601 + * format PT[n]H[n]M[n]S. + */ + private String inactiveThreshold; + + /* + * ISO8601 duration required for the dev box to be marked for deletion prior to it being deleted. ISO8601 format + * PT[n]H[n]M[n]S. + */ + private String gracePeriod; + + /** + * Creates an instance of DevBoxAutoDeleteSettings class. + */ + public DevBoxAutoDeleteSettings() { + } + + /** + * Get the deleteMode property: Indicates the delete mode for Dev Boxes within this project. + * + * @return the deleteMode value. + */ + public DevBoxDeleteMode deleteMode() { + return this.deleteMode; + } + + /** + * Set the deleteMode property: Indicates the delete mode for Dev Boxes within this project. + * + * @param deleteMode the deleteMode value to set. + * @return the DevBoxAutoDeleteSettings object itself. + */ + public DevBoxAutoDeleteSettings withDeleteMode(DevBoxDeleteMode deleteMode) { + this.deleteMode = deleteMode; + return this; + } + + /** + * Get the inactiveThreshold property: ISO8601 duration required for the dev box to not be inactive prior to it + * being scheduled for deletion. ISO8601 format PT[n]H[n]M[n]S. + * + * @return the inactiveThreshold value. + */ + public String inactiveThreshold() { + return this.inactiveThreshold; + } + + /** + * Set the inactiveThreshold property: ISO8601 duration required for the dev box to not be inactive prior to it + * being scheduled for deletion. ISO8601 format PT[n]H[n]M[n]S. + * + * @param inactiveThreshold the inactiveThreshold value to set. + * @return the DevBoxAutoDeleteSettings object itself. + */ + public DevBoxAutoDeleteSettings withInactiveThreshold(String inactiveThreshold) { + this.inactiveThreshold = inactiveThreshold; + return this; + } + + /** + * Get the gracePeriod property: ISO8601 duration required for the dev box to be marked for deletion prior to it + * being deleted. ISO8601 format PT[n]H[n]M[n]S. + * + * @return the gracePeriod value. + */ + public String gracePeriod() { + return this.gracePeriod; + } + + /** + * Set the gracePeriod property: ISO8601 duration required for the dev box to be marked for deletion prior to it + * being deleted. ISO8601 format PT[n]H[n]M[n]S. + * + * @param gracePeriod the gracePeriod value to set. + * @return the DevBoxAutoDeleteSettings object itself. + */ + public DevBoxAutoDeleteSettings withGracePeriod(String gracePeriod) { + this.gracePeriod = gracePeriod; + 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("deleteMode", this.deleteMode == null ? null : this.deleteMode.toString()); + jsonWriter.writeStringField("inactiveThreshold", this.inactiveThreshold); + jsonWriter.writeStringField("gracePeriod", this.gracePeriod); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevBoxAutoDeleteSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevBoxAutoDeleteSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DevBoxAutoDeleteSettings. + */ + public static DevBoxAutoDeleteSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevBoxAutoDeleteSettings deserializedDevBoxAutoDeleteSettings = new DevBoxAutoDeleteSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteMode".equals(fieldName)) { + deserializedDevBoxAutoDeleteSettings.deleteMode = DevBoxDeleteMode.fromString(reader.getString()); + } else if ("inactiveThreshold".equals(fieldName)) { + deserializedDevBoxAutoDeleteSettings.inactiveThreshold = reader.getString(); + } else if ("gracePeriod".equals(fieldName)) { + deserializedDevBoxAutoDeleteSettings.gracePeriod = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDevBoxAutoDeleteSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxDeleteMode.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxDeleteMode.java new file mode 100644 index 000000000000..18b79c51d57e --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxDeleteMode.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates possible values for Dev Box delete mode. + */ +public final class DevBoxDeleteMode extends ExpandableStringEnum { + /** + * Static value Manual for DevBoxDeleteMode. + */ + public static final DevBoxDeleteMode MANUAL = fromString("Manual"); + + /** + * Static value Auto for DevBoxDeleteMode. + */ + public static final DevBoxDeleteMode AUTO = fromString("Auto"); + + /** + * Creates a new instance of DevBoxDeleteMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevBoxDeleteMode() { + } + + /** + * Creates or finds a DevBoxDeleteMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevBoxDeleteMode. + */ + public static DevBoxDeleteMode fromString(String name) { + return fromString(name, DevBoxDeleteMode.class); + } + + /** + * Gets known DevBoxDeleteMode values. + * + * @return known DevBoxDeleteMode values. + */ + public static Collection values() { + return values(DevBoxDeleteMode.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxProvisioningSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxProvisioningSettings.java new file mode 100644 index 000000000000..434aabfedc66 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxProvisioningSettings.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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; + +/** + * Provisioning settings that apply to all Dev Boxes created in this dev center. + */ +@Fluent +public final class DevBoxProvisioningSettings implements JsonSerializable { + /* + * Whether project catalogs associated with projects in this dev center can be configured to sync catalog items. + */ + private InstallAzureMonitorAgentEnableStatus installAzureMonitorAgentEnableStatus; + + /** + * Creates an instance of DevBoxProvisioningSettings class. + */ + public DevBoxProvisioningSettings() { + } + + /** + * Get the installAzureMonitorAgentEnableStatus property: Whether project catalogs associated with projects in this + * dev center can be configured to sync catalog items. + * + * @return the installAzureMonitorAgentEnableStatus value. + */ + public InstallAzureMonitorAgentEnableStatus installAzureMonitorAgentEnableStatus() { + return this.installAzureMonitorAgentEnableStatus; + } + + /** + * Set the installAzureMonitorAgentEnableStatus property: Whether project catalogs associated with projects in this + * dev center can be configured to sync catalog items. + * + * @param installAzureMonitorAgentEnableStatus the installAzureMonitorAgentEnableStatus value to set. + * @return the DevBoxProvisioningSettings object itself. + */ + public DevBoxProvisioningSettings withInstallAzureMonitorAgentEnableStatus( + InstallAzureMonitorAgentEnableStatus installAzureMonitorAgentEnableStatus) { + this.installAzureMonitorAgentEnableStatus = installAzureMonitorAgentEnableStatus; + 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("installAzureMonitorAgentEnableStatus", + this.installAzureMonitorAgentEnableStatus == null + ? null + : this.installAzureMonitorAgentEnableStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevBoxProvisioningSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevBoxProvisioningSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DevBoxProvisioningSettings. + */ + public static DevBoxProvisioningSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevBoxProvisioningSettings deserializedDevBoxProvisioningSettings = new DevBoxProvisioningSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("installAzureMonitorAgentEnableStatus".equals(fieldName)) { + deserializedDevBoxProvisioningSettings.installAzureMonitorAgentEnableStatus + = InstallAzureMonitorAgentEnableStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDevBoxProvisioningSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxTunnelEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxTunnelEnableStatus.java new file mode 100644 index 000000000000..022b9ac1b9fc --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevBoxTunnelEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether Dev Box Tunnel is enabled. + */ +public final class DevBoxTunnelEnableStatus extends ExpandableStringEnum { + /** + * Static value Disabled for DevBoxTunnelEnableStatus. + */ + public static final DevBoxTunnelEnableStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for DevBoxTunnelEnableStatus. + */ + public static final DevBoxTunnelEnableStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of DevBoxTunnelEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevBoxTunnelEnableStatus() { + } + + /** + * Creates or finds a DevBoxTunnelEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevBoxTunnelEnableStatus. + */ + public static DevBoxTunnelEnableStatus fromString(String name) { + return fromString(name, DevBoxTunnelEnableStatus.class); + } + + /** + * Gets known DevBoxTunnelEnableStatus values. + * + * @return known DevBoxTunnelEnableStatus values. + */ + public static Collection values() { + return values(DevBoxTunnelEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenter.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenter.java index a0e08e3340dd..cff24124aa5d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenter.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenter.java @@ -100,6 +100,22 @@ public interface DevCenter { */ DevCenterProjectCatalogSettings projectCatalogSettings(); + /** + * Gets the networkSettings property: Network settings that will be enforced on network resources associated with + * the Dev Center. + * + * @return the networkSettings value. + */ + DevCenterNetworkSettings networkSettings(); + + /** + * Gets the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev Boxes that + * belong to this dev center. + * + * @return the devBoxProvisioningSettings value. + */ + DevBoxProvisioningSettings devBoxProvisioningSettings(); + /** * Gets the region of the resource. * @@ -185,7 +201,8 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithEncryption, - DefinitionStages.WithDisplayName, DefinitionStages.WithProjectCatalogSettings { + DefinitionStages.WithDisplayName, DefinitionStages.WithProjectCatalogSettings, + DefinitionStages.WithNetworkSettings, DefinitionStages.WithDevBoxProvisioningSettings { /** * Executes the create request. * @@ -269,6 +286,36 @@ interface WithProjectCatalogSettings { */ WithCreate withProjectCatalogSettings(DevCenterProjectCatalogSettings projectCatalogSettings); } + + /** + * The stage of the DevCenter definition allowing to specify networkSettings. + */ + interface WithNetworkSettings { + /** + * Specifies the networkSettings property: Network settings that will be enforced on network resources + * associated with the Dev Center.. + * + * @param networkSettings Network settings that will be enforced on network resources associated with the + * Dev Center. + * @return the next definition stage. + */ + WithCreate withNetworkSettings(DevCenterNetworkSettings networkSettings); + } + + /** + * The stage of the DevCenter definition allowing to specify devBoxProvisioningSettings. + */ + interface WithDevBoxProvisioningSettings { + /** + * Specifies the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev + * Boxes that belong to this dev center.. + * + * @param devBoxProvisioningSettings Settings to be used in the provisioning of all Dev Boxes that belong to + * this dev center. + * @return the next definition stage. + */ + WithCreate withDevBoxProvisioningSettings(DevBoxProvisioningSettings devBoxProvisioningSettings); + } } /** @@ -282,7 +329,8 @@ interface WithProjectCatalogSettings { * The template for DevCenter update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithEncryption, - UpdateStages.WithDisplayName, UpdateStages.WithProjectCatalogSettings { + UpdateStages.WithDisplayName, UpdateStages.WithProjectCatalogSettings, UpdateStages.WithNetworkSettings, + UpdateStages.WithDevBoxProvisioningSettings { /** * Executes the update request. * @@ -370,6 +418,36 @@ interface WithProjectCatalogSettings { */ Update withProjectCatalogSettings(DevCenterProjectCatalogSettings projectCatalogSettings); } + + /** + * The stage of the DevCenter update allowing to specify networkSettings. + */ + interface WithNetworkSettings { + /** + * Specifies the networkSettings property: Network settings that will be enforced on network resources + * associated with the Dev Center.. + * + * @param networkSettings Network settings that will be enforced on network resources associated with the + * Dev Center. + * @return the next definition stage. + */ + Update withNetworkSettings(DevCenterNetworkSettings networkSettings); + } + + /** + * The stage of the DevCenter update allowing to specify devBoxProvisioningSettings. + */ + interface WithDevBoxProvisioningSettings { + /** + * Specifies the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev + * Boxes that belong to this dev center.. + * + * @param devBoxProvisioningSettings Settings to be used in the provisioning of all Dev Boxes that belong to + * this dev center. + * @return the next definition stage. + */ + Update withDevBoxProvisioningSettings(DevBoxProvisioningSettings devBoxProvisioningSettings); + } } /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitionBuildOperations.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitionBuildOperations.java new file mode 100644 index 000000000000..e78009f74090 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitionBuildOperations.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.devcenter.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DevCenterCatalogImageDefinitionBuildOperations. + */ +public interface DevCenterCatalogImageDefinitionBuildOperations { + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName, Context context); + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition. + */ + ImageDefinitionBuild get(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response}. + */ + Response getBuildDetailsWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details. + */ + ImageDefinitionBuildDetails getBuildDetails(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName, String buildName); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitionBuilds.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitionBuilds.java new file mode 100644 index 000000000000..4ffe6687da5a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitionBuilds.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of DevCenterCatalogImageDefinitionBuilds. + */ +public interface DevCenterCatalogImageDefinitionBuilds { + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByImageDefinition(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName); + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByImageDefinition(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitions.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitions.java new file mode 100644 index 000000000000..88c8e464885a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterCatalogImageDefinitions.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.devcenter.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 DevCenterCatalogImageDefinitions. + */ +public interface DevCenterCatalogImageDefinitions { + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName); + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDevCenterCatalog(String resourceGroupName, String devCenterName, + String catalogName, Integer top, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog along with {@link Response}. + */ + Response getByDevCenterCatalogWithResponse(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog. + */ + ImageDefinition getByDevCenterCatalog(String resourceGroupName, String devCenterName, String catalogName, + String imageDefinitionName); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response}. + */ + Response getErrorDetailsWithResponse(String resourceGroupName, + String devCenterName, String catalogName, String imageDefinitionName, Context context); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details. + */ + CatalogResourceValidationErrorDetails getErrorDetails(String resourceGroupName, String devCenterName, + String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String devCenterName, String catalogName, String imageDefinitionName, + Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterEncryptionSet.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterEncryptionSet.java new file mode 100644 index 000000000000..c30bca6eee61 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterEncryptionSet.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devcenter.fluent.models.DevCenterEncryptionSetInner; +import java.util.Map; + +/** + * An immutable client-side representation of DevCenterEncryptionSet. + */ +public interface DevCenterEncryptionSet { + /** + * 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 identity properties. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates + * if Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @return the devboxDisksEncryptionEnableStatus value. + */ + DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus(); + + /** + * Gets the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @return the keyEncryptionKeyUrl value. + */ + String keyEncryptionKeyUrl(); + + /** + * 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.devcenter.fluent.models.DevCenterEncryptionSetInner object. + * + * @return the inner object. + */ + DevCenterEncryptionSetInner innerModel(); + + /** + * The entirety of the DevCenterEncryptionSet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DevCenterEncryptionSet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DevCenterEncryptionSet definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the DevCenterEncryptionSet 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 DevCenterEncryptionSet definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, devCenterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @return the next definition stage. + */ + WithCreate withExistingDevcenter(String resourceGroupName, String devCenterName); + } + + /** + * The stage of the DevCenterEncryptionSet 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.WithDevboxDisksEncryptionEnableStatus, DefinitionStages.WithKeyEncryptionKeyUrl { + /** + * Executes the create request. + * + * @return the created resource. + */ + DevCenterEncryptionSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DevCenterEncryptionSet create(Context context); + } + + /** + * The stage of the DevCenterEncryptionSet 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 DevCenterEncryptionSet definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identity properties. + * + * @param identity Managed identity properties. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the DevCenterEncryptionSet definition allowing to specify devboxDisksEncryptionEnableStatus. + */ + interface WithDevboxDisksEncryptionEnableStatus { + /** + * Specifies the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable + * status. Indicates if Devbox disks encryption using DevCenter CMK is enabled or not.. + * + * @param devboxDisksEncryptionEnableStatus Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * @return the next definition stage. + */ + WithCreate withDevboxDisksEncryptionEnableStatus( + DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus); + } + + /** + * The stage of the DevCenterEncryptionSet definition allowing to specify keyEncryptionKeyUrl. + */ + interface WithKeyEncryptionKeyUrl { + /** + * Specifies the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek.. + * + * @param keyEncryptionKeyUrl Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * @return the next definition stage. + */ + WithCreate withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl); + } + } + + /** + * Begins update for the DevCenterEncryptionSet resource. + * + * @return the stage of resource update. + */ + DevCenterEncryptionSet.Update update(); + + /** + * The template for DevCenterEncryptionSet update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, + UpdateStages.WithDevboxDisksEncryptionEnableStatus, UpdateStages.WithKeyEncryptionKeyUrl { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DevCenterEncryptionSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DevCenterEncryptionSet apply(Context context); + } + + /** + * The DevCenterEncryptionSet update stages. + */ + interface UpdateStages { + /** + * The stage of the DevCenterEncryptionSet 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 DevCenterEncryptionSet update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identity properties. + * + * @param identity Managed identity properties. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the DevCenterEncryptionSet update allowing to specify devboxDisksEncryptionEnableStatus. + */ + interface WithDevboxDisksEncryptionEnableStatus { + /** + * Specifies the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable + * status. Indicates if Devbox disks encryption using DevCenter CMK is enabled or not.. + * + * @param devboxDisksEncryptionEnableStatus Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * @return the next definition stage. + */ + Update withDevboxDisksEncryptionEnableStatus( + DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus); + } + + /** + * The stage of the DevCenterEncryptionSet update allowing to specify keyEncryptionKeyUrl. + */ + interface WithKeyEncryptionKeyUrl { + /** + * Specifies the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek.. + * + * @param keyEncryptionKeyUrl Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * @return the next definition stage. + */ + Update withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DevCenterEncryptionSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DevCenterEncryptionSet refresh(Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterNetworkSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterNetworkSettings.java new file mode 100644 index 000000000000..aeccbab8748a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterNetworkSettings.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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; + +/** + * Network settings for the Dev Center. + */ +@Fluent +public final class DevCenterNetworkSettings implements JsonSerializable { + /* + * Indicates whether pools in this Dev Center can use Microsoft Hosted Networks. Defaults to Enabled if not set. + */ + private MicrosoftHostedNetworkEnableStatus microsoftHostedNetworkEnableStatus; + + /** + * Creates an instance of DevCenterNetworkSettings class. + */ + public DevCenterNetworkSettings() { + } + + /** + * Get the microsoftHostedNetworkEnableStatus property: Indicates whether pools in this Dev Center can use Microsoft + * Hosted Networks. Defaults to Enabled if not set. + * + * @return the microsoftHostedNetworkEnableStatus value. + */ + public MicrosoftHostedNetworkEnableStatus microsoftHostedNetworkEnableStatus() { + return this.microsoftHostedNetworkEnableStatus; + } + + /** + * Set the microsoftHostedNetworkEnableStatus property: Indicates whether pools in this Dev Center can use Microsoft + * Hosted Networks. Defaults to Enabled if not set. + * + * @param microsoftHostedNetworkEnableStatus the microsoftHostedNetworkEnableStatus value to set. + * @return the DevCenterNetworkSettings object itself. + */ + public DevCenterNetworkSettings + withMicrosoftHostedNetworkEnableStatus(MicrosoftHostedNetworkEnableStatus microsoftHostedNetworkEnableStatus) { + this.microsoftHostedNetworkEnableStatus = microsoftHostedNetworkEnableStatus; + 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("microsoftHostedNetworkEnableStatus", + this.microsoftHostedNetworkEnableStatus == null + ? null + : this.microsoftHostedNetworkEnableStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DevCenterNetworkSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DevCenterNetworkSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DevCenterNetworkSettings. + */ + public static DevCenterNetworkSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DevCenterNetworkSettings deserializedDevCenterNetworkSettings = new DevCenterNetworkSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("microsoftHostedNetworkEnableStatus".equals(fieldName)) { + deserializedDevCenterNetworkSettings.microsoftHostedNetworkEnableStatus + = MicrosoftHostedNetworkEnableStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDevCenterNetworkSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterResourceType.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterResourceType.java new file mode 100644 index 000000000000..1b66df025fa0 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterResourceType.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates dev center resource types. + */ +public final class DevCenterResourceType extends ExpandableStringEnum { + /** + * Static value Images for DevCenterResourceType. + */ + public static final DevCenterResourceType IMAGES = fromString("Images"); + + /** + * Static value AttachedNetworks for DevCenterResourceType. + */ + public static final DevCenterResourceType ATTACHED_NETWORKS = fromString("AttachedNetworks"); + + /** + * Static value Skus for DevCenterResourceType. + */ + public static final DevCenterResourceType SKUS = fromString("Skus"); + + /** + * Creates a new instance of DevCenterResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevCenterResourceType() { + } + + /** + * Creates or finds a DevCenterResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevCenterResourceType. + */ + public static DevCenterResourceType fromString(String name) { + return fromString(name, DevCenterResourceType.class); + } + + /** + * Gets known DevCenterResourceType values. + * + * @return known DevCenterResourceType values. + */ + public static Collection values() { + return values(DevCenterResourceType.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterSku.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterSku.java index 8c20f6ef6ccf..3dd2041b2a70 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterSku.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterSku.java @@ -12,7 +12,7 @@ */ public interface DevCenterSku { /** - * Gets the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * Gets the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. * * @return the name value. */ diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterUpdate.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterUpdate.java index f9b375cfd5d9..9bc806dd4e1d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterUpdate.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevCenterUpdate.java @@ -153,6 +153,56 @@ public DevCenterUpdate withProjectCatalogSettings(DevCenterProjectCatalogSetting return this; } + /** + * Get the networkSettings property: Network settings that will be enforced on network resources associated with the + * Dev Center. + * + * @return the networkSettings value. + */ + public DevCenterNetworkSettings networkSettings() { + return this.innerProperties() == null ? null : this.innerProperties().networkSettings(); + } + + /** + * Set the networkSettings property: Network settings that will be enforced on network resources associated with the + * Dev Center. + * + * @param networkSettings the networkSettings value to set. + * @return the DevCenterUpdate object itself. + */ + public DevCenterUpdate withNetworkSettings(DevCenterNetworkSettings networkSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterUpdateProperties(); + } + this.innerProperties().withNetworkSettings(networkSettings); + return this; + } + + /** + * Get the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev Boxes that belong + * to this dev center. + * + * @return the devBoxProvisioningSettings value. + */ + public DevBoxProvisioningSettings devBoxProvisioningSettings() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxProvisioningSettings(); + } + + /** + * Set the devBoxProvisioningSettings property: Settings to be used in the provisioning of all Dev Boxes that belong + * to this dev center. + * + * @param devBoxProvisioningSettings the devBoxProvisioningSettings value to set. + * @return the DevCenterUpdate object itself. + */ + public DevCenterUpdate withDevBoxProvisioningSettings(DevBoxProvisioningSettings devBoxProvisioningSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterUpdateProperties(); + } + this.innerProperties().withDevBoxProvisioningSettings(devBoxProvisioningSettings); + return this; + } + /** * Validates the instance. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevboxDisksEncryptionEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevboxDisksEncryptionEnableStatus.java new file mode 100644 index 000000000000..f557adb47d7b --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DevboxDisksEncryptionEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Devbox disk encryption enable or disable status. Indicates if Devbox disks encryption is enabled or not. + */ +public final class DevboxDisksEncryptionEnableStatus extends ExpandableStringEnum { + /** + * Static value Enabled for DevboxDisksEncryptionEnableStatus. + */ + public static final DevboxDisksEncryptionEnableStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for DevboxDisksEncryptionEnableStatus. + */ + public static final DevboxDisksEncryptionEnableStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of DevboxDisksEncryptionEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevboxDisksEncryptionEnableStatus() { + } + + /** + * Creates or finds a DevboxDisksEncryptionEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevboxDisksEncryptionEnableStatus. + */ + public static DevboxDisksEncryptionEnableStatus fromString(String name) { + return fromString(name, DevboxDisksEncryptionEnableStatus.class); + } + + /** + * Gets known DevboxDisksEncryptionEnableStatus values. + * + * @return known DevboxDisksEncryptionEnableStatus values. + */ + public static Collection values() { + return values(DevboxDisksEncryptionEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DomainJoinType.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DomainJoinType.java index a0376d719806..0cb77156b141 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DomainJoinType.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/DomainJoinType.java @@ -21,6 +21,11 @@ public final class DomainJoinType extends ExpandableStringEnum { */ public static final DomainJoinType AZURE_ADJOIN = fromString("AzureADJoin"); + /** + * Static value None for DomainJoinType. + */ + public static final DomainJoinType NONE = fromString("None"); + /** * Creates a new instance of DomainJoinType value. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSetListResult.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSetListResult.java new file mode 100644 index 000000000000..dec60ae3e4e0 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSetListResult.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.devcenter.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.devcenter.fluent.models.DevCenterEncryptionSetInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the list devcenter encryption set operation. + */ +@Immutable +public final class EncryptionSetListResult implements JsonSerializable { + /* + * Current page of results. + */ + private List value; + + /* + * URL to get the next set of results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of EncryptionSetListResult class. + */ + public EncryptionSetListResult() { + } + + /** + * Get the value property: Current page of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of 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 EncryptionSetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionSetListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionSetListResult. + */ + public static EncryptionSetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionSetListResult deserializedEncryptionSetListResult = new EncryptionSetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DevCenterEncryptionSetInner.fromJson(reader1)); + deserializedEncryptionSetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEncryptionSetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionSetListResult; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSetUpdate.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSetUpdate.java new file mode 100644 index 000000000000..155251659026 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSetUpdate.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.devcenter.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.devcenter.fluent.models.DevCenterEncryptionSetUpdateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The devcenter encryption set resource for partial updates. Properties not provided in the update request will not be + * changed. + */ +@Fluent +public final class EncryptionSetUpdate extends TrackedResourceUpdate { + /* + * Properties of a Dev Center encryption set to be updated. + */ + private DevCenterEncryptionSetUpdateProperties innerProperties; + + /* + * Managed identity properties + */ + private ManagedServiceIdentity identity; + + /** + * Creates an instance of EncryptionSetUpdate class. + */ + public EncryptionSetUpdate() { + } + + /** + * Get the innerProperties property: Properties of a Dev Center encryption set to be updated. + * + * @return the innerProperties value. + */ + private DevCenterEncryptionSetUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: Managed identity properties. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identity properties. + * + * @param identity the identity value to set. + * @return the EncryptionSetUpdate object itself. + */ + public EncryptionSetUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EncryptionSetUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EncryptionSetUpdate withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Get the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @return the devboxDisksEncryptionEnableStatus value. + */ + public DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus() { + return this.innerProperties() == null ? null : this.innerProperties().devboxDisksEncryptionEnableStatus(); + } + + /** + * Set the devboxDisksEncryptionEnableStatus property: Devbox disk encryption enable or disable status. Indicates if + * Devbox disks encryption using DevCenter CMK is enabled or not. + * + * @param devboxDisksEncryptionEnableStatus the devboxDisksEncryptionEnableStatus value to set. + * @return the EncryptionSetUpdate object itself. + */ + public EncryptionSetUpdate + withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus devboxDisksEncryptionEnableStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterEncryptionSetUpdateProperties(); + } + this.innerProperties().withDevboxDisksEncryptionEnableStatus(devboxDisksEncryptionEnableStatus); + return this; + } + + /** + * Get the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @return the keyEncryptionKeyUrl value. + */ + public String keyEncryptionKeyUrl() { + return this.innerProperties() == null ? null : this.innerProperties().keyEncryptionKeyUrl(); + } + + /** + * Set the keyEncryptionKeyUrl property: Key encryption key Url, versioned or non-versioned. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or + * https://contosovault.vault.azure.net/keys/contosokek. + * + * @param keyEncryptionKeyUrl the keyEncryptionKeyUrl value to set. + * @return the EncryptionSetUpdate object itself. + */ + public EncryptionSetUpdate withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new DevCenterEncryptionSetUpdateProperties(); + } + this.innerProperties().withKeyEncryptionKeyUrl(keyEncryptionKeyUrl); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionSetUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionSetUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionSetUpdate. + */ + public static EncryptionSetUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionSetUpdate deserializedEncryptionSetUpdate = new EncryptionSetUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEncryptionSetUpdate.withTags(tags); + } else if ("location".equals(fieldName)) { + deserializedEncryptionSetUpdate.withLocation(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedEncryptionSetUpdate.innerProperties + = DevCenterEncryptionSetUpdateProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedEncryptionSetUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionSetUpdate; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSets.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSets.java new file mode 100644 index 000000000000..a2df2f2fc89c --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/EncryptionSets.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.devcenter.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 EncryptionSets. + */ +public interface EncryptionSets { + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String devCenterName); + + /** + * Lists all encryption sets in the devcenter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the list devcenter encryption set operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String devCenterName, Integer top, + Context context); + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String devCenterName, + String encryptionSetName, Context context); + + /** + * Gets a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a devcenter encryption set. + */ + DevCenterEncryptionSet get(String resourceGroupName, String devCenterName, String encryptionSetName); + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String encryptionSetName); + + /** + * Deletes a devcenter encryption set. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param encryptionSetName The name of the devcenter encryption set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String encryptionSetName, Context context); + + /** + * Gets a devcenter encryption set. + * + * @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 a devcenter encryption set along with {@link Response}. + */ + DevCenterEncryptionSet getById(String id); + + /** + * Gets a devcenter encryption set. + * + * @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 a devcenter encryption set along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a devcenter encryption set. + * + * @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 a devcenter encryption set. + * + * @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 DevCenterEncryptionSet resource. + * + * @param name resource name. + * @return the first stage of the new DevCenterEncryptionSet definition. + */ + DevCenterEncryptionSet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/HealthCheckStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/HealthCheckStatus.java index 9fb26ef7a575..1057d17c4b69 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/HealthCheckStatus.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/HealthCheckStatus.java @@ -41,6 +41,11 @@ public final class HealthCheckStatus extends ExpandableStringEnum { + /* + * An identifier for the error. + */ + private String code; + + /* + * A message describing the error. + */ + private String message; + + /** + * Creates an instance of ImageCreationErrorDetails class. + */ + public ImageCreationErrorDetails() { + } + + /** + * Get the code property: An identifier for the error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: An identifier for the error. + * + * @param code the code value to set. + * @return the ImageCreationErrorDetails object itself. + */ + public ImageCreationErrorDetails withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: A message describing the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: A message describing the error. + * + * @param message the message value to set. + * @return the ImageCreationErrorDetails object itself. + */ + public ImageCreationErrorDetails withMessage(String message) { + this.message = message; + 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("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageCreationErrorDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageCreationErrorDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageCreationErrorDetails. + */ + public static ImageCreationErrorDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageCreationErrorDetails deserializedImageCreationErrorDetails = new ImageCreationErrorDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedImageCreationErrorDetails.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedImageCreationErrorDetails.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageCreationErrorDetails; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinition.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinition.java new file mode 100644 index 000000000000..91bf040b21f6 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinition.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.devcenter.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner; +import java.util.List; + +/** + * An immutable client-side representation of ImageDefinition. + */ +public interface ImageDefinition { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the imageReference property: Image reference information. + * + * @return the imageReference value. + */ + ImageReference imageReference(); + + /** + * Gets the fileUrl property: The URL to the repository file containing the image definition. + * + * @return the fileUrl value. + */ + String fileUrl(); + + /** + * Gets the latestBuild property: Details about the latest build. + * + * @return the latestBuild value. + */ + LatestImageBuild latestBuild(); + + /** + * Gets the imageValidationStatus property: Validation status of the configured image. + * + * @return the imageValidationStatus value. + */ + ImageValidationStatus imageValidationStatus(); + + /** + * Gets the imageValidationErrorDetails property: Details for image validator error. Populated when the image + * validation is not successful. + * + * @return the imageValidationErrorDetails value. + */ + ImageValidationErrorDetails imageValidationErrorDetails(); + + /** + * Gets the validationStatus property: Validation status for the Image Definition. + * + * @return the validationStatus value. + */ + CatalogResourceValidationStatus validationStatus(); + + /** + * Gets the activeImageReference property: Image reference information for the currently active image (only + * populated during updates). + * + * @return the activeImageReference value. + */ + ImageReference activeImageReference(); + + /** + * Gets the autoImageBuild property: Indicates if automatic image builds will be triggered for image definition + * updates. + * + * @return the autoImageBuild value. + */ + AutoImageBuildStatus autoImageBuild(); + + /** + * Gets the tasks property: Tasks to run at Dev Box provisioning time. + * + * @return the tasks value. + */ + List tasks(); + + /** + * Gets the userTasks property: Tasks to run when a user first logs into a Dev Box. + * + * @return the userTasks value. + */ + List userTasks(); + + /** + * Gets the extendsProperty property: Another Image Definition that this one extends. + * + * @return the extendsProperty value. + */ + ImageDefinitionReference extendsProperty(); + + /** + * Gets the inner com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionInner object. + * + * @return the inner object. + */ + ImageDefinitionInner innerModel(); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuild.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuild.java new file mode 100644 index 000000000000..697f6141d0ef --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuild.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.devcenter.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of ImageDefinitionBuild. + */ +public interface ImageDefinitionBuild { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the imageReference property: The specific image version used by the build. + * + * @return the imageReference value. + */ + ImageReference imageReference(); + + /** + * Gets the status property: The status of the build. + * + * @return the status value. + */ + ImageDefinitionBuildStatus status(); + + /** + * Gets the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time of the task group. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the errorDetails property: Details for image creation error. Populated when the image creation is not + * successful. + * + * @return the errorDetails value. + */ + ImageCreationErrorDetails errorDetails(); + + /** + * Gets the inner com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildInner object. + * + * @return the inner object. + */ + ImageDefinitionBuildInner innerModel(); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildDetails.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildDetails.java new file mode 100644 index 000000000000..19ae9ddfa524 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildDetails.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.devcenter.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devcenter.fluent.models.ImageDefinitionBuildDetailsInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of ImageDefinitionBuildDetails. + */ +public interface ImageDefinitionBuildDetails { + /** + * 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 imageReference property: The specific image version used by the build. + * + * @return the imageReference value. + */ + ImageReference imageReference(); + + /** + * Gets the status property: The status of the build. + * + * @return the status value. + */ + ImageDefinitionBuildStatus status(); + + /** + * Gets the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time of the task group. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the errorDetails property: Details for image creation error. Populated when the image creation is not + * successful. + * + * @return the errorDetails value. + */ + ImageCreationErrorDetails errorDetails(); + + /** + * Gets the taskGroups property: The list of task groups executed during the image definition build. + * + * @return the taskGroups value. + */ + List taskGroups(); + + /** + * 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.devcenter.fluent.models.ImageDefinitionBuildDetailsInner object. + * + * @return the inner object. + */ + ImageDefinitionBuildDetailsInner innerModel(); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildListResult.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildListResult.java new file mode 100644 index 000000000000..eda66cf94bdd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildListResult.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.devcenter.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.devcenter.fluent.models.ImageDefinitionBuildInner; +import java.io.IOException; +import java.util.List; + +/** + * Results of the Image Definition Build list operation. + */ +@Immutable +public final class ImageDefinitionBuildListResult implements JsonSerializable { + /* + * Current page of results. + */ + private List value; + + /* + * URL to get the next set of results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ImageDefinitionBuildListResult class. + */ + public ImageDefinitionBuildListResult() { + } + + /** + * Get the value property: Current page of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of 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 ImageDefinitionBuildListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageDefinitionBuildListResult. + */ + public static ImageDefinitionBuildListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildListResult deserializedImageDefinitionBuildListResult + = new ImageDefinitionBuildListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ImageDefinitionBuildInner.fromJson(reader1)); + deserializedImageDefinitionBuildListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedImageDefinitionBuildListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildListResult; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildStatus.java new file mode 100644 index 000000000000..fbfd0e722325 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of an Image Definition Build. + */ +public final class ImageDefinitionBuildStatus extends ExpandableStringEnum { + /** + * Static value Succeeded for ImageDefinitionBuildStatus. + */ + public static final ImageDefinitionBuildStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Running for ImageDefinitionBuildStatus. + */ + public static final ImageDefinitionBuildStatus RUNNING = fromString("Running"); + + /** + * Static value ValidationFailed for ImageDefinitionBuildStatus. + */ + public static final ImageDefinitionBuildStatus VALIDATION_FAILED = fromString("ValidationFailed"); + + /** + * Static value Failed for ImageDefinitionBuildStatus. + */ + public static final ImageDefinitionBuildStatus FAILED = fromString("Failed"); + + /** + * Static value Cancelled for ImageDefinitionBuildStatus. + */ + public static final ImageDefinitionBuildStatus CANCELLED = fromString("Cancelled"); + + /** + * Static value TimedOut for ImageDefinitionBuildStatus. + */ + public static final ImageDefinitionBuildStatus TIMED_OUT = fromString("TimedOut"); + + /** + * Creates a new instance of ImageDefinitionBuildStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageDefinitionBuildStatus() { + } + + /** + * Creates or finds a ImageDefinitionBuildStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageDefinitionBuildStatus. + */ + public static ImageDefinitionBuildStatus fromString(String name) { + return fromString(name, ImageDefinitionBuildStatus.class); + } + + /** + * Gets known ImageDefinitionBuildStatus values. + * + * @return known ImageDefinitionBuildStatus values. + */ + public static Collection values() { + return values(ImageDefinitionBuildStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTask.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTask.java new file mode 100644 index 000000000000..ee060cf6fdfb --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTask.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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.util.List; + +/** + * A task executed during the image definition build. + */ +@Fluent +public final class ImageDefinitionBuildTask implements JsonSerializable { + /* + * The name of the task. + */ + private String name; + + /* + * Parameters for the task. + */ + private List parameters; + + /* + * Display name to help differentiate multiple instances of the same task. + */ + private String displayName; + + /* + * ID of the task instance. + */ + private String id; + + /* + * Start time of the task. + */ + private OffsetDateTime startTime; + + /* + * End time of the task. + */ + private OffsetDateTime endTime; + + /* + * The status of the task. + */ + private ImageDefinitionBuildStatus status; + + /* + * The URI for retrieving logs for the task execution. + */ + private String logUri; + + /** + * Creates an instance of ImageDefinitionBuildTask class. + */ + public ImageDefinitionBuildTask() { + } + + /** + * Get the name property: The name of the task. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the task. + * + * @param name the name value to set. + * @return the ImageDefinitionBuildTask object itself. + */ + public ImageDefinitionBuildTask withName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameters property: Parameters for the task. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters for the task. + * + * @param parameters the parameters value to set. + * @return the ImageDefinitionBuildTask object itself. + */ + public ImageDefinitionBuildTask withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the displayName property: Display name to help differentiate multiple instances of the same task. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name to help differentiate multiple instances of the same task. + * + * @param displayName the displayName value to set. + * @return the ImageDefinitionBuildTask object itself. + */ + public ImageDefinitionBuildTask withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the id property: ID of the task instance. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the startTime property: Start time of the task. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the task. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the status property: The status of the task. + * + * @return the status value. + */ + public ImageDefinitionBuildStatus status() { + return this.status; + } + + /** + * Get the logUri property: The URI for retrieving logs for the task execution. + * + * @return the logUri value. + */ + public String logUri() { + return this.logUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionBuildTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildTask if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageDefinitionBuildTask. + */ + public static ImageDefinitionBuildTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildTask deserializedImageDefinitionBuildTask = new ImageDefinitionBuildTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedImageDefinitionBuildTask.name = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> ImageDefinitionBuildTaskParametersItem.fromJson(reader1)); + deserializedImageDefinitionBuildTask.parameters = parameters; + } else if ("displayName".equals(fieldName)) { + deserializedImageDefinitionBuildTask.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedImageDefinitionBuildTask.id = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedImageDefinitionBuildTask.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedImageDefinitionBuildTask.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedImageDefinitionBuildTask.status + = ImageDefinitionBuildStatus.fromString(reader.getString()); + } else if ("logUri".equals(fieldName)) { + deserializedImageDefinitionBuildTask.logUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildTask; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTaskGroup.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTaskGroup.java new file mode 100644 index 000000000000..8825a9f05e56 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTaskGroup.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.devcenter.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * A task group executed during the image definition build. + */ +@Immutable +public final class ImageDefinitionBuildTaskGroup implements JsonSerializable { + /* + * The name of the task group. + */ + private String name; + + /* + * The status of the task group. + */ + private ImageDefinitionBuildStatus status; + + /* + * Start time of the task group. + */ + private OffsetDateTime startTime; + + /* + * End time of the task group. + */ + private OffsetDateTime endTime; + + /* + * The list of tasks executed during the task group. + */ + private List tasks; + + /** + * Creates an instance of ImageDefinitionBuildTaskGroup class. + */ + public ImageDefinitionBuildTaskGroup() { + } + + /** + * Get the name property: The name of the task group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: The status of the task group. + * + * @return the status value. + */ + public ImageDefinitionBuildStatus status() { + return this.status; + } + + /** + * Get the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the task group. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the tasks property: The list of tasks executed during the task group. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasks() != null) { + tasks().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionBuildTaskGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildTaskGroup if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageDefinitionBuildTaskGroup. + */ + public static ImageDefinitionBuildTaskGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildTaskGroup deserializedImageDefinitionBuildTaskGroup + = new ImageDefinitionBuildTaskGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedImageDefinitionBuildTaskGroup.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedImageDefinitionBuildTaskGroup.status + = ImageDefinitionBuildStatus.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedImageDefinitionBuildTaskGroup.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedImageDefinitionBuildTaskGroup.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> ImageDefinitionBuildTask.fromJson(reader1)); + deserializedImageDefinitionBuildTaskGroup.tasks = tasks; + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildTaskGroup; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTaskParametersItem.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTaskParametersItem.java new file mode 100644 index 000000000000..0a62ccf60f11 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionBuildTaskParametersItem.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.devcenter.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 ImageDefinitionBuildTaskParametersItem model. + */ +@Fluent +public final class ImageDefinitionBuildTaskParametersItem + implements JsonSerializable { + /* + * The key property. + */ + private String key; + + /* + * The value property. + */ + private String value; + + /** + * Creates an instance of ImageDefinitionBuildTaskParametersItem class. + */ + public ImageDefinitionBuildTaskParametersItem() { + } + + /** + * 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 ImageDefinitionBuildTaskParametersItem object itself. + */ + public ImageDefinitionBuildTaskParametersItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ImageDefinitionBuildTaskParametersItem object itself. + */ + public ImageDefinitionBuildTaskParametersItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (key() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property key in model ImageDefinitionBuildTaskParametersItem")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ImageDefinitionBuildTaskParametersItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageDefinitionBuildTaskParametersItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionBuildTaskParametersItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionBuildTaskParametersItem 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 ImageDefinitionBuildTaskParametersItem. + */ + public static ImageDefinitionBuildTaskParametersItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionBuildTaskParametersItem deserializedImageDefinitionBuildTaskParametersItem + = new ImageDefinitionBuildTaskParametersItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedImageDefinitionBuildTaskParametersItem.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedImageDefinitionBuildTaskParametersItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionBuildTaskParametersItem; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionListResult.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionListResult.java new file mode 100644 index 000000000000..a4bcf9cc34ee --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionListResult.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.devcenter.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.devcenter.fluent.models.ImageDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * Results of the Image Definition list operation. + */ +@Immutable +public final class ImageDefinitionListResult implements JsonSerializable { + /* + * Current page of results. + */ + private List value; + + /* + * URL to get the next set of results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ImageDefinitionListResult class. + */ + public ImageDefinitionListResult() { + } + + /** + * Get the value property: Current page of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of 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 ImageDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageDefinitionListResult. + */ + public static ImageDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionListResult deserializedImageDefinitionListResult = new ImageDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ImageDefinitionInner.fromJson(reader1)); + deserializedImageDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedImageDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionListResult; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionReference.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionReference.java new file mode 100644 index 000000000000..fdd8d04e8492 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageDefinitionReference.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.devcenter.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; + +/** + * A reference to an Image Definition. + */ +@Fluent +public final class ImageDefinitionReference implements JsonSerializable { + /* + * Name of the referenced Image Definition. + */ + private String imageDefinition; + + /* + * Parameters for the referenced Image Definition. + */ + private List parameters; + + /** + * Creates an instance of ImageDefinitionReference class. + */ + public ImageDefinitionReference() { + } + + /** + * Get the imageDefinition property: Name of the referenced Image Definition. + * + * @return the imageDefinition value. + */ + public String imageDefinition() { + return this.imageDefinition; + } + + /** + * Set the imageDefinition property: Name of the referenced Image Definition. + * + * @param imageDefinition the imageDefinition value to set. + * @return the ImageDefinitionReference object itself. + */ + public ImageDefinitionReference withImageDefinition(String imageDefinition) { + this.imageDefinition = imageDefinition; + return this; + } + + /** + * Get the parameters property: Parameters for the referenced Image Definition. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters for the referenced Image Definition. + * + * @param parameters the parameters value to set. + * @return the ImageDefinitionReference object itself. + */ + public ImageDefinitionReference withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageDefinition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property imageDefinition in model ImageDefinitionReference")); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageDefinitionReference.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("imageDefinition", this.imageDefinition); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDefinitionReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDefinitionReference 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 ImageDefinitionReference. + */ + public static ImageDefinitionReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDefinitionReference deserializedImageDefinitionReference = new ImageDefinitionReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageDefinition".equals(fieldName)) { + deserializedImageDefinitionReference.imageDefinition = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> DefinitionParametersItem.fromJson(reader1)); + deserializedImageDefinitionReference.parameters = parameters; + } else { + reader.skipChildren(); + } + } + + return deserializedImageDefinitionReference; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageVersions.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageVersions.java index 1463bf9fa966..1507f743b824 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageVersions.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ImageVersions.java @@ -75,4 +75,62 @@ Response getWithResponse(String resourceGroupName, String devCente */ ImageVersion get(String resourceGroupName, String devCenterName, String galleryName, String imageName, String versionName); + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProject(String resourceGroupName, String projectName, String imageName); + + /** + * Lists versions for an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image version list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProject(String resourceGroupName, String projectName, String imageName, + Context context); + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image version along with {@link Response}. + */ + Response getByProjectWithResponse(String resourceGroupName, String projectName, String imageName, + String versionName, Context context); + + /** + * Gets an image version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image version. + */ + ImageVersion getByProject(String resourceGroupName, String projectName, String imageName, String versionName); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Images.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Images.java index 7e285dc0cafb..43b416fe14f3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Images.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Images.java @@ -96,4 +96,57 @@ Response getWithResponse(String resourceGroupName, String devCenterName, * @return a gallery image. */ Image get(String resourceGroupName, String devCenterName, String galleryName, String imageName); + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProject(String resourceGroupName, String projectName); + + /** + * Lists images for a project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the image list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProject(String resourceGroupName, String projectName, Context context); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image along with {@link Response}. + */ + Response getByProjectWithResponse(String resourceGroupName, String projectName, String imageName, + Context context); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 image. + */ + Image getByProject(String resourceGroupName, String projectName, String imageName); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/InheritedSettingsForProject.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/InheritedSettingsForProject.java new file mode 100644 index 000000000000..8cef689ed5ed --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/InheritedSettingsForProject.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.models; + +import com.azure.resourcemanager.devcenter.fluent.models.InheritedSettingsForProjectInner; + +/** + * An immutable client-side representation of InheritedSettingsForProject. + */ +public interface InheritedSettingsForProject { + /** + * Gets the projectCatalogSettings property: Dev Center settings to be used when associating a project with a + * catalog. + * + * @return the projectCatalogSettings value. + */ + DevCenterProjectCatalogSettings projectCatalogSettings(); + + /** + * Gets the networkSettings property: Network settings that will be enforced on this project. + * + * @return the networkSettings value. + */ + ProjectNetworkSettings networkSettings(); + + /** + * Gets the inner com.azure.resourcemanager.devcenter.fluent.models.InheritedSettingsForProjectInner object. + * + * @return the inner object. + */ + InheritedSettingsForProjectInner innerModel(); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/InstallAzureMonitorAgentEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/InstallAzureMonitorAgentEnableStatus.java new file mode 100644 index 000000000000..e104fdceb1c8 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/InstallAzureMonitorAgentEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Setting to be used when determining whether to install the Azure Monitor Agent service on Dev Boxes that belong to + * this dev center. + */ +public final class InstallAzureMonitorAgentEnableStatus + extends ExpandableStringEnum { + /** + * Static value Enabled for InstallAzureMonitorAgentEnableStatus. + */ + public static final InstallAzureMonitorAgentEnableStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for InstallAzureMonitorAgentEnableStatus. + */ + public static final InstallAzureMonitorAgentEnableStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of InstallAzureMonitorAgentEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstallAzureMonitorAgentEnableStatus() { + } + + /** + * Creates or finds a InstallAzureMonitorAgentEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstallAzureMonitorAgentEnableStatus. + */ + public static InstallAzureMonitorAgentEnableStatus fromString(String name) { + return fromString(name, InstallAzureMonitorAgentEnableStatus.class); + } + + /** + * Gets known InstallAzureMonitorAgentEnableStatus values. + * + * @return known InstallAzureMonitorAgentEnableStatus values. + */ + public static Collection values() { + return values(InstallAzureMonitorAgentEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/KeepAwakeEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/KeepAwakeEnableStatus.java new file mode 100644 index 000000000000..b9782f841a94 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/KeepAwakeEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enables or disables whether Dev Boxes should be kept awake during active hours. + */ +public final class KeepAwakeEnableStatus extends ExpandableStringEnum { + /** + * Static value Enabled for KeepAwakeEnableStatus. + */ + public static final KeepAwakeEnableStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for KeepAwakeEnableStatus. + */ + public static final KeepAwakeEnableStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of KeepAwakeEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeepAwakeEnableStatus() { + } + + /** + * Creates or finds a KeepAwakeEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeepAwakeEnableStatus. + */ + public static KeepAwakeEnableStatus fromString(String name) { + return fromString(name, KeepAwakeEnableStatus.class); + } + + /** + * Gets known KeepAwakeEnableStatus values. + * + * @return known KeepAwakeEnableStatus values. + */ + public static Collection values() { + return values(KeepAwakeEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/LatestImageBuild.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/LatestImageBuild.java new file mode 100644 index 000000000000..8ea5b2e3532b --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/LatestImageBuild.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.devcenter.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * Details about the latest build. + */ +@Immutable +public final class LatestImageBuild implements JsonSerializable { + /* + * Identifier of a build. + */ + private String name; + + /* + * Start time of the task group. + */ + private OffsetDateTime startTime; + + /* + * End time of the task group. + */ + private OffsetDateTime endTime; + + /* + * The state of an Image Definition Build. + */ + private ImageDefinitionBuildStatus status; + + /** + * Creates an instance of LatestImageBuild class. + */ + public LatestImageBuild() { + } + + /** + * Get the name property: Identifier of a build. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the startTime property: Start time of the task group. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the task group. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the status property: The state of an Image Definition Build. + * + * @return the status value. + */ + public ImageDefinitionBuildStatus status() { + return this.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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LatestImageBuild from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LatestImageBuild if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LatestImageBuild. + */ + public static LatestImageBuild fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LatestImageBuild deserializedLatestImageBuild = new LatestImageBuild(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLatestImageBuild.name = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedLatestImageBuild.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedLatestImageBuild.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedLatestImageBuild.status = ImageDefinitionBuildStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLatestImageBuild; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/MicrosoftHostedNetworkEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/MicrosoftHostedNetworkEnableStatus.java new file mode 100644 index 000000000000..939a659eeeb9 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/MicrosoftHostedNetworkEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether pools in this Dev Center can use Microsoft Hosted Networks. Defaults to Enabled if not set. + */ +public final class MicrosoftHostedNetworkEnableStatus extends ExpandableStringEnum { + /** + * Static value Enabled for MicrosoftHostedNetworkEnableStatus. + */ + public static final MicrosoftHostedNetworkEnableStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for MicrosoftHostedNetworkEnableStatus. + */ + public static final MicrosoftHostedNetworkEnableStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of MicrosoftHostedNetworkEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MicrosoftHostedNetworkEnableStatus() { + } + + /** + * Creates or finds a MicrosoftHostedNetworkEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MicrosoftHostedNetworkEnableStatus. + */ + public static MicrosoftHostedNetworkEnableStatus fromString(String name) { + return fromString(name, MicrosoftHostedNetworkEnableStatus.class); + } + + /** + * Gets known MicrosoftHostedNetworkEnableStatus values. + * + * @return known MicrosoftHostedNetworkEnableStatus values. + */ + public static Collection values() { + return values(MicrosoftHostedNetworkEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PolicyAction.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PolicyAction.java new file mode 100644 index 000000000000..9813927fe295 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PolicyAction.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates what action to perform for the policy. + */ +public final class PolicyAction extends ExpandableStringEnum { + /** + * Static value Allow for PolicyAction. + */ + public static final PolicyAction ALLOW = fromString("Allow"); + + /** + * Static value Deny for PolicyAction. + */ + public static final PolicyAction DENY = fromString("Deny"); + + /** + * Creates a new instance of PolicyAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyAction() { + } + + /** + * Creates or finds a PolicyAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyAction. + */ + public static PolicyAction fromString(String name) { + return fromString(name, PolicyAction.class); + } + + /** + * Gets known PolicyAction values. + * + * @return known PolicyAction values. + */ + public static Collection values() { + return values(PolicyAction.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Pool.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Pool.java index 104d038e2ff3..579af5df626e 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Pool.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Pool.java @@ -88,12 +88,29 @@ public interface Pool { ProvisioningState provisioningState(); /** - * Gets the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Gets the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or + * if one is provided directly. + * + * @return the devBoxDefinitionType value. + */ + PoolDevBoxDefinitionType devBoxDefinitionType(); + + /** + * Gets the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @return the devBoxDefinitionName value. */ String devBoxDefinitionName(); + /** + * Gets the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @return the devBoxDefinition value. + */ + PoolDevBoxDefinition devBoxDefinition(); + /** * Gets the networkConnectionName property: Name of a Network Connection in parent Project of this Pool. * @@ -124,6 +141,13 @@ public interface Pool { */ StopOnDisconnectConfiguration stopOnDisconnect(); + /** + * Gets the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @return the stopOnNoConnect value. + */ + StopOnNoConnectConfiguration stopOnNoConnect(); + /** * Gets the singleSignOnStatus property: Indicates whether Dev Boxes in this pool are created with single sign on * enabled. The also requires that single sign on be enabled on the tenant. @@ -155,6 +179,21 @@ public interface Pool { */ List managedVirtualNetworkRegions(); + /** + * Gets the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @return the activeHoursConfiguration value. + */ + ActiveHoursConfiguration activeHoursConfiguration(); + + /** + * Gets the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @return the devBoxTunnelEnableStatus value. + */ + DevBoxTunnelEnableStatus devBoxTunnelEnableStatus(); + /** * Gets the region of the resource. * @@ -239,11 +278,14 @@ interface WithParentResource { * The stage of the Pool 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.WithDevBoxDefinitionName, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDevBoxDefinitionType, + DefinitionStages.WithDevBoxDefinitionName, DefinitionStages.WithDevBoxDefinition, DefinitionStages.WithNetworkConnectionName, DefinitionStages.WithLicenseType, DefinitionStages.WithLocalAdministrator, DefinitionStages.WithStopOnDisconnect, - DefinitionStages.WithSingleSignOnStatus, DefinitionStages.WithDisplayName, - DefinitionStages.WithVirtualNetworkType, DefinitionStages.WithManagedVirtualNetworkRegions { + DefinitionStages.WithStopOnNoConnect, DefinitionStages.WithSingleSignOnStatus, + DefinitionStages.WithDisplayName, DefinitionStages.WithVirtualNetworkType, + DefinitionStages.WithManagedVirtualNetworkRegions, DefinitionStages.WithActiveHoursConfiguration, + DefinitionStages.WithDevBoxTunnelEnableStatus { /** * Executes the create request. * @@ -273,19 +315,51 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the Pool definition allowing to specify devBoxDefinitionType. + */ + interface WithDevBoxDefinitionType { + /** + * Specifies the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box + * Definition or if one is provided directly.. + * + * @param devBoxDefinitionType Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * @return the next definition stage. + */ + WithCreate withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType); + } + /** * The stage of the Pool definition allowing to specify devBoxDefinitionName. */ interface WithDevBoxDefinitionName { /** * Specifies the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Will be ignored if devBoxDefinitionType is Value.. * - * @param devBoxDefinitionName Name of a Dev Box definition in parent Project of this Pool. + * @param devBoxDefinitionName Name of a Dev Box definition in parent Project of this Pool. Will be ignored + * if devBoxDefinitionType is Value. * @return the next definition stage. */ WithCreate withDevBoxDefinitionName(String devBoxDefinitionName); } + /** + * The stage of the Pool definition allowing to specify devBoxDefinition. + */ + interface WithDevBoxDefinition { + /** + * Specifies the devBoxDefinition property: A definition of the machines that are created from this Pool. + * Will be ignored if devBoxDefinitionType is Reference or not provided.. + * + * @param devBoxDefinition A definition of the machines that are created from this Pool. Will be ignored if + * devBoxDefinitionType is Reference or not provided. + * @return the next definition stage. + */ + WithCreate withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition); + } + /** * The stage of the Pool definition allowing to specify networkConnectionName. */ @@ -344,6 +418,20 @@ interface WithStopOnDisconnect { WithCreate withStopOnDisconnect(StopOnDisconnectConfiguration stopOnDisconnect); } + /** + * The stage of the Pool definition allowing to specify stopOnNoConnect. + */ + interface WithStopOnNoConnect { + /** + * Specifies the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created + * in this pool.. + * + * @param stopOnNoConnect Stop on no connect configuration settings for Dev Boxes created in this pool. + * @return the next definition stage. + */ + WithCreate withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect); + } + /** * The stage of the Pool definition allowing to specify singleSignOnStatus. */ @@ -401,6 +489,34 @@ interface WithManagedVirtualNetworkRegions { */ WithCreate withManagedVirtualNetworkRegions(List managedVirtualNetworkRegions); } + + /** + * The stage of the Pool definition allowing to specify activeHoursConfiguration. + */ + interface WithActiveHoursConfiguration { + /** + * Specifies the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes + * created in this pool.. + * + * @param activeHoursConfiguration Active hours configuration settings for Dev Boxes created in this pool. + * @return the next definition stage. + */ + WithCreate withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration); + } + + /** + * The stage of the Pool definition allowing to specify devBoxTunnelEnableStatus. + */ + interface WithDevBoxTunnelEnableStatus { + /** + * Specifies the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the + * pool.. + * + * @param devBoxTunnelEnableStatus Indicates whether Dev Box Tunnel is enabled for a the pool. + * @return the next definition stage. + */ + WithCreate withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus); + } } /** @@ -413,10 +529,13 @@ interface WithManagedVirtualNetworkRegions { /** * The template for Pool update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDevBoxDefinitionName, - UpdateStages.WithNetworkConnectionName, UpdateStages.WithLicenseType, UpdateStages.WithLocalAdministrator, - UpdateStages.WithStopOnDisconnect, UpdateStages.WithSingleSignOnStatus, UpdateStages.WithDisplayName, - UpdateStages.WithVirtualNetworkType, UpdateStages.WithManagedVirtualNetworkRegions { + interface Update + extends UpdateStages.WithTags, UpdateStages.WithDevBoxDefinitionType, UpdateStages.WithDevBoxDefinitionName, + UpdateStages.WithDevBoxDefinition, UpdateStages.WithNetworkConnectionName, UpdateStages.WithLicenseType, + UpdateStages.WithLocalAdministrator, UpdateStages.WithStopOnDisconnect, UpdateStages.WithStopOnNoConnect, + UpdateStages.WithSingleSignOnStatus, UpdateStages.WithDisplayName, UpdateStages.WithVirtualNetworkType, + UpdateStages.WithManagedVirtualNetworkRegions, UpdateStages.WithActiveHoursConfiguration, + UpdateStages.WithDevBoxTunnelEnableStatus { /** * Executes the update request. * @@ -450,19 +569,51 @@ interface WithTags { Update withTags(Map tags); } + /** + * The stage of the Pool update allowing to specify devBoxDefinitionType. + */ + interface WithDevBoxDefinitionType { + /** + * Specifies the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box + * Definition or if one is provided directly.. + * + * @param devBoxDefinitionType Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * @return the next definition stage. + */ + Update withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType); + } + /** * The stage of the Pool update allowing to specify devBoxDefinitionName. */ interface WithDevBoxDefinitionName { /** * Specifies the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Will be ignored if devBoxDefinitionType is Value.. * - * @param devBoxDefinitionName Name of a Dev Box definition in parent Project of this Pool. + * @param devBoxDefinitionName Name of a Dev Box definition in parent Project of this Pool. Will be ignored + * if devBoxDefinitionType is Value. * @return the next definition stage. */ Update withDevBoxDefinitionName(String devBoxDefinitionName); } + /** + * The stage of the Pool update allowing to specify devBoxDefinition. + */ + interface WithDevBoxDefinition { + /** + * Specifies the devBoxDefinition property: A definition of the machines that are created from this Pool. + * Will be ignored if devBoxDefinitionType is Reference or not provided.. + * + * @param devBoxDefinition A definition of the machines that are created from this Pool. Will be ignored if + * devBoxDefinitionType is Reference or not provided. + * @return the next definition stage. + */ + Update withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition); + } + /** * The stage of the Pool update allowing to specify networkConnectionName. */ @@ -521,6 +672,20 @@ interface WithStopOnDisconnect { Update withStopOnDisconnect(StopOnDisconnectConfiguration stopOnDisconnect); } + /** + * The stage of the Pool update allowing to specify stopOnNoConnect. + */ + interface WithStopOnNoConnect { + /** + * Specifies the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created + * in this pool.. + * + * @param stopOnNoConnect Stop on no connect configuration settings for Dev Boxes created in this pool. + * @return the next definition stage. + */ + Update withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect); + } + /** * The stage of the Pool update allowing to specify singleSignOnStatus. */ @@ -578,6 +743,34 @@ interface WithManagedVirtualNetworkRegions { */ Update withManagedVirtualNetworkRegions(List managedVirtualNetworkRegions); } + + /** + * The stage of the Pool update allowing to specify activeHoursConfiguration. + */ + interface WithActiveHoursConfiguration { + /** + * Specifies the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes + * created in this pool.. + * + * @param activeHoursConfiguration Active hours configuration settings for Dev Boxes created in this pool. + * @return the next definition stage. + */ + Update withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration); + } + + /** + * The stage of the Pool update allowing to specify devBoxTunnelEnableStatus. + */ + interface WithDevBoxTunnelEnableStatus { + /** + * Specifies the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the + * pool.. + * + * @param devBoxTunnelEnableStatus Indicates whether Dev Box Tunnel is enabled for a the pool. + * @return the next definition stage. + */ + Update withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus); + } } /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolDevBoxDefinition.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolDevBoxDefinition.java new file mode 100644 index 000000000000..013b427b5d0e --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolDevBoxDefinition.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.devcenter.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; + +/** + * Represents a definition for a Developer Machine. + */ +@Fluent +public final class PoolDevBoxDefinition implements JsonSerializable { + /* + * Image reference information. + */ + private ImageReference imageReference; + + /* + * The SKU for Dev Boxes created from the Pool. + */ + private Sku sku; + + /* + * Image reference information for the currently active image (only populated during updates). + */ + private ImageReference activeImageReference; + + /** + * Creates an instance of PoolDevBoxDefinition class. + */ + public PoolDevBoxDefinition() { + } + + /** + * Get the imageReference property: Image reference information. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Image reference information. + * + * @param imageReference the imageReference value to set. + * @return the PoolDevBoxDefinition object itself. + */ + public PoolDevBoxDefinition withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the sku property: The SKU for Dev Boxes created from the Pool. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU for Dev Boxes created from the Pool. + * + * @param sku the sku value to set. + * @return the PoolDevBoxDefinition object itself. + */ + public PoolDevBoxDefinition withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the activeImageReference property: Image reference information for the currently active image (only populated + * during updates). + * + * @return the activeImageReference value. + */ + public ImageReference activeImageReference() { + return this.activeImageReference; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (activeImageReference() != null) { + activeImageReference().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("imageReference", this.imageReference); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PoolDevBoxDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PoolDevBoxDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PoolDevBoxDefinition. + */ + public static PoolDevBoxDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PoolDevBoxDefinition deserializedPoolDevBoxDefinition = new PoolDevBoxDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageReference".equals(fieldName)) { + deserializedPoolDevBoxDefinition.imageReference = ImageReference.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedPoolDevBoxDefinition.sku = Sku.fromJson(reader); + } else if ("activeImageReference".equals(fieldName)) { + deserializedPoolDevBoxDefinition.activeImageReference = ImageReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPoolDevBoxDefinition; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolDevBoxDefinitionType.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolDevBoxDefinitionType.java new file mode 100644 index 000000000000..7e00709e602a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolDevBoxDefinitionType.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates if the pool is created from an existing Dev Box Definition or if one is provided directly. + */ +public final class PoolDevBoxDefinitionType extends ExpandableStringEnum { + /** + * Static value Reference for PoolDevBoxDefinitionType. + */ + public static final PoolDevBoxDefinitionType REFERENCE = fromString("Reference"); + + /** + * Static value Value for PoolDevBoxDefinitionType. + */ + public static final PoolDevBoxDefinitionType VALUE = fromString("Value"); + + /** + * Creates a new instance of PoolDevBoxDefinitionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PoolDevBoxDefinitionType() { + } + + /** + * Creates or finds a PoolDevBoxDefinitionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PoolDevBoxDefinitionType. + */ + public static PoolDevBoxDefinitionType fromString(String name) { + return fromString(name, PoolDevBoxDefinitionType.class); + } + + /** + * Gets known PoolDevBoxDefinitionType values. + * + * @return known PoolDevBoxDefinitionType values. + */ + public static Collection values() { + return values(PoolDevBoxDefinitionType.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolUpdate.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolUpdate.java index a980e8294c1e..fa9d5962f038 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolUpdate.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/PoolUpdate.java @@ -57,7 +57,33 @@ public PoolUpdate withLocation(String location) { } /** - * Get the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Get the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * + * @return the devBoxDefinitionType value. + */ + public PoolDevBoxDefinitionType devBoxDefinitionType() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxDefinitionType(); + } + + /** + * Set the devBoxDefinitionType property: Indicates if the pool is created from an existing Dev Box Definition or if + * one is provided directly. + * + * @param devBoxDefinitionType the devBoxDefinitionType value to set. + * @return the PoolUpdate object itself. + */ + public PoolUpdate withDevBoxDefinitionType(PoolDevBoxDefinitionType devBoxDefinitionType) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolUpdateProperties(); + } + this.innerProperties().withDevBoxDefinitionType(devBoxDefinitionType); + return this; + } + + /** + * Get the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @return the devBoxDefinitionName value. */ @@ -66,7 +92,8 @@ public String devBoxDefinitionName() { } /** - * Set the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. + * Set the devBoxDefinitionName property: Name of a Dev Box definition in parent Project of this Pool. Will be + * ignored if devBoxDefinitionType is Value. * * @param devBoxDefinitionName the devBoxDefinitionName value to set. * @return the PoolUpdate object itself. @@ -79,6 +106,31 @@ public PoolUpdate withDevBoxDefinitionName(String devBoxDefinitionName) { return this; } + /** + * Get the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @return the devBoxDefinition value. + */ + public PoolDevBoxDefinition devBoxDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxDefinition(); + } + + /** + * Set the devBoxDefinition property: A definition of the machines that are created from this Pool. Will be ignored + * if devBoxDefinitionType is Reference or not provided. + * + * @param devBoxDefinition the devBoxDefinition value to set. + * @return the PoolUpdate object itself. + */ + public PoolUpdate withDevBoxDefinition(PoolDevBoxDefinition devBoxDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolUpdateProperties(); + } + this.innerProperties().withDevBoxDefinition(devBoxDefinition); + return this; + } + /** * Get the networkConnectionName property: Name of a Network Connection in parent Project of this Pool. * @@ -175,6 +227,29 @@ public PoolUpdate withStopOnDisconnect(StopOnDisconnectConfiguration stopOnDisco return this; } + /** + * Get the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @return the stopOnNoConnect value. + */ + public StopOnNoConnectConfiguration stopOnNoConnect() { + return this.innerProperties() == null ? null : this.innerProperties().stopOnNoConnect(); + } + + /** + * Set the stopOnNoConnect property: Stop on no connect configuration settings for Dev Boxes created in this pool. + * + * @param stopOnNoConnect the stopOnNoConnect value to set. + * @return the PoolUpdate object itself. + */ + public PoolUpdate withStopOnNoConnect(StopOnNoConnectConfiguration stopOnNoConnect) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolUpdateProperties(); + } + this.innerProperties().withStopOnNoConnect(stopOnNoConnect); + return this; + } + /** * Get the singleSignOnStatus property: Indicates whether Dev Boxes in this pool are created with single sign on * enabled. The also requires that single sign on be enabled on the tenant. @@ -273,6 +348,54 @@ public PoolUpdate withManagedVirtualNetworkRegions(List managedVirtualNe return this; } + /** + * Get the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @return the activeHoursConfiguration value. + */ + public ActiveHoursConfiguration activeHoursConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().activeHoursConfiguration(); + } + + /** + * Set the activeHoursConfiguration property: Active hours configuration settings for Dev Boxes created in this + * pool. + * + * @param activeHoursConfiguration the activeHoursConfiguration value to set. + * @return the PoolUpdate object itself. + */ + public PoolUpdate withActiveHoursConfiguration(ActiveHoursConfiguration activeHoursConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolUpdateProperties(); + } + this.innerProperties().withActiveHoursConfiguration(activeHoursConfiguration); + return this; + } + + /** + * Get the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @return the devBoxTunnelEnableStatus value. + */ + public DevBoxTunnelEnableStatus devBoxTunnelEnableStatus() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxTunnelEnableStatus(); + } + + /** + * Set the devBoxTunnelEnableStatus property: Indicates whether Dev Box Tunnel is enabled for a the pool. + * + * @param devBoxTunnelEnableStatus the devBoxTunnelEnableStatus value to set. + * @return the PoolUpdate object itself. + */ + public PoolUpdate withDevBoxTunnelEnableStatus(DevBoxTunnelEnableStatus devBoxTunnelEnableStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolUpdateProperties(); + } + this.innerProperties().withDevBoxTunnelEnableStatus(devBoxTunnelEnableStatus); + return this; + } + /** * Validates the instance. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Project.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Project.java index 6dd4b7b7ddaf..6aa8176b5006 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Project.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Project.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.devcenter.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; @@ -113,6 +114,41 @@ public interface Project { */ ProjectCatalogSettings catalogSettings(); + /** + * Gets the customizationSettings property: Settings to be used for customizations. + * + * @return the customizationSettings value. + */ + ProjectCustomizationSettings customizationSettings(); + + /** + * Gets the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings. + * + * @return the devBoxAutoDeleteSettings value. + */ + DevBoxAutoDeleteSettings devBoxAutoDeleteSettings(); + + /** + * Gets the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a project. + * + * @return the azureAiServicesSettings value. + */ + AzureAiServicesSettings azureAiServicesSettings(); + + /** + * Gets the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU. + * + * @return the serverlessGpuSessionsSettings value. + */ + ServerlessGpuSessionsSettings serverlessGpuSessionsSettings(); + + /** + * Gets the workspaceStorageSettings property: Settings to be used for workspace storage. + * + * @return the workspaceStorageSettings value. + */ + WorkspaceStorageSettings workspaceStorageSettings(); + /** * Gets the region of the resource. * @@ -196,9 +232,12 @@ interface WithResourceGroup { * The stage of the Project 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.WithDevCenterId, DefinitionStages.WithDescription, DefinitionStages.WithMaxDevBoxesPerUser, - DefinitionStages.WithDisplayName, DefinitionStages.WithCatalogSettings { + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithDevCenterId, + DefinitionStages.WithDescription, DefinitionStages.WithMaxDevBoxesPerUser, DefinitionStages.WithDisplayName, + DefinitionStages.WithCatalogSettings, DefinitionStages.WithCustomizationSettings, + DefinitionStages.WithDevBoxAutoDeleteSettings, DefinitionStages.WithAzureAiServicesSettings, + DefinitionStages.WithServerlessGpuSessionsSettings, DefinitionStages.WithWorkspaceStorageSettings { /** * Executes the create request. * @@ -308,6 +347,72 @@ interface WithCatalogSettings { */ WithCreate withCatalogSettings(ProjectCatalogSettings catalogSettings); } + + /** + * The stage of the Project definition allowing to specify customizationSettings. + */ + interface WithCustomizationSettings { + /** + * Specifies the customizationSettings property: Settings to be used for customizations.. + * + * @param customizationSettings Settings to be used for customizations. + * @return the next definition stage. + */ + WithCreate withCustomizationSettings(ProjectCustomizationSettings customizationSettings); + } + + /** + * The stage of the Project definition allowing to specify devBoxAutoDeleteSettings. + */ + interface WithDevBoxAutoDeleteSettings { + /** + * Specifies the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings.. + * + * @param devBoxAutoDeleteSettings Dev Box Auto Delete settings. + * @return the next definition stage. + */ + WithCreate withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings devBoxAutoDeleteSettings); + } + + /** + * The stage of the Project definition allowing to specify azureAiServicesSettings. + */ + interface WithAzureAiServicesSettings { + /** + * Specifies the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a + * project.. + * + * @param azureAiServicesSettings Indicates whether Azure AI services are enabled for a project. + * @return the next definition stage. + */ + WithCreate withAzureAiServicesSettings(AzureAiServicesSettings azureAiServicesSettings); + } + + /** + * The stage of the Project definition allowing to specify serverlessGpuSessionsSettings. + */ + interface WithServerlessGpuSessionsSettings { + /** + * Specifies the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU.. + * + * @param serverlessGpuSessionsSettings Settings to be used for serverless GPU. + * @return the next definition stage. + */ + WithCreate withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings serverlessGpuSessionsSettings); + } + + /** + * The stage of the Project definition allowing to specify workspaceStorageSettings. + */ + interface WithWorkspaceStorageSettings { + /** + * Specifies the workspaceStorageSettings property: Settings to be used for workspace storage.. + * + * @param workspaceStorageSettings Settings to be used for workspace storage. + * @return the next definition stage. + */ + WithCreate withWorkspaceStorageSettings(WorkspaceStorageSettings workspaceStorageSettings); + } } /** @@ -322,7 +427,9 @@ interface WithCatalogSettings { */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithDevCenterId, UpdateStages.WithDescription, UpdateStages.WithMaxDevBoxesPerUser, UpdateStages.WithDisplayName, - UpdateStages.WithCatalogSettings { + UpdateStages.WithCatalogSettings, UpdateStages.WithCustomizationSettings, + UpdateStages.WithDevBoxAutoDeleteSettings, UpdateStages.WithAzureAiServicesSettings, + UpdateStages.WithServerlessGpuSessionsSettings, UpdateStages.WithWorkspaceStorageSettings { /** * Executes the update request. * @@ -436,6 +543,72 @@ interface WithCatalogSettings { */ Update withCatalogSettings(ProjectCatalogSettings catalogSettings); } + + /** + * The stage of the Project update allowing to specify customizationSettings. + */ + interface WithCustomizationSettings { + /** + * Specifies the customizationSettings property: Settings to be used for customizations.. + * + * @param customizationSettings Settings to be used for customizations. + * @return the next definition stage. + */ + Update withCustomizationSettings(ProjectCustomizationSettings customizationSettings); + } + + /** + * The stage of the Project update allowing to specify devBoxAutoDeleteSettings. + */ + interface WithDevBoxAutoDeleteSettings { + /** + * Specifies the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings.. + * + * @param devBoxAutoDeleteSettings Dev Box Auto Delete settings. + * @return the next definition stage. + */ + Update withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings devBoxAutoDeleteSettings); + } + + /** + * The stage of the Project update allowing to specify azureAiServicesSettings. + */ + interface WithAzureAiServicesSettings { + /** + * Specifies the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a + * project.. + * + * @param azureAiServicesSettings Indicates whether Azure AI services are enabled for a project. + * @return the next definition stage. + */ + Update withAzureAiServicesSettings(AzureAiServicesSettings azureAiServicesSettings); + } + + /** + * The stage of the Project update allowing to specify serverlessGpuSessionsSettings. + */ + interface WithServerlessGpuSessionsSettings { + /** + * Specifies the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU.. + * + * @param serverlessGpuSessionsSettings Settings to be used for serverless GPU. + * @return the next definition stage. + */ + Update withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings serverlessGpuSessionsSettings); + } + + /** + * The stage of the Project update allowing to specify workspaceStorageSettings. + */ + interface WithWorkspaceStorageSettings { + /** + * Specifies the workspaceStorageSettings property: Settings to be used for workspace storage.. + * + * @param workspaceStorageSettings Settings to be used for workspace storage. + * @return the next definition stage. + */ + Update withWorkspaceStorageSettings(WorkspaceStorageSettings workspaceStorageSettings); + } } /** @@ -452,4 +625,24 @@ interface WithCatalogSettings { * @return the refreshed resource. */ Project refresh(Context context); + + /** + * Gets applicable inherited settings for this project. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project along with {@link Response}. + */ + Response getInheritedSettingsWithResponse(Context context); + + /** + * Gets applicable inherited settings for this project. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project. + */ + InheritedSettingsForProject getInheritedSettings(); } diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitionBuildOperations.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitionBuildOperations.java new file mode 100644 index 000000000000..a8aa4954bbcb --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitionBuildOperations.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.devcenter.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProjectCatalogImageDefinitionBuildOperations. + */ +public interface ProjectCatalogImageDefinitionBuildOperations { + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName, Context context); + + /** + * Gets a build for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build for a specified image definition. + */ + ImageDefinitionBuild get(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName); + + /** + * Cancels the specified build for an image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details along with {@link Response}. + */ + Response getBuildDetailsWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, String buildName, Context context); + + /** + * Gets Build details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param buildName The ID of the Image Definition Build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build details. + */ + ImageDefinitionBuildDetails getBuildDetails(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName, String buildName); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitionBuilds.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitionBuilds.java new file mode 100644 index 000000000000..b940323d16a6 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitionBuilds.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProjectCatalogImageDefinitionBuilds. + */ +public interface ProjectCatalogImageDefinitionBuilds { + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName); + + /** + * Lists builds for a specified image definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition Build list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByImageDefinition(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitions.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitions.java new file mode 100644 index 000000000000..e5e4432702af --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCatalogImageDefinitions.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.devcenter.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 ProjectCatalogImageDefinitions. + */ +public interface ProjectCatalogImageDefinitions { + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName); + + /** + * List Image Definitions in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Image Definition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProjectCatalog(String resourceGroupName, String projectName, + String catalogName, Integer top, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog along with {@link Response}. + */ + Response getByProjectCatalogWithResponse(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName, Context context); + + /** + * Gets an Image Definition from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Image Definition from the catalog. + */ + ImageDefinition getByProjectCatalog(String resourceGroupName, String projectName, String catalogName, + String imageDefinitionName); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details along with {@link Response}. + */ + Response getErrorDetailsWithResponse(String resourceGroupName, + String projectName, String catalogName, String imageDefinitionName, Context context); + + /** + * Gets Image Definition error details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return image Definition error details. + */ + CatalogResourceValidationErrorDetails getErrorDetails(String resourceGroupName, String projectName, + String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName); + + /** + * Builds an image for the specified Image Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param catalogName The name of the Catalog. + * @param imageDefinitionName The name of the Image Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 buildImage(String resourceGroupName, String projectName, String catalogName, String imageDefinitionName, + Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationIdentityType.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationIdentityType.java new file mode 100644 index 000000000000..bfa69f5e5664 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationIdentityType.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Values can be systemAssignedIdentity or userAssignedIdentity. + */ +public final class ProjectCustomizationIdentityType extends ExpandableStringEnum { + /** + * Static value systemAssignedIdentity for ProjectCustomizationIdentityType. + */ + public static final ProjectCustomizationIdentityType SYSTEM_ASSIGNED_IDENTITY + = fromString("systemAssignedIdentity"); + + /** + * Static value userAssignedIdentity for ProjectCustomizationIdentityType. + */ + public static final ProjectCustomizationIdentityType USER_ASSIGNED_IDENTITY = fromString("userAssignedIdentity"); + + /** + * Creates a new instance of ProjectCustomizationIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProjectCustomizationIdentityType() { + } + + /** + * Creates or finds a ProjectCustomizationIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProjectCustomizationIdentityType. + */ + public static ProjectCustomizationIdentityType fromString(String name) { + return fromString(name, ProjectCustomizationIdentityType.class); + } + + /** + * Gets known ProjectCustomizationIdentityType values. + * + * @return known ProjectCustomizationIdentityType values. + */ + public static Collection values() { + return values(ProjectCustomizationIdentityType.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationManagedIdentity.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationManagedIdentity.java new file mode 100644 index 000000000000..1d755d154d6d --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationManagedIdentity.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.devcenter.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; + +/** + * A reference to a Managed Identity that is attached to the Project. + */ +@Fluent +public final class ProjectCustomizationManagedIdentity + implements JsonSerializable { + /* + * Values can be systemAssignedIdentity or userAssignedIdentity + */ + private ProjectCustomizationIdentityType identityType; + + /* + * Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType + * systemAssignedIdentity. + */ + private String identityResourceId; + + /** + * Creates an instance of ProjectCustomizationManagedIdentity class. + */ + public ProjectCustomizationManagedIdentity() { + } + + /** + * Get the identityType property: Values can be systemAssignedIdentity or userAssignedIdentity. + * + * @return the identityType value. + */ + public ProjectCustomizationIdentityType identityType() { + return this.identityType; + } + + /** + * Set the identityType property: Values can be systemAssignedIdentity or userAssignedIdentity. + * + * @param identityType the identityType value to set. + * @return the ProjectCustomizationManagedIdentity object itself. + */ + public ProjectCustomizationManagedIdentity withIdentityType(ProjectCustomizationIdentityType identityType) { + this.identityType = identityType; + return this; + } + + /** + * Get the identityResourceId property: Ex: + * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource + * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType + * systemAssignedIdentity. + * + * @return the identityResourceId value. + */ + public String identityResourceId() { + return this.identityResourceId; + } + + /** + * Set the identityResourceId property: Ex: + * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource + * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType + * systemAssignedIdentity. + * + * @param identityResourceId the identityResourceId value to set. + * @return the ProjectCustomizationManagedIdentity object itself. + */ + public ProjectCustomizationManagedIdentity withIdentityResourceId(String identityResourceId) { + this.identityResourceId = identityResourceId; + 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("identityType", this.identityType == null ? null : this.identityType.toString()); + jsonWriter.writeStringField("identityResourceId", this.identityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectCustomizationManagedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectCustomizationManagedIdentity if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectCustomizationManagedIdentity. + */ + public static ProjectCustomizationManagedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectCustomizationManagedIdentity deserializedProjectCustomizationManagedIdentity + = new ProjectCustomizationManagedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedProjectCustomizationManagedIdentity.identityType + = ProjectCustomizationIdentityType.fromString(reader.getString()); + } else if ("identityResourceId".equals(fieldName)) { + deserializedProjectCustomizationManagedIdentity.identityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectCustomizationManagedIdentity; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationSettings.java new file mode 100644 index 000000000000..0c96903e0a5c --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectCustomizationSettings.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.devcenter.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; + +/** + * Settings to be used for customizations. + */ +@Fluent +public final class ProjectCustomizationSettings implements JsonSerializable { + /* + * The identities that can to be used in customization scenarios; e.g., to clone a repository. + */ + private List identities; + + /* + * Indicates whether user customizations are enabled. + */ + private UserCustomizationsEnableStatus userCustomizationsEnableStatus; + + /** + * Creates an instance of ProjectCustomizationSettings class. + */ + public ProjectCustomizationSettings() { + } + + /** + * Get the identities property: The identities that can to be used in customization scenarios; e.g., to clone a + * repository. + * + * @return the identities value. + */ + public List identities() { + return this.identities; + } + + /** + * Set the identities property: The identities that can to be used in customization scenarios; e.g., to clone a + * repository. + * + * @param identities the identities value to set. + * @return the ProjectCustomizationSettings object itself. + */ + public ProjectCustomizationSettings withIdentities(List identities) { + this.identities = identities; + return this; + } + + /** + * Get the userCustomizationsEnableStatus property: Indicates whether user customizations are enabled. + * + * @return the userCustomizationsEnableStatus value. + */ + public UserCustomizationsEnableStatus userCustomizationsEnableStatus() { + return this.userCustomizationsEnableStatus; + } + + /** + * Set the userCustomizationsEnableStatus property: Indicates whether user customizations are enabled. + * + * @param userCustomizationsEnableStatus the userCustomizationsEnableStatus value to set. + * @return the ProjectCustomizationSettings object itself. + */ + public ProjectCustomizationSettings + withUserCustomizationsEnableStatus(UserCustomizationsEnableStatus userCustomizationsEnableStatus) { + this.userCustomizationsEnableStatus = userCustomizationsEnableStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identities() != null) { + identities().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("identities", this.identities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("userCustomizationsEnableStatus", + this.userCustomizationsEnableStatus == null ? null : this.userCustomizationsEnableStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectCustomizationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectCustomizationSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectCustomizationSettings. + */ + public static ProjectCustomizationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectCustomizationSettings deserializedProjectCustomizationSettings = new ProjectCustomizationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identities".equals(fieldName)) { + List identities + = reader.readArray(reader1 -> ProjectCustomizationManagedIdentity.fromJson(reader1)); + deserializedProjectCustomizationSettings.identities = identities; + } else if ("userCustomizationsEnableStatus".equals(fieldName)) { + deserializedProjectCustomizationSettings.userCustomizationsEnableStatus + = UserCustomizationsEnableStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectCustomizationSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectNetworkSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectNetworkSettings.java new file mode 100644 index 000000000000..2d4f64090e09 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectNetworkSettings.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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; + +/** + * Network settings for the project. + */ +@Immutable +public final class ProjectNetworkSettings implements JsonSerializable { + /* + * Indicates whether pools in this Dev Center can use Microsoft Hosted Networks. Defaults to Enabled if not set. + */ + private MicrosoftHostedNetworkEnableStatus microsoftHostedNetworkEnableStatus; + + /** + * Creates an instance of ProjectNetworkSettings class. + */ + public ProjectNetworkSettings() { + } + + /** + * Get the microsoftHostedNetworkEnableStatus property: Indicates whether pools in this Dev Center can use Microsoft + * Hosted Networks. Defaults to Enabled if not set. + * + * @return the microsoftHostedNetworkEnableStatus value. + */ + public MicrosoftHostedNetworkEnableStatus microsoftHostedNetworkEnableStatus() { + return this.microsoftHostedNetworkEnableStatus; + } + + /** + * 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 ProjectNetworkSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectNetworkSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectNetworkSettings. + */ + public static ProjectNetworkSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectNetworkSettings deserializedProjectNetworkSettings = new ProjectNetworkSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("microsoftHostedNetworkEnableStatus".equals(fieldName)) { + deserializedProjectNetworkSettings.microsoftHostedNetworkEnableStatus + = MicrosoftHostedNetworkEnableStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectNetworkSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicies.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicies.java new file mode 100644 index 000000000000..3391495fe8bb --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicies.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.devcenter.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 ProjectPolicies. + */ +public interface ProjectPolicies { + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDevCenter(String resourceGroupName, String devCenterName); + + /** + * Lists all project policies in the dev center. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the project policy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDevCenter(String resourceGroupName, String devCenterName, Integer top, + Context context); + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String devCenterName, String projectPolicyName, + Context context); + + /** + * Gets a specific project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific project policy. + */ + ProjectPolicy get(String resourceGroupName, String devCenterName, String projectPolicyName); + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String projectPolicyName); + + /** + * Deletes an project policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @param projectPolicyName The name of the project policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 devCenterName, String projectPolicyName, Context context); + + /** + * Gets a specific project policy. + * + * @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 a specific project policy along with {@link Response}. + */ + ProjectPolicy getById(String id); + + /** + * Gets a specific project policy. + * + * @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 a specific project policy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an project policy. + * + * @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 project policy. + * + * @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 ProjectPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ProjectPolicy definition. + */ + ProjectPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicy.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicy.java new file mode 100644 index 000000000000..72a99e93c933 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicy.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devcenter.fluent.models.ProjectPolicyInner; +import java.util.List; + +/** + * An immutable client-side representation of ProjectPolicy. + */ +public interface ProjectPolicy { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @return the resourcePolicies value. + */ + List resourcePolicies(); + + /** + * Gets the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @return the scopes value. + */ + List scopes(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.devcenter.fluent.models.ProjectPolicyInner object. + * + * @return the inner object. + */ + ProjectPolicyInner innerModel(); + + /** + * The entirety of the ProjectPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ProjectPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ProjectPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ProjectPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, devCenterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param devCenterName The name of the devcenter. + * @return the next definition stage. + */ + WithCreate withExistingDevcenter(String resourceGroupName, String devCenterName); + } + + /** + * The stage of the ProjectPolicy 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.WithResourcePolicies, DefinitionStages.WithScopes { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProjectPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProjectPolicy create(Context context); + } + + /** + * The stage of the ProjectPolicy definition allowing to specify resourcePolicies. + */ + interface WithResourcePolicies { + /** + * Specifies the resourcePolicies property: Resource policies that are a part of this project policy.. + * + * @param resourcePolicies Resource policies that are a part of this project policy. + * @return the next definition stage. + */ + WithCreate withResourcePolicies(List resourcePolicies); + } + + /** + * The stage of the ProjectPolicy definition allowing to specify scopes. + */ + interface WithScopes { + /** + * Specifies the scopes property: Resources that have access to the shared resources that are a part of this + * project policy.. + * + * @param scopes Resources that have access to the shared resources that are a part of this project policy. + * @return the next definition stage. + */ + WithCreate withScopes(List scopes); + } + } + + /** + * Begins update for the ProjectPolicy resource. + * + * @return the stage of resource update. + */ + ProjectPolicy.Update update(); + + /** + * The template for ProjectPolicy update. + */ + interface Update extends UpdateStages.WithResourcePolicies, UpdateStages.WithScopes { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProjectPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProjectPolicy apply(Context context); + } + + /** + * The ProjectPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the ProjectPolicy update allowing to specify resourcePolicies. + */ + interface WithResourcePolicies { + /** + * Specifies the resourcePolicies property: Resource policies that are a part of this project policy.. + * + * @param resourcePolicies Resource policies that are a part of this project policy. + * @return the next definition stage. + */ + Update withResourcePolicies(List resourcePolicies); + } + + /** + * The stage of the ProjectPolicy update allowing to specify scopes. + */ + interface WithScopes { + /** + * Specifies the scopes property: Resources that have access to the shared resources that are a part of this + * project policy.. + * + * @param scopes Resources that have access to the shared resources that are a part of this project policy. + * @return the next definition stage. + */ + Update withScopes(List scopes); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProjectPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProjectPolicy refresh(Context context); +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicyListResult.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicyListResult.java new file mode 100644 index 000000000000..13bcca6396a1 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicyListResult.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.devcenter.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.devcenter.fluent.models.ProjectPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * Results of the project policy list operation. + */ +@Immutable +public final class ProjectPolicyListResult implements JsonSerializable { + /* + * Current page of results. + */ + private List value; + + /* + * URL to get the next set of results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ProjectPolicyListResult class. + */ + public ProjectPolicyListResult() { + } + + /** + * Get the value property: Current page of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of 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 ProjectPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectPolicyListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectPolicyListResult. + */ + public static ProjectPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectPolicyListResult deserializedProjectPolicyListResult = new ProjectPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ProjectPolicyInner.fromJson(reader1)); + deserializedProjectPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProjectPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectPolicyListResult; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicyUpdate.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicyUpdate.java new file mode 100644 index 000000000000..ca1a8dbb9786 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectPolicyUpdate.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.devcenter.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.devcenter.fluent.models.ProjectPolicyUpdateProperties; +import java.io.IOException; +import java.util.List; + +/** + * The project policy properties for partial update. Properties not provided in the update request will not be changed. + */ +@Fluent +public final class ProjectPolicyUpdate implements JsonSerializable { + /* + * Properties of an project policy to be updated. + */ + private ProjectPolicyUpdateProperties innerProperties; + + /** + * Creates an instance of ProjectPolicyUpdate class. + */ + public ProjectPolicyUpdate() { + } + + /** + * Get the innerProperties property: Properties of an project policy to be updated. + * + * @return the innerProperties value. + */ + private ProjectPolicyUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @return the resourcePolicies value. + */ + public List resourcePolicies() { + return this.innerProperties() == null ? null : this.innerProperties().resourcePolicies(); + } + + /** + * Set the resourcePolicies property: Resource policies that are a part of this project policy. + * + * @param resourcePolicies the resourcePolicies value to set. + * @return the ProjectPolicyUpdate object itself. + */ + public ProjectPolicyUpdate withResourcePolicies(List resourcePolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectPolicyUpdateProperties(); + } + this.innerProperties().withResourcePolicies(resourcePolicies); + return this; + } + + /** + * Get the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @return the scopes value. + */ + public List scopes() { + return this.innerProperties() == null ? null : this.innerProperties().scopes(); + } + + /** + * Set the scopes property: Resources that have access to the shared resources that are a part of this project + * policy. + * + * @param scopes the scopes value to set. + * @return the ProjectPolicyUpdate object itself. + */ + public ProjectPolicyUpdate withScopes(List scopes) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectPolicyUpdateProperties(); + } + this.innerProperties().withScopes(scopes); + 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.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectPolicyUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectPolicyUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectPolicyUpdate. + */ + public static ProjectPolicyUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectPolicyUpdate deserializedProjectPolicyUpdate = new ProjectPolicyUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedProjectPolicyUpdate.innerProperties = ProjectPolicyUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectPolicyUpdate; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectUpdate.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectUpdate.java index fa25aaa51e5c..2187aabfaa2a 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectUpdate.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ProjectUpdate.java @@ -197,6 +197,122 @@ public ProjectUpdate withCatalogSettings(ProjectCatalogSettings catalogSettings) return this; } + /** + * Get the customizationSettings property: Settings to be used for customizations. + * + * @return the customizationSettings value. + */ + public ProjectCustomizationSettings customizationSettings() { + return this.innerProperties() == null ? null : this.innerProperties().customizationSettings(); + } + + /** + * Set the customizationSettings property: Settings to be used for customizations. + * + * @param customizationSettings the customizationSettings value to set. + * @return the ProjectUpdate object itself. + */ + public ProjectUpdate withCustomizationSettings(ProjectCustomizationSettings customizationSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectUpdateProperties(); + } + this.innerProperties().withCustomizationSettings(customizationSettings); + return this; + } + + /** + * Get the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings. + * + * @return the devBoxAutoDeleteSettings value. + */ + public DevBoxAutoDeleteSettings devBoxAutoDeleteSettings() { + return this.innerProperties() == null ? null : this.innerProperties().devBoxAutoDeleteSettings(); + } + + /** + * Set the devBoxAutoDeleteSettings property: Dev Box Auto Delete settings. + * + * @param devBoxAutoDeleteSettings the devBoxAutoDeleteSettings value to set. + * @return the ProjectUpdate object itself. + */ + public ProjectUpdate withDevBoxAutoDeleteSettings(DevBoxAutoDeleteSettings devBoxAutoDeleteSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectUpdateProperties(); + } + this.innerProperties().withDevBoxAutoDeleteSettings(devBoxAutoDeleteSettings); + return this; + } + + /** + * Get the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a project. + * + * @return the azureAiServicesSettings value. + */ + public AzureAiServicesSettings azureAiServicesSettings() { + return this.innerProperties() == null ? null : this.innerProperties().azureAiServicesSettings(); + } + + /** + * Set the azureAiServicesSettings property: Indicates whether Azure AI services are enabled for a project. + * + * @param azureAiServicesSettings the azureAiServicesSettings value to set. + * @return the ProjectUpdate object itself. + */ + public ProjectUpdate withAzureAiServicesSettings(AzureAiServicesSettings azureAiServicesSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectUpdateProperties(); + } + this.innerProperties().withAzureAiServicesSettings(azureAiServicesSettings); + return this; + } + + /** + * Get the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU. + * + * @return the serverlessGpuSessionsSettings value. + */ + public ServerlessGpuSessionsSettings serverlessGpuSessionsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().serverlessGpuSessionsSettings(); + } + + /** + * Set the serverlessGpuSessionsSettings property: Settings to be used for serverless GPU. + * + * @param serverlessGpuSessionsSettings the serverlessGpuSessionsSettings value to set. + * @return the ProjectUpdate object itself. + */ + public ProjectUpdate + withServerlessGpuSessionsSettings(ServerlessGpuSessionsSettings serverlessGpuSessionsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectUpdateProperties(); + } + this.innerProperties().withServerlessGpuSessionsSettings(serverlessGpuSessionsSettings); + return this; + } + + /** + * Get the workspaceStorageSettings property: Settings to be used for workspace storage. + * + * @return the workspaceStorageSettings value. + */ + public WorkspaceStorageSettings workspaceStorageSettings() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceStorageSettings(); + } + + /** + * Set the workspaceStorageSettings property: Settings to be used for workspace storage. + * + * @param workspaceStorageSettings the workspaceStorageSettings value to set. + * @return the ProjectUpdate object itself. + */ + public ProjectUpdate withWorkspaceStorageSettings(WorkspaceStorageSettings workspaceStorageSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectUpdateProperties(); + } + this.innerProperties().withWorkspaceStorageSettings(workspaceStorageSettings); + return this; + } + /** * Validates the instance. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Projects.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Projects.java index 823c802ca32b..3309edbdfaeb 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Projects.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Projects.java @@ -105,6 +105,32 @@ public interface Projects { */ void delete(String resourceGroupName, String projectName, Context context); + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project along with {@link Response}. + */ + Response getInheritedSettingsWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Gets applicable inherited settings for this project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return applicable inherited settings for this project. + */ + InheritedSettingsForProject getInheritedSettings(String resourceGroupName, String projectName); + /** * Gets a specific project. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ResourcePolicy.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ResourcePolicy.java new file mode 100644 index 000000000000..ca64c9f96821 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ResourcePolicy.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.devcenter.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; + +/** + * A resource policy. + */ +@Fluent +public final class ResourcePolicy implements JsonSerializable { + /* + * Resources that are included and shared as a part of a project policy. + */ + private String resources; + + /* + * Optional. When specified, this expression is used to filter the resources. + */ + private String filter; + + /* + * Policy action to be taken on the resources. This is optional, and defaults to allow + */ + private PolicyAction action; + + /* + * Optional. The resource type being restricted or allowed by a project policy. Used with a given action to restrict + * or allow access to a resource type. + */ + private DevCenterResourceType resourceType; + + /** + * Creates an instance of ResourcePolicy class. + */ + public ResourcePolicy() { + } + + /** + * Get the resources property: Resources that are included and shared as a part of a project policy. + * + * @return the resources value. + */ + public String resources() { + return this.resources; + } + + /** + * Set the resources property: Resources that are included and shared as a part of a project policy. + * + * @param resources the resources value to set. + * @return the ResourcePolicy object itself. + */ + public ResourcePolicy withResources(String resources) { + this.resources = resources; + return this; + } + + /** + * Get the filter property: Optional. When specified, this expression is used to filter the resources. + * + * @return the filter value. + */ + public String filter() { + return this.filter; + } + + /** + * Set the filter property: Optional. When specified, this expression is used to filter the resources. + * + * @param filter the filter value to set. + * @return the ResourcePolicy object itself. + */ + public ResourcePolicy withFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the action property: Policy action to be taken on the resources. This is optional, and defaults to allow. + * + * @return the action value. + */ + public PolicyAction action() { + return this.action; + } + + /** + * Set the action property: Policy action to be taken on the resources. This is optional, and defaults to allow. + * + * @param action the action value to set. + * @return the ResourcePolicy object itself. + */ + public ResourcePolicy withAction(PolicyAction action) { + this.action = action; + return this; + } + + /** + * Get the resourceType property: Optional. The resource type being restricted or allowed by a project policy. Used + * with a given action to restrict or allow access to a resource type. + * + * @return the resourceType value. + */ + public DevCenterResourceType resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Optional. The resource type being restricted or allowed by a project policy. Used + * with a given action to restrict or allow access to a resource type. + * + * @param resourceType the resourceType value to set. + * @return the ResourcePolicy object itself. + */ + public ResourcePolicy withResourceType(DevCenterResourceType resourceType) { + this.resourceType = resourceType; + 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("resources", this.resources); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcePolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourcePolicy. + */ + public static ResourcePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcePolicy deserializedResourcePolicy = new ResourcePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resources".equals(fieldName)) { + deserializedResourcePolicy.resources = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedResourcePolicy.filter = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedResourcePolicy.action = PolicyAction.fromString(reader.getString()); + } else if ("resourceType".equals(fieldName)) { + deserializedResourcePolicy.resourceType = DevCenterResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourcePolicy; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ServerlessGpuSessionsMode.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ServerlessGpuSessionsMode.java new file mode 100644 index 000000000000..11382a28ec64 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ServerlessGpuSessionsMode.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether serverless GPU session access is enabled. + */ +public final class ServerlessGpuSessionsMode extends ExpandableStringEnum { + /** + * Static value Disabled for ServerlessGpuSessionsMode. + */ + public static final ServerlessGpuSessionsMode DISABLED = fromString("Disabled"); + + /** + * Static value AutoDeploy for ServerlessGpuSessionsMode. + */ + public static final ServerlessGpuSessionsMode AUTO_DEPLOY = fromString("AutoDeploy"); + + /** + * Creates a new instance of ServerlessGpuSessionsMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerlessGpuSessionsMode() { + } + + /** + * Creates or finds a ServerlessGpuSessionsMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerlessGpuSessionsMode. + */ + public static ServerlessGpuSessionsMode fromString(String name) { + return fromString(name, ServerlessGpuSessionsMode.class); + } + + /** + * Gets known ServerlessGpuSessionsMode values. + * + * @return known ServerlessGpuSessionsMode values. + */ + public static Collection values() { + return values(ServerlessGpuSessionsMode.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ServerlessGpuSessionsSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ServerlessGpuSessionsSettings.java new file mode 100644 index 000000000000..b87925bf9843 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/ServerlessGpuSessionsSettings.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.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; + +/** + * Represents settings for serverless GPU access. + */ +@Fluent +public final class ServerlessGpuSessionsSettings implements JsonSerializable { + /* + * The property indicates whether serverless GPU access is enabled on the project. + */ + private ServerlessGpuSessionsMode serverlessGpuSessionsMode; + + /* + * When specified, limits the maximum number of concurrent sessions across all pools in the project. + */ + private Integer maxConcurrentSessionsPerProject; + + /** + * Creates an instance of ServerlessGpuSessionsSettings class. + */ + public ServerlessGpuSessionsSettings() { + } + + /** + * Get the serverlessGpuSessionsMode property: The property indicates whether serverless GPU access is enabled on + * the project. + * + * @return the serverlessGpuSessionsMode value. + */ + public ServerlessGpuSessionsMode serverlessGpuSessionsMode() { + return this.serverlessGpuSessionsMode; + } + + /** + * Set the serverlessGpuSessionsMode property: The property indicates whether serverless GPU access is enabled on + * the project. + * + * @param serverlessGpuSessionsMode the serverlessGpuSessionsMode value to set. + * @return the ServerlessGpuSessionsSettings object itself. + */ + public ServerlessGpuSessionsSettings + withServerlessGpuSessionsMode(ServerlessGpuSessionsMode serverlessGpuSessionsMode) { + this.serverlessGpuSessionsMode = serverlessGpuSessionsMode; + return this; + } + + /** + * Get the maxConcurrentSessionsPerProject property: When specified, limits the maximum number of concurrent + * sessions across all pools in the project. + * + * @return the maxConcurrentSessionsPerProject value. + */ + public Integer maxConcurrentSessionsPerProject() { + return this.maxConcurrentSessionsPerProject; + } + + /** + * Set the maxConcurrentSessionsPerProject property: When specified, limits the maximum number of concurrent + * sessions across all pools in the project. + * + * @param maxConcurrentSessionsPerProject the maxConcurrentSessionsPerProject value to set. + * @return the ServerlessGpuSessionsSettings object itself. + */ + public ServerlessGpuSessionsSettings withMaxConcurrentSessionsPerProject(Integer maxConcurrentSessionsPerProject) { + this.maxConcurrentSessionsPerProject = maxConcurrentSessionsPerProject; + 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("serverlessGpuSessionsMode", + this.serverlessGpuSessionsMode == null ? null : this.serverlessGpuSessionsMode.toString()); + jsonWriter.writeNumberField("maxConcurrentSessionsPerProject", this.maxConcurrentSessionsPerProject); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessGpuSessionsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessGpuSessionsSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerlessGpuSessionsSettings. + */ + public static ServerlessGpuSessionsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerlessGpuSessionsSettings deserializedServerlessGpuSessionsSettings + = new ServerlessGpuSessionsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverlessGpuSessionsMode".equals(fieldName)) { + deserializedServerlessGpuSessionsSettings.serverlessGpuSessionsMode + = ServerlessGpuSessionsMode.fromString(reader.getString()); + } else if ("maxConcurrentSessionsPerProject".equals(fieldName)) { + deserializedServerlessGpuSessionsSettings.maxConcurrentSessionsPerProject + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessGpuSessionsSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Sku.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Sku.java index f44b2d8ab1a4..0b88903c7318 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Sku.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Sku.java @@ -18,7 +18,7 @@ @Fluent public class Sku implements JsonSerializable { /* - * The name of the SKU. Ex - P3. It is typically a letter+number code + * The name of the SKU. E.g. P3. It is typically a letter+number code */ private String name; @@ -52,7 +52,7 @@ public Sku() { } /** - * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * Get the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. * * @return the name value. */ @@ -61,7 +61,7 @@ public String name() { } /** - * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * Set the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. * * @param name the name value to set. * @return the Sku object itself. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Skus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Skus.java index 6df01f140384..fb21e11408eb 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Skus.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/Skus.java @@ -11,6 +11,31 @@ * Resource collection API of Skus. */ public interface Skus { + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProject(String resourceGroupName, String projectName); + + /** + * Lists SKUs available to the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName The name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of the Microsoft.DevCenter SKU list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByProject(String resourceGroupName, String projectName, Context context); + /** * Lists the Microsoft.DevCenter SKUs available in a subscription. * diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/StopOnNoConnectConfiguration.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/StopOnNoConnectConfiguration.java new file mode 100644 index 000000000000..8840577ea086 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/StopOnNoConnectConfiguration.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.devcenter.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; + +/** + * Stop on no connect configuration settings for Dev Boxes created in this pool. + */ +@Fluent +public final class StopOnNoConnectConfiguration implements JsonSerializable { + /* + * Enables the feature to stop a started Dev Box when it has not been connected to, once the grace period has + * lapsed. + */ + private StopOnNoConnectEnableStatus status; + + /* + * The specified time in minutes to wait before stopping a Dev Box if no connection is made. + */ + private Integer gracePeriodMinutes; + + /** + * Creates an instance of StopOnNoConnectConfiguration class. + */ + public StopOnNoConnectConfiguration() { + } + + /** + * Get the status property: Enables the feature to stop a started Dev Box when it has not been connected to, once + * the grace period has lapsed. + * + * @return the status value. + */ + public StopOnNoConnectEnableStatus status() { + return this.status; + } + + /** + * Set the status property: Enables the feature to stop a started Dev Box when it has not been connected to, once + * the grace period has lapsed. + * + * @param status the status value to set. + * @return the StopOnNoConnectConfiguration object itself. + */ + public StopOnNoConnectConfiguration withStatus(StopOnNoConnectEnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the gracePeriodMinutes property: The specified time in minutes to wait before stopping a Dev Box if no + * connection is made. + * + * @return the gracePeriodMinutes value. + */ + public Integer gracePeriodMinutes() { + return this.gracePeriodMinutes; + } + + /** + * Set the gracePeriodMinutes property: The specified time in minutes to wait before stopping a Dev Box if no + * connection is made. + * + * @param gracePeriodMinutes the gracePeriodMinutes value to set. + * @return the StopOnNoConnectConfiguration object itself. + */ + public StopOnNoConnectConfiguration withGracePeriodMinutes(Integer gracePeriodMinutes) { + this.gracePeriodMinutes = gracePeriodMinutes; + 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("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeNumberField("gracePeriodMinutes", this.gracePeriodMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StopOnNoConnectConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StopOnNoConnectConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StopOnNoConnectConfiguration. + */ + public static StopOnNoConnectConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StopOnNoConnectConfiguration deserializedStopOnNoConnectConfiguration = new StopOnNoConnectConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedStopOnNoConnectConfiguration.status + = StopOnNoConnectEnableStatus.fromString(reader.getString()); + } else if ("gracePeriodMinutes".equals(fieldName)) { + deserializedStopOnNoConnectConfiguration.gracePeriodMinutes + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedStopOnNoConnectConfiguration; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/StopOnNoConnectEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/StopOnNoConnectEnableStatus.java new file mode 100644 index 000000000000..e6b14ebdde1f --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/StopOnNoConnectEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Stop on no connect enable or disable status. + */ +public final class StopOnNoConnectEnableStatus extends ExpandableStringEnum { + /** + * Static value Enabled for StopOnNoConnectEnableStatus. + */ + public static final StopOnNoConnectEnableStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for StopOnNoConnectEnableStatus. + */ + public static final StopOnNoConnectEnableStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of StopOnNoConnectEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StopOnNoConnectEnableStatus() { + } + + /** + * Creates or finds a StopOnNoConnectEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding StopOnNoConnectEnableStatus. + */ + public static StopOnNoConnectEnableStatus fromString(String name) { + return fromString(name, StopOnNoConnectEnableStatus.class); + } + + /** + * Gets known StopOnNoConnectEnableStatus values. + * + * @return known StopOnNoConnectEnableStatus values. + */ + public static Collection values() { + return values(StopOnNoConnectEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/UserCustomizationsEnableStatus.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/UserCustomizationsEnableStatus.java new file mode 100644 index 000000000000..3d817a86c56f --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/UserCustomizationsEnableStatus.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether user customizations are enabled. + */ +public final class UserCustomizationsEnableStatus extends ExpandableStringEnum { + /** + * Static value Disabled for UserCustomizationsEnableStatus. + */ + public static final UserCustomizationsEnableStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for UserCustomizationsEnableStatus. + */ + public static final UserCustomizationsEnableStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of UserCustomizationsEnableStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UserCustomizationsEnableStatus() { + } + + /** + * Creates or finds a UserCustomizationsEnableStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserCustomizationsEnableStatus. + */ + public static UserCustomizationsEnableStatus fromString(String name) { + return fromString(name, UserCustomizationsEnableStatus.class); + } + + /** + * Gets known UserCustomizationsEnableStatus values. + * + * @return known UserCustomizationsEnableStatus values. + */ + public static Collection values() { + return values(UserCustomizationsEnableStatus.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/WorkspaceStorageMode.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/WorkspaceStorageMode.java new file mode 100644 index 000000000000..7a8a45d66341 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/WorkspaceStorageMode.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.devcenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether workspace storage is enabled. + */ +public final class WorkspaceStorageMode extends ExpandableStringEnum { + /** + * Static value Disabled for WorkspaceStorageMode. + */ + public static final WorkspaceStorageMode DISABLED = fromString("Disabled"); + + /** + * Static value AutoDeploy for WorkspaceStorageMode. + */ + public static final WorkspaceStorageMode AUTO_DEPLOY = fromString("AutoDeploy"); + + /** + * Creates a new instance of WorkspaceStorageMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceStorageMode() { + } + + /** + * Creates or finds a WorkspaceStorageMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceStorageMode. + */ + public static WorkspaceStorageMode fromString(String name) { + return fromString(name, WorkspaceStorageMode.class); + } + + /** + * Gets known WorkspaceStorageMode values. + * + * @return known WorkspaceStorageMode values. + */ + public static Collection values() { + return values(WorkspaceStorageMode.class); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/WorkspaceStorageSettings.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/WorkspaceStorageSettings.java new file mode 100644 index 000000000000..b4f775a7f7fb --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/models/WorkspaceStorageSettings.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.devcenter.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 to be used for workspace storage. + */ +@Fluent +public final class WorkspaceStorageSettings implements JsonSerializable { + /* + * Indicates whether workspace storage is enabled. + */ + private WorkspaceStorageMode workspaceStorageMode; + + /** + * Creates an instance of WorkspaceStorageSettings class. + */ + public WorkspaceStorageSettings() { + } + + /** + * Get the workspaceStorageMode property: Indicates whether workspace storage is enabled. + * + * @return the workspaceStorageMode value. + */ + public WorkspaceStorageMode workspaceStorageMode() { + return this.workspaceStorageMode; + } + + /** + * Set the workspaceStorageMode property: Indicates whether workspace storage is enabled. + * + * @param workspaceStorageMode the workspaceStorageMode value to set. + * @return the WorkspaceStorageSettings object itself. + */ + public WorkspaceStorageSettings withWorkspaceStorageMode(WorkspaceStorageMode workspaceStorageMode) { + this.workspaceStorageMode = workspaceStorageMode; + 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("workspaceStorageMode", + this.workspaceStorageMode == null ? null : this.workspaceStorageMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceStorageSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceStorageSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceStorageSettings. + */ + public static WorkspaceStorageSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceStorageSettings deserializedWorkspaceStorageSettings = new WorkspaceStorageSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workspaceStorageMode".equals(fieldName)) { + deserializedWorkspaceStorageSettings.workspaceStorageMode + = WorkspaceStorageMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceStorageSettings; + }); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-devcenter/proxy-config.json b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-devcenter/proxy-config.json index 11f15d255cdc..aa4b0997d44e 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-devcenter/proxy-config.json +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-devcenter/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.devcenter.implementation.AttachedNetworksClientImpl$AttachedNetworksService"],["com.azure.resourcemanager.devcenter.implementation.CatalogsClientImpl$CatalogsService"],["com.azure.resourcemanager.devcenter.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.devcenter.implementation.CheckScopedNameAvailabilitiesClientImpl$CheckScopedNameAvailabilitiesService"],["com.azure.resourcemanager.devcenter.implementation.DevBoxDefinitionsClientImpl$DevBoxDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.DevCentersClientImpl$DevCentersService"],["com.azure.resourcemanager.devcenter.implementation.EnvironmentDefinitionsClientImpl$EnvironmentDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.EnvironmentTypesClientImpl$EnvironmentTypesService"],["com.azure.resourcemanager.devcenter.implementation.GalleriesClientImpl$GalleriesService"],["com.azure.resourcemanager.devcenter.implementation.ImageVersionsClientImpl$ImageVersionsService"],["com.azure.resourcemanager.devcenter.implementation.ImagesClientImpl$ImagesService"],["com.azure.resourcemanager.devcenter.implementation.NetworkConnectionsClientImpl$NetworkConnectionsService"],["com.azure.resourcemanager.devcenter.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.devcenter.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.devcenter.implementation.PoolsClientImpl$PoolsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectAllowedEnvironmentTypesClientImpl$ProjectAllowedEnvironmentTypesService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogEnvironmentDefinitionsClientImpl$ProjectCatalogEnvironmentDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogsClientImpl$ProjectCatalogsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectEnvironmentTypesClientImpl$ProjectEnvironmentTypesService"],["com.azure.resourcemanager.devcenter.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.devcenter.implementation.SchedulesClientImpl$SchedulesService"],["com.azure.resourcemanager.devcenter.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.devcenter.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.devcenter.implementation.AttachedNetworksClientImpl$AttachedNetworksService"],["com.azure.resourcemanager.devcenter.implementation.CatalogsClientImpl$CatalogsService"],["com.azure.resourcemanager.devcenter.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService"],["com.azure.resourcemanager.devcenter.implementation.CheckScopedNameAvailabilitiesClientImpl$CheckScopedNameAvailabilitiesService"],["com.azure.resourcemanager.devcenter.implementation.CustomizationTasksClientImpl$CustomizationTasksService"],["com.azure.resourcemanager.devcenter.implementation.DevBoxDefinitionsClientImpl$DevBoxDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.DevCenterCatalogImageDefinitionBuildOperationsClientImpl$DevCenterCatalogImageDefinitionBuildOperationsService"],["com.azure.resourcemanager.devcenter.implementation.DevCenterCatalogImageDefinitionBuildsClientImpl$DevCenterCatalogImageDefinitionBuildsService"],["com.azure.resourcemanager.devcenter.implementation.DevCenterCatalogImageDefinitionsClientImpl$DevCenterCatalogImageDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.DevCentersClientImpl$DevCentersService"],["com.azure.resourcemanager.devcenter.implementation.EncryptionSetsClientImpl$EncryptionSetsService"],["com.azure.resourcemanager.devcenter.implementation.EnvironmentDefinitionsClientImpl$EnvironmentDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.EnvironmentTypesClientImpl$EnvironmentTypesService"],["com.azure.resourcemanager.devcenter.implementation.GalleriesClientImpl$GalleriesService"],["com.azure.resourcemanager.devcenter.implementation.ImageVersionsClientImpl$ImageVersionsService"],["com.azure.resourcemanager.devcenter.implementation.ImagesClientImpl$ImagesService"],["com.azure.resourcemanager.devcenter.implementation.NetworkConnectionsClientImpl$NetworkConnectionsService"],["com.azure.resourcemanager.devcenter.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.devcenter.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.devcenter.implementation.PoolsClientImpl$PoolsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectAllowedEnvironmentTypesClientImpl$ProjectAllowedEnvironmentTypesService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogEnvironmentDefinitionsClientImpl$ProjectCatalogEnvironmentDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogImageDefinitionBuildOperationsClientImpl$ProjectCatalogImageDefinitionBuildOperationsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogImageDefinitionBuildsClientImpl$ProjectCatalogImageDefinitionBuildsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogImageDefinitionsClientImpl$ProjectCatalogImageDefinitionsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectCatalogsClientImpl$ProjectCatalogsService"],["com.azure.resourcemanager.devcenter.implementation.ProjectEnvironmentTypesClientImpl$ProjectEnvironmentTypesService"],["com.azure.resourcemanager.devcenter.implementation.ProjectPoliciesClientImpl$ProjectPoliciesService"],["com.azure.resourcemanager.devcenter.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.devcenter.implementation.SchedulesClientImpl$SchedulesService"],["com.azure.resourcemanager.devcenter.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.devcenter.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/azure-resourcemanager-devcenter.properties b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/azure-resourcemanager-devcenter.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/main/resources/azure-resourcemanager-devcenter.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateSamples.java index 17a7bcddbadc..a25a1e07920f 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateSamples.java @@ -10,8 +10,8 @@ public final class AttachedNetworksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/AttachedNetworks_Create. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_Create.json */ /** * Sample code: AttachedNetworks_Create. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksDeleteSamples.java index 66573b583d99..04b81546b72d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksDeleteSamples.java @@ -10,8 +10,8 @@ public final class AttachedNetworksDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/AttachedNetworks_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * AttachedNetworks_Delete.json */ /** * Sample code: AttachedNetworks_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterSamples.java index 6c6969ae8a43..5bfa334e2c08 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterSamples.java @@ -9,7 +9,8 @@ */ public final class AttachedNetworksGetByDevCenterSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * AttachedNetworks_GetByDevCenter.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectSamples.java index 1767ff1fc8fe..342c10237b83 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectSamples.java @@ -9,7 +9,8 @@ */ public final class AttachedNetworksGetByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * AttachedNetworks_GetByProject.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterSamples.java index 557997419db2..76c4b0b3553f 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterSamples.java @@ -9,7 +9,8 @@ */ public final class AttachedNetworksListByDevCenterSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * AttachedNetworks_ListByDevCenter.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectSamples.java index a5118faba85f..894491766526 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectSamples.java @@ -9,7 +9,8 @@ */ public final class AttachedNetworksListByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * AttachedNetworks_ListByProject.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsConnectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsConnectSamples.java index 19de3faf4640..4e1950379c3f 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsConnectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsConnectSamples.java @@ -10,7 +10,8 @@ public final class CatalogsConnectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Connect.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Connect + * .json */ /** * Sample code: Catalogs_Connect. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsCreateOrUpdateSamples.java index 66a03174e680..c0b9d94380e1 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsCreateOrUpdateSamples.java @@ -14,7 +14,8 @@ public final class CatalogsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_CreateAdo.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Catalogs_CreateAdo.json */ /** * Sample code: Catalogs_CreateOrUpdateAdo. @@ -34,8 +35,8 @@ public static void catalogsCreateOrUpdateAdo(com.azure.resourcemanager.devcenter /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_CreateGitHub. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Catalogs_CreateGitHub.json */ /** * Sample code: Catalogs_CreateOrUpdateGitHub. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsDeleteSamples.java index 862496206864..74bb1ccb05bc 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsDeleteSamples.java @@ -10,7 +10,8 @@ public final class CatalogsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Delete. + * json */ /** * Sample code: Catalogs_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSamples.java index 2608698b4a00..80ec9d36f315 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSamples.java @@ -10,7 +10,8 @@ public final class CatalogsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Get. + * json */ /** * Sample code: Catalogs_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSyncErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSyncErrorDetailsSamples.java index cff3394a8e83..09e4fcf3af9d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSyncErrorDetailsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsGetSyncErrorDetailsSamples.java @@ -9,7 +9,8 @@ */ public final class CatalogsGetSyncErrorDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Catalogs_GetSyncErrorDetails.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsListByDevCenterSamples.java index d9c824db1abf..61da9aaabb59 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsListByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsListByDevCenterSamples.java @@ -10,7 +10,8 @@ public final class CatalogsListByDevCenterSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_List. + * json */ /** * Sample code: Catalogs_ListByDevCenter. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsSyncSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsSyncSamples.java index 74bca6cb50fc..2f6efdf93347 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsSyncSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsSyncSamples.java @@ -10,7 +10,8 @@ public final class CatalogsSyncSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Sync.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Sync. + * json */ /** * Sample code: Catalogs_Sync. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsUpdateSamples.java index 13369ad50d28..d4c3955373f8 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CatalogsUpdateSamples.java @@ -14,7 +14,8 @@ public final class CatalogsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Catalogs_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Catalogs_Patch. + * json */ /** * Sample code: Catalogs_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityExecuteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityExecuteSamples.java index 013272c40052..e095901ae4ee 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityExecuteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityExecuteSamples.java @@ -12,8 +12,8 @@ public final class CheckNameAvailabilityExecuteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/CheckNameAvailability. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CheckNameAvailability.json */ /** * Sample code: NameAvailability. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityExecuteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityExecuteSamples.java index df9c9b181f07..00296ba565e5 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityExecuteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityExecuteSamples.java @@ -11,7 +11,8 @@ */ public final class CheckScopedNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * CheckScopedNameAvailability_ProjectCatalog.json */ /** @@ -29,7 +30,8 @@ public static void projectCatalogNameAvailability(com.azure.resourcemanager.devc } /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * CheckScopedNameAvailability_DevCenterCatalog.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksGetErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksGetErrorDetailsSamples.java new file mode 100644 index 000000000000..91ff257ceeb3 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksGetErrorDetailsSamples.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.devcenter.generated; + +/** + * Samples for CustomizationTasks GetErrorDetails. + */ +public final class CustomizationTasksGetErrorDetailsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CustomizationTasks_GetErrorDetails.json + */ + /** + * Sample code: CustomizationTasks_GetErrorDetails. + * + * @param manager Entry point to DevCenterManager. + */ + public static void customizationTasksGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.customizationTasks() + .getErrorDetailsWithResponse("rg1", "Contoso", "CentralCatalog", "SampleTask", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksGetSamples.java new file mode 100644 index 000000000000..758a9d52403d --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksGetSamples.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.devcenter.generated; + +/** + * Samples for CustomizationTasks Get. + */ +public final class CustomizationTasksGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CustomizationTasks_Get.json + */ + /** + * Sample code: CustomizationTasks_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void customizationTasksGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.customizationTasks() + .getWithResponse("rg1", "Contoso", "CentralCatalog", "SampleTask", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksListByCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksListByCatalogSamples.java new file mode 100644 index 000000000000..9eafc93d9184 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/CustomizationTasksListByCatalogSamples.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.devcenter.generated; + +/** + * Samples for CustomizationTasks ListByCatalog. + */ +public final class CustomizationTasksListByCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * CustomizationTasks_ListByCatalog.json + */ + /** + * Sample code: CustomizationTasks_ListByCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void customizationTasksListByCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.customizationTasks() + .listByCatalog("rg1", "Contoso", "CentralCatalog", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsCreateOrUpdateSamples.java index 08b3ec101dc0..27efdddd2391 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsCreateOrUpdateSamples.java @@ -14,8 +14,8 @@ public final class DevBoxDefinitionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Create. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Create.json */ /** * Sample code: DevBoxDefinitions_Create. @@ -28,7 +28,7 @@ public static void devBoxDefinitionsCreate(com.azure.resourcemanager.devcenter.D .withRegion("centralus") .withExistingDevcenter("rg1", "Contoso") .withImageReference(new ImageReference().withId( - "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/version/1.0.0")) + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/versions/1.0.0")) .withSku(new Sku().withName("Preview")) .withHibernateSupport(HibernateSupport.ENABLED) .create(); diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsDeleteSamples.java index dd6da873d4a3..4b95cae554f3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsDeleteSamples.java @@ -10,8 +10,8 @@ public final class DevBoxDefinitionsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Delete.json */ /** * Sample code: DevBoxDefinitions_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetByProjectSamples.java index 79a44dbfd6be..107cdb61419c 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetByProjectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetByProjectSamples.java @@ -9,7 +9,8 @@ */ public final class DevBoxDefinitionsGetByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevBoxDefinitions_GetByProject.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetSamples.java index e822bc5bb6be..3234b4f553a3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsGetSamples.java @@ -10,8 +10,8 @@ public final class DevBoxDefinitionsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Get. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Get.json */ /** * Sample code: DevBoxDefinitions_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByDevCenterSamples.java index 744826c06791..092f58dfe504 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByDevCenterSamples.java @@ -9,7 +9,8 @@ */ public final class DevBoxDefinitionsListByDevCenterSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevBoxDefinitions_ListByDevCenter.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByProjectSamples.java index c1c8f0276c32..6f5ab8f8c4a1 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByProjectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsListByProjectSamples.java @@ -9,7 +9,8 @@ */ public final class DevBoxDefinitionsListByProjectSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevBoxDefinitions_ListByProject.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsUpdateSamples.java index c520d4f7ea48..4f5577c5a0a0 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionsUpdateSamples.java @@ -13,8 +13,8 @@ public final class DevBoxDefinitionsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevBoxDefinitions_Patch. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevBoxDefinitions_Patch.json */ /** * Sample code: DevBoxDefinitions_Patch. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationCancelSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationCancelSamples.java new file mode 100644 index 000000000000..c947cb417d21 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationCancelSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitionBuildOperation Cancel. + */ +public final class DevCenterCatalogImageDefinitionBuildOperationCancelSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_CancelImageBuild.json + */ + /** + * Sample code: DevCenterImageDefinitionBuilds_CancelByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCenterImageDefinitionBuildsCancelByImageDefinition( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuildOperations() + .cancel("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", "0a28fc61-6f87-4611-8fe2-32df44ab93b7", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationGetBuildDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationGetBuildDetailsSamples.java new file mode 100644 index 000000000000..23e687d2d7f3 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationGetBuildDetailsSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitionBuildOperation GetBuildDetails. + */ +public final class DevCenterCatalogImageDefinitionBuildOperationGetBuildDetailsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_GetImageBuildDetails.json + */ + /** + * Sample code: DevCenterCatalogImageDefinitionBuild_GetErrorDetails. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCenterCatalogImageDefinitionBuildGetErrorDetails( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuildOperations() + .getBuildDetailsWithResponse("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationGetSamples.java new file mode 100644 index 000000000000..1cd598606509 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildOperationGetSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitionBuildOperation Get. + */ +public final class DevCenterCatalogImageDefinitionBuildOperationGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_GetImageBuild.json + */ + /** + * Sample code: DevCenterImageDefinitionBuilds_GetByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCenterImageDefinitionBuildsGetByImageDefinition( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuildOperations() + .getWithResponse("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildsListByImageDefinitionSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildsListByImageDefinitionSamples.java new file mode 100644 index 000000000000..f72b520176be --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionBuildsListByImageDefinitionSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitionBuilds ListByImageDefinition. + */ +public final class DevCenterCatalogImageDefinitionBuildsListByImageDefinitionSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_ListImageBuildsByImageDefinition.json + */ + /** + * Sample code: DevCenterImageDefinitionBuilds_ListByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void devCenterImageDefinitionBuildsListByImageDefinition( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitionBuilds() + .listByImageDefinition("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsBuildImageSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsBuildImageSamples.java new file mode 100644 index 000000000000..3d997eb25799 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsBuildImageSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitions BuildImage. + */ +public final class DevCenterCatalogImageDefinitionsBuildImageSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_BuildImage.json + */ + /** + * Sample code: DevCenterCatalogImageDefinitions_BuildImage. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + devCenterCatalogImageDefinitionsBuildImage(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .buildImage("rg1", "DevDevCenter", "CentralCatalog", "DefaultDevImage", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsGetByDevCenterCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsGetByDevCenterCatalogSamples.java new file mode 100644 index 000000000000..1be22f45bfa4 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsGetByDevCenterCatalogSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitions GetByDevCenterCatalog. + */ +public final class DevCenterCatalogImageDefinitionsGetByDevCenterCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetByDevCenterCatalog.json + */ + /** + * Sample code: ImageDefinitions_GetByDevCenterCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionsGetByDevCenterCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .getByDevCenterCatalogWithResponse("rg1", "ContosoDevCenter", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsGetErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsGetErrorDetailsSamples.java new file mode 100644 index 000000000000..784548abe8fc --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsGetErrorDetailsSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitions GetErrorDetails. + */ +public final class DevCenterCatalogImageDefinitionsGetErrorDetailsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterImageDefinitions_GetErrorDetails.json + */ + /** + * Sample code: DevCenterImageDefinitions_GetErrorDetails. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + devCenterImageDefinitionsGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .getErrorDetailsWithResponse("rg1", "DevDevCenter", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsListByDevCenterCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsListByDevCenterCatalogSamples.java new file mode 100644 index 000000000000..d3746aa38e0b --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCenterCatalogImageDefinitionsListByDevCenterCatalogSamples.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.devcenter.generated; + +/** + * Samples for DevCenterCatalogImageDefinitions ListByDevCenterCatalog. + */ +public final class DevCenterCatalogImageDefinitionsListByDevCenterCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_ListByDevCenterCatalog.json + */ + /** + * Sample code: ImageDefinitions_ListByDevCenterCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionsListByDevCenterCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenterCatalogImageDefinitions() + .listByDevCenterCatalog("rg1", "ContosoDevCenter", "TeamCatalog", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersCreateOrUpdateSamples.java index f75ee7663917..bda06ac25350 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersCreateOrUpdateSamples.java @@ -4,12 +4,18 @@ package com.azure.resourcemanager.devcenter.generated; +import com.azure.resourcemanager.devcenter.models.CatalogItemSyncEnableStatus; import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryption; import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryptionKeyIdentity; +import com.azure.resourcemanager.devcenter.models.DevBoxProvisioningSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterNetworkSettings; +import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; import com.azure.resourcemanager.devcenter.models.Encryption; import com.azure.resourcemanager.devcenter.models.IdentityType; +import com.azure.resourcemanager.devcenter.models.InstallAzureMonitorAgentEnableStatus; import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.MicrosoftHostedNetworkEnableStatus; import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; @@ -20,7 +26,8 @@ public final class DevCentersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Create.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_Create.json */ /** * Sample code: DevCenters_Create. @@ -34,11 +41,43 @@ public static void devCentersCreate(com.azure.resourcemanager.devcenter.DevCente .withExistingResourceGroup("rg1") .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) .withDisplayName("ContosoDevCenter") + .withProjectCatalogSettings(new DevCenterProjectCatalogSettings() + .withCatalogItemSyncEnableStatus(CatalogItemSyncEnableStatus.ENABLED)) + .withDevBoxProvisioningSettings(new DevBoxProvisioningSettings() + .withInstallAzureMonitorAgentEnableStatus(InstallAzureMonitorAgentEnableStatus.ENABLED)) .create(); } /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_CreateWithDisabledManagedNetworks.json + */ + /** + * Sample code: DevCenters_CreateWithDisabledManagedNetworks. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + devCentersCreateWithDisabledManagedNetworks(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.devCenters() + .define("Contoso") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCode", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDisplayName("ContosoDevCenter") + .withNetworkSettings(new DevCenterNetworkSettings() + .withMicrosoftHostedNetworkEnableStatus(MicrosoftHostedNetworkEnableStatus.DISABLED)) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevCenters_CreateWithUserIdentity.json */ /** @@ -61,7 +100,8 @@ public static void devCentersCreateWithUserIdentity(com.azure.resourcemanager.de } /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevCenters_CreateWithEncryption.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersDeleteSamples.java index ded7e9701cd7..3811438b9eec 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersDeleteSamples.java @@ -10,7 +10,8 @@ public final class DevCentersDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenters_Delete.json */ /** * Sample code: DevCenters_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersGetByResourceGroupSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersGetByResourceGroupSamples.java index 0d3ccdccdd77..258686827504 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersGetByResourceGroupSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersGetByResourceGroupSamples.java @@ -10,7 +10,8 @@ public final class DevCentersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/DevCenters_Get. + * json */ /** * Sample code: DevCenters_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListByResourceGroupSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListByResourceGroupSamples.java index eb327530861f..8c14a0ca5e8d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListByResourceGroupSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class DevCentersListByResourceGroupSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevCenters_ListByResourceGroup.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListSamples.java index dd8b35b4fb81..8030b9076cc8 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersListSamples.java @@ -9,7 +9,8 @@ */ public final class DevCentersListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * DevCenters_ListBySubscription.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersUpdateSamples.java index f1bb9bb71fa1..55098ad2cb5b 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/DevCentersUpdateSamples.java @@ -14,7 +14,8 @@ public final class DevCentersUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/DevCenters_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/DevCenters_Patch + * .json */ /** * Sample code: DevCenters_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..cbc12b9d51eb --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsCreateOrUpdateSamples.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.devcenter.generated; + +import com.azure.resourcemanager.devcenter.models.DevboxDisksEncryptionEnableStatus; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EncryptionSets CreateOrUpdate. + */ +public final class EncryptionSetsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Create.json + */ + /** + * Sample code: EncryptionSets_Create. + * + * @param manager Entry point to DevCenterManager. + */ + public static void encryptionSetsCreate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets() + .define("EncryptionWestUs") + .withRegion("westus") + .withExistingDevcenter("rg1", "Contoso") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus.ENABLED) + .withKeyEncryptionKeyUrl("https://contosovaultwestus.vault.azure.net/keys/contosokek") + .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/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsDeleteSamples.java new file mode 100644 index 000000000000..1a994c085978 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsDeleteSamples.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.devcenter.generated; + +/** + * Samples for EncryptionSets Delete. + */ +public final class EncryptionSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Delete.json + */ + /** + * Sample code: EncryptionSets_Delete. + * + * @param manager Entry point to DevCenterManager. + */ + public static void encryptionSetsDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets().delete("rg1", "Contoso", "EncryptionWestUs", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsGetSamples.java new file mode 100644 index 000000000000..f62943217168 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsGetSamples.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.devcenter.generated; + +/** + * Samples for EncryptionSets Get. + */ +public final class EncryptionSetsGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Get.json + */ + /** + * Sample code: EncryptionSets_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void encryptionSetsGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets() + .getWithResponse("rg1", "Contoso", "EncryptionWestUs", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsListSamples.java new file mode 100644 index 000000000000..7281917257f1 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsListSamples.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.devcenter.generated; + +/** + * Samples for EncryptionSets List. + */ +public final class EncryptionSetsListSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_List.json + */ + /** + * Sample code: EncryptionSets_List. + * + * @param manager Entry point to DevCenterManager. + */ + public static void encryptionSetsList(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.encryptionSets().list("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsUpdateSamples.java new file mode 100644 index 000000000000..9c4ac46fea15 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EncryptionSetsUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.generated; + +import com.azure.resourcemanager.devcenter.models.DevCenterEncryptionSet; +import com.azure.resourcemanager.devcenter.models.DevboxDisksEncryptionEnableStatus; + +/** + * Samples for EncryptionSets Update. + */ +public final class EncryptionSetsUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * DevCenterEncryptionSets_Patch.json + */ + /** + * Sample code: EncryptionSets_Update. + * + * @param manager Entry point to DevCenterManager. + */ + public static void encryptionSetsUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + DevCenterEncryptionSet resource = manager.encryptionSets() + .getWithResponse("rg1", "Contoso", "EncryptionWestUs", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withDevboxDisksEncryptionEnableStatus(DevboxDisksEncryptionEnableStatus.ENABLED).apply(); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogSamples.java index e690157e7c4a..20d4f57f5475 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogSamples.java @@ -9,7 +9,8 @@ */ public final class EnvironmentDefinitionsGetByProjectCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * EnvironmentDefinitions_GetByProjectCatalog.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetErrorDetailsSamples.java index 4d14a1bb1576..dba6a6664aed 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetErrorDetailsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetErrorDetailsSamples.java @@ -9,7 +9,8 @@ */ public final class EnvironmentDefinitionsGetErrorDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * EnvironmentDefinitions_GetErrorDetails.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetSamples.java index 4dfeabf86854..cfa24245ef6b 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetSamples.java @@ -9,7 +9,8 @@ */ public final class EnvironmentDefinitionsGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * EnvironmentDefinitions_Get.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogSamples.java index 44a321ae8012..b027214635a1 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogSamples.java @@ -9,7 +9,8 @@ */ public final class EnvironmentDefinitionsListByCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * EnvironmentDefinitions_ListByCatalog.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogSamples.java index 81734826fe5a..defd1f5fbcd5 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogSamples.java @@ -9,7 +9,8 @@ */ public final class EnvironmentDefinitionsListByProjectCatalogSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * EnvironmentDefinitions_ListByProjectCatalog.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateSamples.java index 8860246caf7c..3a9eb0ac1831 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateSamples.java @@ -13,7 +13,8 @@ public final class EnvironmentTypesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Put.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Put.json */ /** * Sample code: EnvironmentTypes_CreateOrUpdate. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteSamples.java index 95339a2d5d21..5511dae48c88 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteSamples.java @@ -10,8 +10,8 @@ public final class EnvironmentTypesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Delete.json */ /** * Sample code: EnvironmentTypes_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetSamples.java index 61480f04a6d9..78e20d69dd55 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetSamples.java @@ -10,7 +10,8 @@ public final class EnvironmentTypesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Get.json */ /** * Sample code: EnvironmentTypes_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterSamples.java index 188761f4ab5c..bfcce42329c6 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterSamples.java @@ -10,8 +10,8 @@ public final class EnvironmentTypesListByDevCenterSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_List. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_List.json */ /** * Sample code: EnvironmentTypes_ListByDevCenter. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesUpdateSamples.java index 4dd4edd6eb19..656f0a928ed1 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesUpdateSamples.java @@ -14,8 +14,8 @@ public final class EnvironmentTypesUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/EnvironmentTypes_Patch. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * EnvironmentTypes_Patch.json */ /** * Sample code: EnvironmentTypes_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateSamples.java index 97d85a47ffaf..1bb6b03c37e2 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateSamples.java @@ -10,7 +10,8 @@ public final class GalleriesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_Create.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_Create + * .json */ /** * Sample code: Galleries_CreateOrUpdate. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesDeleteSamples.java index 0e19213a9f1d..7cb66fbbbdc4 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesDeleteSamples.java @@ -10,7 +10,8 @@ public final class GalleriesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_Delete + * .json */ /** * Sample code: Galleries_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetSamples.java index 1e0e5c5e1152..44f818499dea 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetSamples.java @@ -10,7 +10,8 @@ public final class GalleriesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_Get. + * json */ /** * Sample code: Galleries_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterSamples.java index d1f27d9f276b..3524337281e3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterSamples.java @@ -10,7 +10,8 @@ public final class GalleriesListByDevCenterSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Galleries_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Galleries_List. + * json */ /** * Sample code: Galleries_ListByDevCenter. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetByProjectSamples.java new file mode 100644 index 000000000000..c1ec51474de2 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetByProjectSamples.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.devcenter.generated; + +/** + * Samples for ImageVersions GetByProject. + */ +public final class ImageVersionsGetByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_GetByProject.json + */ + /** + * Sample code: ImageVersions_GetByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imageVersionsGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.imageVersions() + .getByProjectWithResponse("rg1", "myProject", "~gallery~DefaultDevGallery~ContosoImageDefinition", "1.0.0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetSamples.java index 8362354af59d..926ef77c7432 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetSamples.java @@ -10,7 +10,8 @@ public final class ImageVersionsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ImageVersions_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_Get.json */ /** * Sample code: Versions_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageSamples.java index 6c494859158f..05af9e0e1ba4 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageSamples.java @@ -10,7 +10,8 @@ public final class ImageVersionsListByImageSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ImageVersions_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_List.json */ /** * Sample code: ImageVersions_ListByImage. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByProjectSamples.java new file mode 100644 index 000000000000..a6a5cd2c25fa --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByProjectSamples.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.devcenter.generated; + +/** + * Samples for ImageVersions ListByProject. + */ +public final class ImageVersionsListByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageVersions_ListByProject.json + */ + /** + * Sample code: ImageVersions_ListByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imageVersionsListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.imageVersions() + .listByProject("rg1", "myProject", "~gallery~DefaultDevGallery~ContosoImageDefinition", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetByProjectSamples.java new file mode 100644 index 000000000000..41458b5e33cf --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetByProjectSamples.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.devcenter.generated; + +/** + * Samples for Images GetByProject. + */ +public final class ImagesGetByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_GetByProject.json + */ + /** + * Sample code: Images_GetByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imagesGetByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images() + .getByProjectWithResponse("rg1", "myProject", "~gallery~DefaultDevGallery~ContosoBaseImage", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetSamples.java index 3d465648dd85..e41743cac214 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesGetSamples.java @@ -10,7 +10,7 @@ public final class ImagesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Images_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Images_Get.json */ /** * Sample code: Images_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterSamples.java index fecbafdc63f6..6af8a1347d65 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterSamples.java @@ -10,8 +10,8 @@ public final class ImagesListByDevCenterSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Images_ListByDevCenter. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_ListByDevCenter.json */ /** * Sample code: Images_ListByDevCenter. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGallerySamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGallerySamples.java index 9d40caf98955..f5f713d46bbc 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGallerySamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGallerySamples.java @@ -10,7 +10,8 @@ public final class ImagesListByGallerySamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Images_ListByGallery.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_ListByGallery.json */ /** * Sample code: Images_ListByGallery. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByProjectSamples.java new file mode 100644 index 000000000000..7141e9ab4969 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ImagesListByProjectSamples.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.devcenter.generated; + +/** + * Samples for Images ListByProject. + */ +public final class ImagesListByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Images_ListByProject.json + */ + /** + * Sample code: Images_ListByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void imagesListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.images().listByProject("rg1", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsCreateOrUpdateSamples.java index 7b467ee09eb7..3ac7ffabbc40 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsCreateOrUpdateSamples.java @@ -12,8 +12,8 @@ public final class NetworkConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Put. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Put.json */ /** * Sample code: NetworkConnections_CreateOrUpdate. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsDeleteSamples.java index 1a83f3894bec..46a0d85fb852 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsDeleteSamples.java @@ -10,8 +10,8 @@ public final class NetworkConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Delete - * .json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Delete.json */ /** * Sample code: NetworkConnections_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetByResourceGroupSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetByResourceGroupSamples.java index 9a7173948ca2..e9b7c71247b7 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetByResourceGroupSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class NetworkConnectionsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Get. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Get.json */ /** * Sample code: NetworkConnections_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsSamples.java index 1becec1703f6..772e6a9a4200 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsSamples.java @@ -9,7 +9,8 @@ */ public final class NetworkConnectionsGetHealthDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * NetworkConnections_GetHealthDetails.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListByResourceGroupSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListByResourceGroupSamples.java index 3cddecc81ff2..aad9bd9d0143 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListByResourceGroupSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class NetworkConnectionsListByResourceGroupSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * NetworkConnections_ListByResourceGroup.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsSamples.java index 850a3ae703f2..dc5828337c90 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsSamples.java @@ -9,7 +9,8 @@ */ public final class NetworkConnectionsListHealthDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * NetworkConnections_ListHealthDetails.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples.java index d2dbf0a12760..f59cf05069f7 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples.java @@ -9,7 +9,8 @@ */ public final class NetworkConnectionsListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * NetworkConnections_ListOutboundNetworkDependenciesEndpoints.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListSamples.java index b7f50ef581b0..3229bcac2e69 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListSamples.java @@ -9,7 +9,8 @@ */ public final class NetworkConnectionsListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * NetworkConnections_ListBySubscription.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsRunHealthChecksSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsRunHealthChecksSamples.java index e152d21539ed..86b9d0793d69 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsRunHealthChecksSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsRunHealthChecksSamples.java @@ -9,7 +9,8 @@ */ public final class NetworkConnectionsRunHealthChecksSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * NetworkConnections_RunHealthChecks.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsUpdateSamples.java index 115225c51c99..5e973e000968 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsUpdateSamples.java @@ -12,8 +12,8 @@ public final class NetworkConnectionsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/NetworkConnections_Patch. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * NetworkConnections_Patch.json */ /** * Sample code: NetworkConnections_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationStatusesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationStatusesGetSamples.java index 0eba70bb30ff..2ee1e9821c02 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationStatusesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationStatusesGetSamples.java @@ -10,7 +10,8 @@ public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/OperationStatus_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * OperationStatus_Get.json */ /** * Sample code: Get OperationStatus. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationsListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationsListSamples.java index b97af2b5fda9..864feb047794 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationsListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/OperationsListSamples.java @@ -10,7 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Operations_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Operations_Get. + * json */ /** * Sample code: Operations_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsCreateOrUpdateSamples.java index b070516c2724..59f8dabdee89 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsCreateOrUpdateSamples.java @@ -4,11 +4,20 @@ package com.azure.resourcemanager.devcenter.generated; +import com.azure.resourcemanager.devcenter.models.ActiveHoursConfiguration; +import com.azure.resourcemanager.devcenter.models.AutoStartEnableStatus; +import com.azure.resourcemanager.devcenter.models.ImageReference; +import com.azure.resourcemanager.devcenter.models.KeepAwakeEnableStatus; import com.azure.resourcemanager.devcenter.models.LicenseType; import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinition; +import com.azure.resourcemanager.devcenter.models.PoolDevBoxDefinitionType; import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; +import com.azure.resourcemanager.devcenter.models.Sku; import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectConfiguration; +import com.azure.resourcemanager.devcenter.models.StopOnNoConnectEnableStatus; import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; import java.util.Arrays; @@ -18,7 +27,41 @@ public final class PoolsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Put.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_PutWithValueDevBoxDefinition.json + */ + /** + * Sample code: Pools_CreateOrUpdateWithValueDevBoxDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + poolsCreateOrUpdateWithValueDevBoxDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.pools() + .define("DevPool") + .withRegion("centralus") + .withExistingProject("rg1", "DevProject") + .withDevBoxDefinitionType(PoolDevBoxDefinitionType.VALUE) + .withDevBoxDefinitionName("") + .withDevBoxDefinition(new PoolDevBoxDefinition().withImageReference(new ImageReference().withId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/projects/DevProject/images/exampleImage/version/1.0.0")) + .withSku(new Sku().withName("Preview"))) + .withNetworkConnectionName("Network1-westus2") + .withLicenseType(LicenseType.WINDOWS_CLIENT) + .withLocalAdministrator(LocalAdminStatus.ENABLED) + .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) + .withGracePeriodMinutes(60)) + .withStopOnNoConnect(new StopOnNoConnectConfiguration().withStatus(StopOnNoConnectEnableStatus.ENABLED) + .withGracePeriodMinutes(120)) + .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) + .withDisplayName("Developer Pool") + .withVirtualNetworkType(VirtualNetworkType.UNMANAGED) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Put.json */ /** * Sample code: Pools_CreateOrUpdate. @@ -36,14 +79,23 @@ public static void poolsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCe .withLocalAdministrator(LocalAdminStatus.ENABLED) .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) .withGracePeriodMinutes(60)) + .withStopOnNoConnect(new StopOnNoConnectConfiguration().withStatus(StopOnNoConnectEnableStatus.ENABLED) + .withGracePeriodMinutes(120)) .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) .withDisplayName("Developer Pool") .withVirtualNetworkType(VirtualNetworkType.UNMANAGED) + .withActiveHoursConfiguration( + new ActiveHoursConfiguration().withKeepAwakeEnableStatus(KeepAwakeEnableStatus.ENABLED) + .withAutoStartEnableStatus(AutoStartEnableStatus.ENABLED) + .withDefaultTimeZone("America/Los_Angeles") + .withDefaultStartTimeHour(9) + .withDefaultEndTimeHour(17)) .create(); } /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Pools_PutWithManagedNetwork.json */ /** @@ -63,6 +115,8 @@ public static void poolsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCe .withLocalAdministrator(LocalAdminStatus.ENABLED) .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) .withGracePeriodMinutes(60)) + .withStopOnNoConnect(new StopOnNoConnectConfiguration().withStatus(StopOnNoConnectEnableStatus.ENABLED) + .withGracePeriodMinutes(120)) .withSingleSignOnStatus(SingleSignOnStatus.DISABLED) .withDisplayName("Developer Pool") .withVirtualNetworkType(VirtualNetworkType.MANAGED) diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsDeleteSamples.java index 223c250bd530..fe10207ff72c 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsDeleteSamples.java @@ -10,7 +10,8 @@ public final class PoolsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Delete. + * json */ /** * Sample code: Pools_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsGetSamples.java index 7d25b75c6a3c..dfac204d5481 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsGetSamples.java @@ -10,8 +10,8 @@ public final class PoolsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_GetUnhealthyStatus. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_GetUnhealthyStatus.json */ /** * Sample code: Pools_GetUnhealthyStatus. @@ -24,7 +24,7 @@ public static void poolsGetUnhealthyStatus(com.azure.resourcemanager.devcenter.D /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Get.json */ /** * Sample code: Pools_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsListByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsListByProjectSamples.java index 50945ad433e6..d9a7d7f3070f 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsListByProjectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsListByProjectSamples.java @@ -10,7 +10,7 @@ public final class PoolsListByProjectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_List.json */ /** * Sample code: Pools_ListByProject. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsRunHealthChecksSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsRunHealthChecksSamples.java index 445d6fa00e48..fadea7f0a4d8 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsRunHealthChecksSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsRunHealthChecksSamples.java @@ -10,8 +10,8 @@ public final class PoolsRunHealthChecksSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_RunHealthChecks. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Pools_RunHealthChecks.json */ /** * Sample code: Pools_RefreshStatus. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsUpdateSamples.java index 8e1273283c66..8af5dd1c9fb1 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/PoolsUpdateSamples.java @@ -12,7 +12,7 @@ public final class PoolsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Pools_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Pools_Patch.json */ /** * Sample code: Pools_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetSamples.java index b417dfadcfc1..a9cbbd45441a 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectAllowedEnvironmentTypesGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectAllowedEnvironmentTypes_Get.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListSamples.java index b6e86a8b1796..c977621bb0ad 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectAllowedEnvironmentTypesListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectAllowedEnvironmentTypes_List.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples.java index 97086323c595..cb8b61b7ad22 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectCatalogEnvironmentDefinitionsGetErrorDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectCatalogEnvironmentDefinitions_GetErrorDetails.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationCancelSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationCancelSamples.java new file mode 100644 index 000000000000..2e6d4c7822c0 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationCancelSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitionBuildOperation Cancel. + */ +public final class ProjectCatalogImageDefinitionBuildOperationCancelSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_CancelImageBuild.json + */ + /** + * Sample code: ImageDefinitionBuilds_CancelByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionBuildsCancelByImageDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuildOperations() + .cancel("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", "0a28fc61-6f87-4611-8fe2-32df44ab93b7", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationGetBuildDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationGetBuildDetailsSamples.java new file mode 100644 index 000000000000..ae4abb29e5cd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationGetBuildDetailsSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitionBuildOperation GetBuildDetails. + */ +public final class ProjectCatalogImageDefinitionBuildOperationGetBuildDetailsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetImageBuildDetails.json + */ + /** + * Sample code: ProjectCatalogImageDefinitionBuild_GetErrorDetails. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectCatalogImageDefinitionBuildGetErrorDetails( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuildOperations() + .getBuildDetailsWithResponse("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationGetSamples.java new file mode 100644 index 000000000000..47659ca9647d --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildOperationGetSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitionBuildOperation Get. + */ +public final class ProjectCatalogImageDefinitionBuildOperationGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetImageBuild.json + */ + /** + * Sample code: ImageDefinitionBuilds_GetByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionBuildsGetByImageDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuildOperations() + .getWithResponse("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", + "0a28fc61-6f87-4611-8fe2-32df44ab93b7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildsListByImageDefinitionSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildsListByImageDefinitionSamples.java new file mode 100644 index 000000000000..618d95cf02c7 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionBuildsListByImageDefinitionSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitionBuilds ListByImageDefinition. + */ +public final class ProjectCatalogImageDefinitionBuildsListByImageDefinitionSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_ListImageBuildsByImageDefinition.json + */ + /** + * Sample code: ImageDefinitionBuilds_ListByImageDefinition. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionBuildsListByImageDefinition(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitionBuilds() + .listByImageDefinition("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsBuildImageSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsBuildImageSamples.java new file mode 100644 index 000000000000..16ab4551c4db --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsBuildImageSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitions BuildImage. + */ +public final class ProjectCatalogImageDefinitionsBuildImageSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_BuildImage.json + */ + /** + * Sample code: ProjectCatalogImageDefinitions_BuildImage. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + projectCatalogImageDefinitionsBuildImage(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .buildImage("rg1", "DevProject", "CentralCatalog", "DefaultDevImage", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsGetByProjectCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsGetByProjectCatalogSamples.java new file mode 100644 index 000000000000..09a98e1c8fac --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsGetByProjectCatalogSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitions GetByProjectCatalog. + */ +public final class ProjectCatalogImageDefinitionsGetByProjectCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_GetByProjectCatalog.json + */ + /** + * Sample code: ImageDefinitions_GetByProjectCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionsGetByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .getByProjectCatalogWithResponse("rg1", "ContosoProject", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsGetErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsGetErrorDetailsSamples.java new file mode 100644 index 000000000000..1832dc15a51a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsGetErrorDetailsSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitions GetErrorDetails. + */ +public final class ProjectCatalogImageDefinitionsGetErrorDetailsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogImageDefinitions_GetErrorDetails.json + */ + /** + * Sample code: ProjectCatalogImageDefinitions_GetErrorDetails. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + projectCatalogImageDefinitionsGetErrorDetails(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .getErrorDetailsWithResponse("rg1", "DevProject", "TeamCatalog", "WebDevBox", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsListByProjectCatalogSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsListByProjectCatalogSamples.java new file mode 100644 index 000000000000..37265d0cbda0 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogImageDefinitionsListByProjectCatalogSamples.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.devcenter.generated; + +/** + * Samples for ProjectCatalogImageDefinitions ListByProjectCatalog. + */ +public final class ProjectCatalogImageDefinitionsListByProjectCatalogSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ImageDefinitions_ListByProjectCatalog.json + */ + /** + * Sample code: ImageDefinitions_ListByProjectCatalog. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + imageDefinitionsListByProjectCatalog(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectCatalogImageDefinitions() + .listByProjectCatalog("rg1", "ContosoProject", "TeamCatalog", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsConnectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsConnectSamples.java index ef015c8d6f8c..01404e279a04 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsConnectSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsConnectSamples.java @@ -10,8 +10,8 @@ public final class ProjectCatalogsConnectSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Connect. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Connect.json */ /** * Sample code: ProjectCatalogs_Connect. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsCreateOrUpdateSamples.java index c5e6e05a554d..ebd5a858654a 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsCreateOrUpdateSamples.java @@ -12,8 +12,8 @@ public final class ProjectCatalogsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_CreateAdo - * .json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_CreateAdo.json */ /** * Sample code: ProjectCatalogs_CreateOrUpdateAdo. @@ -33,7 +33,8 @@ public static void projectCatalogsCreateOrUpdateAdo(com.azure.resourcemanager.de } /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectCatalogs_CreateGitHub.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsDeleteSamples.java index a36c4a9f0741..60bbcb374cd3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsDeleteSamples.java @@ -10,8 +10,8 @@ public final class ProjectCatalogsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Delete. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Delete.json */ /** * Sample code: ProjectCatalogs_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSamples.java index 0ea0ddef1bf4..42fb1510857a 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSamples.java @@ -10,7 +10,8 @@ public final class ProjectCatalogsGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Get.json */ /** * Sample code: ProjectCatalogs_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSyncErrorDetailsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSyncErrorDetailsSamples.java index fa96789ce9c7..25cf84706d97 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSyncErrorDetailsSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsGetSyncErrorDetailsSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectCatalogsGetSyncErrorDetailsSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectCatalogs_GetSyncErrorDetails.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsListSamples.java index c60234e7883e..3ecf68d1a1af 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsListSamples.java @@ -10,7 +10,8 @@ public final class ProjectCatalogsListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_List.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_List.json */ /** * Sample code: ProjectCatalogs_List. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsPatchSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsPatchSamples.java index e5c53a36efda..e44135d9781f 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsPatchSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsPatchSamples.java @@ -13,8 +13,8 @@ public final class ProjectCatalogsPatchSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Patch. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Patch.json */ /** * Sample code: ProjectCatalogs_Patch. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsSyncSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsSyncSamples.java index 0d7da836961a..4637d0cb15a7 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsSyncSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogsSyncSamples.java @@ -10,7 +10,8 @@ public final class ProjectCatalogsSyncSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ProjectCatalogs_Sync.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectCatalogs_Sync.json */ /** * Sample code: ProjectCatalogs_Sync. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateSamples.java index 9ebcee5aff19..f772e2896a19 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateSamples.java @@ -19,7 +19,8 @@ */ public final class ProjectEnvironmentTypesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectEnvironmentTypes_Put.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteSamples.java index 6f5dc048b4b2..8a276670f377 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectEnvironmentTypesDeleteSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectEnvironmentTypes_Delete.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetSamples.java index bc623d2fa534..815149a500b3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectEnvironmentTypesGetSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectEnvironmentTypes_Get.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListSamples.java index 844fc349cd93..b351d33efef3 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectEnvironmentTypesListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectEnvironmentTypes_List.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesUpdateSamples.java index 5e3524aee60a..5030bc093ba8 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesUpdateSamples.java @@ -19,7 +19,8 @@ */ public final class ProjectEnvironmentTypesUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * ProjectEnvironmentTypes_Patch.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7ef2dda25afd --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.generated; + +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.util.Arrays; + +/** + * Samples for ProjectPolicies CreateOrUpdate. + */ +public final class ProjectPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Put.json + */ + /** + * Sample code: ProjectPolicies_CreateOrUpdate. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies() + .define("DevOnlyResources") + .withExistingDevcenter("rg1", "Contoso") + .withResourcePolicies(Arrays.asList(new ResourcePolicy().withResources( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff1/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso/attachednetworks/network-westus3"))) + .withScopes(Arrays.asList( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff1/resourceGroups/rg1/providers/Microsoft.DevCenter/projects/DevProject")) + .create(); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesDeleteSamples.java new file mode 100644 index 000000000000..9c54052b5bf8 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesDeleteSamples.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.devcenter.generated; + +/** + * Samples for ProjectPolicies Delete. + */ +public final class ProjectPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Delete.json + */ + /** + * Sample code: ProjectPolicies_Delete. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesDelete(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies().delete("rg1", "Contoso", "DevOnlyResources", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesGetSamples.java new file mode 100644 index 000000000000..cf561fc4cff1 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesGetSamples.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.devcenter.generated; + +/** + * Samples for ProjectPolicies Get. + */ +public final class ProjectPoliciesGetSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Get.json + */ + /** + * Sample code: ProjectPolicies_Get. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesGet(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies() + .getWithResponse("rg1", "Contoso", "DevOnlyResources", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesListByDevCenterSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesListByDevCenterSamples.java new file mode 100644 index 000000000000..4e461340209a --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesListByDevCenterSamples.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.devcenter.generated; + +/** + * Samples for ProjectPolicies ListByDevCenter. + */ +public final class ProjectPoliciesListByDevCenterSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_ListByDevCenter.json + */ + /** + * Sample code: ProjectPolicies_ListByDevCenter. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesListByDevCenter(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projectPolicies().listByDevCenter("rg1", "Contoso", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesUpdateSamples.java new file mode 100644 index 000000000000..bb74d7b28b50 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectPoliciesUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devcenter.generated; + +import com.azure.resourcemanager.devcenter.models.ProjectPolicy; +import com.azure.resourcemanager.devcenter.models.ResourcePolicy; +import java.util.Arrays; + +/** + * Samples for ProjectPolicies Update. + */ +public final class ProjectPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * ProjectPolicies_Patch.json + */ + /** + * Sample code: ProjectPolicies_Update. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectPoliciesUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + ProjectPolicy resource = manager.projectPolicies() + .getWithResponse("rg1", "Contoso", "DevOnlyResources", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withResourcePolicies(Arrays.asList(new ResourcePolicy().withResources( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff1/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso/attachednetworks/network-westus3"))) + .apply(); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateSamples.java index 6af55ec771c9..2380ed8667e6 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateSamples.java @@ -4,6 +4,13 @@ package com.azure.resourcemanager.devcenter.generated; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; +import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationIdentityType; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationManagedIdentity; +import com.azure.resourcemanager.devcenter.models.ProjectCustomizationSettings; +import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -12,7 +19,8 @@ */ public final class ProjectsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Projects_PutWithMaxDevBoxPerUser.json */ /** @@ -36,7 +44,67 @@ public final class ProjectsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Put.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_PutWithCustomizationSettings.json + */ + /** + * Sample code: Projects_CreateOrUpdateWithCustomizationSettings. + * + * @param manager Entry point to DevCenterManager. + */ + public static void + projectsCreateOrUpdateWithCustomizationSettings(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects() + .define("DevProject") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCenter", "R&D")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1", + new UserAssignedIdentity()))) + .withDevCenterId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") + .withDescription("This is my first project.") + .withCustomizationSettings(new ProjectCustomizationSettings() + .withIdentities(Arrays.asList(new ProjectCustomizationManagedIdentity() + .withIdentityType(ProjectCustomizationIdentityType.USER_ASSIGNED_IDENTITY) + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_PutWithCustomizationSettings_SystemIdentity.json + */ + /** + * Sample code: Projects_CreateOrUpdateWithCustomizationSettings_SystemIdentity. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectsCreateOrUpdateWithCustomizationSettingsSystemIdentity( + com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects() + .define("DevProject") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("CostCenter", "R&D")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withDevCenterId( + "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso") + .withDescription("This is my first project.") + .withCustomizationSettings(new ProjectCustomizationSettings() + .withIdentities(Arrays.asList(new ProjectCustomizationManagedIdentity() + .withIdentityType(ProjectCustomizationIdentityType.SYSTEM_ASSIGNED_IDENTITY)))) + .create(); + } + + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Put. + * json */ /** * Sample code: Projects_CreateOrUpdate. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsDeleteSamples.java index 20feda83cb98..e9c67b59bb82 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsDeleteSamples.java @@ -10,7 +10,8 @@ public final class ProjectsDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Delete. + * json */ /** * Sample code: Projects_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupSamples.java index 409f16a8f9fe..98474e93f007 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupSamples.java @@ -10,7 +10,8 @@ public final class ProjectsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Get. + * json */ /** * Sample code: Projects_Get. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetInheritedSettingsSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetInheritedSettingsSamples.java new file mode 100644 index 000000000000..f32867f133e8 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetInheritedSettingsSamples.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.devcenter.generated; + +/** + * Samples for Projects GetInheritedSettings. + */ +public final class ProjectsGetInheritedSettingsSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Projects_GetInheritedSettings.json + */ + /** + * Sample code: Projects_GetInheritedSettings. + * + * @param manager Entry point to DevCenterManager. + */ + public static void projectsGetInheritedSettings(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.projects().getInheritedSettingsWithResponse("rg1", "Contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupSamples.java index 857d030ef7a9..a1e8b4ee503b 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectsListByResourceGroupSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Projects_ListByResourceGroup.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListSamples.java index 451311e715f9..4b7a73da2d32 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsListSamples.java @@ -9,7 +9,8 @@ */ public final class ProjectsListSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Projects_ListBySubscription.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsUpdateSamples.java index d2dd0c87fdca..79daf0f29818 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/ProjectsUpdateSamples.java @@ -17,7 +17,8 @@ public final class ProjectsUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Projects_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Projects_Patch. + * json */ /** * Sample code: Projects_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateSamples.java index 38785520d811..df9bb966f408 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateSamples.java @@ -13,7 +13,8 @@ */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/ + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ * Schedules_CreateDailyShutdownPoolSchedule.json */ /** diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesDeleteSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesDeleteSamples.java index 113e72f12f05..977738a7dd63 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesDeleteSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesDeleteSamples.java @@ -10,7 +10,8 @@ public final class SchedulesDeleteSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Delete.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Schedules_Delete + * .json */ /** * Sample code: Schedules_Delete. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetSamples.java index a6fd3b460857..435ca004f595 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetSamples.java @@ -10,7 +10,8 @@ public final class SchedulesGetSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Get.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Schedules_Get. + * json */ /** * Sample code: Schedules_GetByPool. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolSamples.java index d7a8528cd556..8ba97b99a57b 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolSamples.java @@ -10,7 +10,8 @@ public final class SchedulesListByPoolSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_ListByPool.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Schedules_ListByPool.json */ /** * Sample code: Schedules_ListByPool. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesUpdateSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesUpdateSamples.java index cacb3e4ee55a..c01e6d40a47c 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesUpdateSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SchedulesUpdateSamples.java @@ -12,7 +12,8 @@ public final class SchedulesUpdateSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Schedules_Patch.json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/Schedules_Patch. + * json */ /** * Sample code: Schedules_Update. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListByProjectSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListByProjectSamples.java new file mode 100644 index 000000000000..c29ad4eb52c2 --- /dev/null +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListByProjectSamples.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.devcenter.generated; + +/** + * Samples for Skus ListByProject. + */ +public final class SkusListByProjectSamples { + /* + * x-ms-original-file: + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Skus_ListByProject.json + */ + /** + * Sample code: Skus_ListByProject. + * + * @param manager Entry point to DevCenterManager. + */ + public static void skusListByProject(com.azure.resourcemanager.devcenter.DevCenterManager manager) { + manager.skus().listByProject("rg1", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListSamples.java index ad929ab6e351..578acc08ceab 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/SkusListSamples.java @@ -10,8 +10,8 @@ public final class SkusListSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Skus_ListBySubscription. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Skus_ListBySubscription.json */ /** * Sample code: Skus_ListBySubscription. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationSamples.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationSamples.java index 24b643222721..cee15d11967d 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationSamples.java +++ b/sdk/devcenter/azure-resourcemanager-devcenter/src/samples/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationSamples.java @@ -10,8 +10,8 @@ public final class UsagesListByLocationSamples { /* * x-ms-original-file: - * specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2024-02-01/examples/Usages_ListByLocation. - * json + * specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-04-01-preview/examples/ + * Usages_ListByLocation.json */ /** * Sample code: listUsages. diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypeInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypeInnerTests.java deleted file mode 100644 index f40f87d27a04..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypeInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.AllowedEnvironmentTypeInner; - -public final class AllowedEnvironmentTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedEnvironmentTypeInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"hzxct\"},\"id\":\"gbkdmoizpos\",\"name\":\"mgrcfbu\",\"type\":\"rmfqjhhkxbpvj\"}") - .toObject(AllowedEnvironmentTypeInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedEnvironmentTypeInner model = new AllowedEnvironmentTypeInner(); - model = BinaryData.fromObject(model).toObject(AllowedEnvironmentTypeInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypeListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypeListResultTests.java deleted file mode 100644 index 43df41073b80..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypeListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.AllowedEnvironmentTypeListResult; - -public final class AllowedEnvironmentTypeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedEnvironmentTypeListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"StorageProvisioningFailed\",\"displayName\":\"xyawj\"},\"id\":\"aq\",\"name\":\"slyjpkiid\",\"type\":\"yexz\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"hnrztfol\"},\"id\":\"nxknalaulp\",\"name\":\"ggdtpnapnyiro\",\"type\":\"uhpigvp\"},{\"properties\":{\"provisioningState\":\"TransientFailure\",\"displayName\":\"git\"},\"id\":\"edjvcslynqw\",\"name\":\"ncw\",\"type\":\"zhxgktrmgucn\"},{\"properties\":{\"provisioningState\":\"NotSpecified\",\"displayName\":\"oellwp\"},\"id\":\"d\",\"name\":\"gpfqbuace\",\"type\":\"pzfqrhhuaoppp\"}],\"nextLink\":\"eqx\"}") - .toObject(AllowedEnvironmentTypeListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedEnvironmentTypeListResult model = new AllowedEnvironmentTypeListResult(); - model = BinaryData.fromObject(model).toObject(AllowedEnvironmentTypeListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypePropertiesTests.java deleted file mode 100644 index 1eab05a05ea4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AllowedEnvironmentTypePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.AllowedEnvironmentTypeProperties; - -public final class AllowedEnvironmentTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedEnvironmentTypeProperties model - = BinaryData.fromString("{\"provisioningState\":\"Updated\",\"displayName\":\"xxjyngudivkrtsw\"}") - .toObject(AllowedEnvironmentTypeProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedEnvironmentTypeProperties model = new AllowedEnvironmentTypeProperties(); - model = BinaryData.fromObject(model).toObject(AllowedEnvironmentTypeProperties.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkConnectionInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkConnectionInnerTests.java deleted file mode 100644 index eea1f6b395fe..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkConnectionInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.AttachedNetworkConnectionInner; -import org.junit.jupiter.api.Assertions; - -public final class AttachedNetworkConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedNetworkConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Created\",\"networkConnectionId\":\"qpteeh\",\"networkConnectionLocation\":\"vypyqrimzinpv\",\"healthCheckStatus\":\"Unknown\",\"domainJoinType\":\"AzureADJoin\"},\"id\":\"rsoodqxhcrmnoh\",\"name\":\"t\",\"type\":\"kwh\"}") - .toObject(AttachedNetworkConnectionInner.class); - Assertions.assertEquals("qpteeh", model.networkConnectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedNetworkConnectionInner model = new AttachedNetworkConnectionInner().withNetworkConnectionId("qpteeh"); - model = BinaryData.fromObject(model).toObject(AttachedNetworkConnectionInner.class); - Assertions.assertEquals("qpteeh", model.networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkConnectionPropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkConnectionPropertiesTests.java deleted file mode 100644 index e729c61d4df9..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkConnectionPropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.AttachedNetworkConnectionProperties; -import org.junit.jupiter.api.Assertions; - -public final class AttachedNetworkConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedNetworkConnectionProperties model = BinaryData.fromString( - "{\"provisioningState\":\"RolloutInProgress\",\"networkConnectionId\":\"ifiyipjxsqwpgrj\",\"networkConnectionLocation\":\"norcjxvsnbyxqab\",\"healthCheckStatus\":\"Running\",\"domainJoinType\":\"HybridAzureADJoin\"}") - .toObject(AttachedNetworkConnectionProperties.class); - Assertions.assertEquals("ifiyipjxsqwpgrj", model.networkConnectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedNetworkConnectionProperties model - = new AttachedNetworkConnectionProperties().withNetworkConnectionId("ifiyipjxsqwpgrj"); - model = BinaryData.fromObject(model).toObject(AttachedNetworkConnectionProperties.class); - Assertions.assertEquals("ifiyipjxsqwpgrj", model.networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkListResultTests.java deleted file mode 100644 index c998b65715f6..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworkListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.AttachedNetworkListResult; - -public final class AttachedNetworkListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AttachedNetworkListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"networkConnectionId\":\"qfprwzwbn\",\"networkConnectionLocation\":\"itnwuizgazxufi\",\"healthCheckStatus\":\"Unknown\",\"domainJoinType\":\"HybridAzureADJoin\"},\"id\":\"i\",\"name\":\"rfidfvzwdz\",\"type\":\"htymw\"},{\"properties\":{\"provisioningState\":\"Failed\",\"networkConnectionId\":\"fthwxmnteiwa\",\"networkConnectionLocation\":\"vkmijcmmxdcuf\",\"healthCheckStatus\":\"Failed\",\"domainJoinType\":\"AzureADJoin\"},\"id\":\"mzidnsezcxtb\",\"name\":\"sgfyccsnew\",\"type\":\"dwzjeiach\"}],\"nextLink\":\"osfln\"}") - .toObject(AttachedNetworkListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AttachedNetworkListResult model = new AttachedNetworkListResult(); - model = BinaryData.fromObject(model).toObject(AttachedNetworkListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateMockTests.java deleted file mode 100644 index 8cb150cb0291..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksCreateOrUpdateMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AttachedNetworkConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AttachedNetworksCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"networkConnectionId\":\"wmqtibx\",\"networkConnectionLocation\":\"jddtvqct\",\"healthCheckStatus\":\"Warning\",\"domainJoinType\":\"AzureADJoin\"},\"id\":\"eukmr\",\"name\":\"ieekpndzaa\",\"type\":\"mudqmeq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedNetworkConnection response = manager.attachedNetworks() - .define("eislstvasylwx") - .withExistingDevcenter("oylhjlmuoyxprimr", "opteecj") - .withNetworkConnectionId("mweoohgu") - .create(); - - Assertions.assertEquals("wmqtibx", response.networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterWithResponseMockTests.java deleted file mode 100644 index c99663d27b00..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByDevCenterWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AttachedNetworkConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AttachedNetworksGetByDevCenterWithResponseMockTests { - @Test - public void testGetByDevCenterWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Deleted\",\"networkConnectionId\":\"rhptilluc\",\"networkConnectionLocation\":\"qtgdqohmcwsl\",\"healthCheckStatus\":\"Pending\",\"domainJoinType\":\"AzureADJoin\"},\"id\":\"pwbralllibphbqz\",\"name\":\"izakak\",\"type\":\"nkjpdnjzha\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedNetworkConnection response = manager.attachedNetworks() - .getByDevCenterWithResponse("oajvgcxtxjcs", "eafidltugsresm", "ssjhoiftxfkf", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rhptilluc", response.networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectWithResponseMockTests.java deleted file mode 100644 index 658f79948830..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksGetByProjectWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AttachedNetworkConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AttachedNetworksGetByProjectWithResponseMockTests { - @Test - public void testGetByProjectWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Updated\",\"networkConnectionId\":\"a\",\"networkConnectionLocation\":\"ulcdisdosf\",\"healthCheckStatus\":\"Passed\",\"domainJoinType\":\"HybridAzureADJoin\"},\"id\":\"jrwhryvy\",\"name\":\"ytdc\",\"type\":\"xgccknfnw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AttachedNetworkConnection response = manager.attachedNetworks() - .getByProjectWithResponse("zvulj", "aaeranokqgukk", "qnvb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("a", response.networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterMockTests.java deleted file mode 100644 index 308910591625..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByDevCenterMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AttachedNetworkConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AttachedNetworksListByDevCenterMockTests { - @Test - public void testListByDevCenter() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"MovingResources\",\"networkConnectionId\":\"nsdfzpbgtgky\",\"networkConnectionLocation\":\"dgh\",\"healthCheckStatus\":\"Pending\",\"domainJoinType\":\"AzureADJoin\"},\"id\":\"lwxezwzhokvbwnh\",\"name\":\"tqlgehgppi\",\"type\":\"ifhpf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.attachedNetworks() - .listByDevCenter("btmvpdvjdhttza", "fedxihchrphkm", 525308452, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nsdfzpbgtgky", response.iterator().next().networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectMockTests.java deleted file mode 100644 index c7eff8b2411c..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/AttachedNetworksListByProjectMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AttachedNetworkConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AttachedNetworksListByProjectMockTests { - @Test - public void testListByProject() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"MovingResources\",\"networkConnectionId\":\"ft\",\"networkConnectionLocation\":\"qobr\",\"healthCheckStatus\":\"Failed\",\"domainJoinType\":\"AzureADJoin\"},\"id\":\"cc\",\"name\":\"knh\",\"type\":\"kizvytn\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.attachedNetworks() - .listByProject("kdlpa", "zrcxfailcfxwmdbo", 1074201202, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ft", response.iterator().next().networkConnectionId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CapabilityTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CapabilityTests.java deleted file mode 100644 index 518497aa4d76..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CapabilityTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.Capability; - -public final class CapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Capability model - = BinaryData.fromString("{\"name\":\"krlgnyhm\",\"value\":\"sxkkg\"}").toObject(Capability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Capability model = new Capability(); - model = BinaryData.fromObject(model).toObject(Capability.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CatalogConflictErrorTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CatalogConflictErrorTests.java deleted file mode 100644 index 157816fd6975..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CatalogConflictErrorTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CatalogConflictError; - -public final class CatalogConflictErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CatalogConflictError model - = BinaryData.fromString("{\"path\":\"typmrbpizcdrqjsd\",\"name\":\"dnfyhxdeoejzicwi\"}") - .toObject(CatalogConflictError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CatalogConflictError model = new CatalogConflictError(); - model = BinaryData.fromObject(model).toObject(CatalogConflictError.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java deleted file mode 100644 index 7566c6c4b59d..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"cbrwi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = manager.checkNameAvailabilities() - .executeWithResponse(new CheckNameAvailabilityRequest().withName("pedwqsl").withType("hmpqvw"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("cbrwi", response.message()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityRequestTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index bfbd6ad13fa1..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityRequestTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model - = BinaryData.fromString("{\"name\":\"njwmwkpnbsazejj\",\"type\":\"kagfhsxtt\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("njwmwkpnbsazejj", model.name()); - Assertions.assertEquals("kagfhsxtt", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model - = new CheckNameAvailabilityRequest().withName("njwmwkpnbsazejj").withType("kagfhsxtt"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("njwmwkpnbsazejj", model.name()); - Assertions.assertEquals("kagfhsxtt", model.type()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index 7179403505a1..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckNameAvailabilityResponseInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model = BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"faazpxdtnkdmkqjj\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("faazpxdtnkdmkqjj", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("faazpxdtnkdmkqjj"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("faazpxdtnkdmkqjj", model.message()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilitiesExecuteWithResponseMockTests.java deleted file mode 100644 index 753194a0f61a..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilitiesExecuteWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.devcenter.models.CheckNameAvailabilityResponse; -import com.azure.resourcemanager.devcenter.models.CheckScopedNameAvailabilityRequest; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CheckScopedNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"qbr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = manager.checkScopedNameAvailabilities() - .executeWithResponse(new CheckScopedNameAvailabilityRequest().withName("vqejosovy") - .withType("leaesi") - .withScope("qtljqobbpihehc"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("qbr", response.message()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityRequestTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityRequestTests.java deleted file mode 100644 index 642959ce91ba..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CheckScopedNameAvailabilityRequestTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CheckScopedNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckScopedNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckScopedNameAvailabilityRequest model - = BinaryData.fromString("{\"name\":\"uenvrkp\",\"type\":\"uaibrebqaaysj\",\"scope\":\"xqtnq\"}") - .toObject(CheckScopedNameAvailabilityRequest.class); - Assertions.assertEquals("uenvrkp", model.name()); - Assertions.assertEquals("uaibrebqaaysj", model.type()); - Assertions.assertEquals("xqtnq", model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckScopedNameAvailabilityRequest model - = new CheckScopedNameAvailabilityRequest().withName("uenvrkp").withType("uaibrebqaaysj").withScope("xqtnq"); - model = BinaryData.fromObject(model).toObject(CheckScopedNameAvailabilityRequest.class); - Assertions.assertEquals("uenvrkp", model.name()); - Assertions.assertEquals("uaibrebqaaysj", model.type()); - Assertions.assertEquals("xqtnq", model.scope()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CustomerManagedKeyEncryptionKeyIdentityTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CustomerManagedKeyEncryptionKeyIdentityTests.java deleted file mode 100644 index ffb6304db5a4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/CustomerManagedKeyEncryptionKeyIdentityTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CustomerManagedKeyEncryptionKeyIdentity; -import com.azure.resourcemanager.devcenter.models.IdentityType; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class CustomerManagedKeyEncryptionKeyIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerManagedKeyEncryptionKeyIdentity model = BinaryData.fromString( - "{\"identityType\":\"delegatedResourceIdentity\",\"userAssignedIdentityResourceId\":\"nrbtcqqjnq\",\"delegatedIdentityClientId\":\"5e1c1e49-5975-4345-a55a-4805b3083f07\"}") - .toObject(CustomerManagedKeyEncryptionKeyIdentity.class); - Assertions.assertEquals(IdentityType.DELEGATED_RESOURCE_IDENTITY, model.identityType()); - Assertions.assertEquals("nrbtcqqjnq", model.userAssignedIdentityResourceId()); - Assertions.assertEquals(UUID.fromString("5e1c1e49-5975-4345-a55a-4805b3083f07"), - model.delegatedIdentityClientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerManagedKeyEncryptionKeyIdentity model - = new CustomerManagedKeyEncryptionKeyIdentity().withIdentityType(IdentityType.DELEGATED_RESOURCE_IDENTITY) - .withUserAssignedIdentityResourceId("nrbtcqqjnq") - .withDelegatedIdentityClientId(UUID.fromString("5e1c1e49-5975-4345-a55a-4805b3083f07")); - model = BinaryData.fromObject(model).toObject(CustomerManagedKeyEncryptionKeyIdentity.class); - Assertions.assertEquals(IdentityType.DELEGATED_RESOURCE_IDENTITY, model.identityType()); - Assertions.assertEquals("nrbtcqqjnq", model.userAssignedIdentityResourceId()); - Assertions.assertEquals(UUID.fromString("5e1c1e49-5975-4345-a55a-4805b3083f07"), - model.delegatedIdentityClientId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionUpdatePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionUpdatePropertiesTests.java deleted file mode 100644 index 49d56561420f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionUpdatePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.DevBoxDefinitionUpdateProperties; -import com.azure.resourcemanager.devcenter.models.HibernateSupport; -import com.azure.resourcemanager.devcenter.models.ImageReference; -import com.azure.resourcemanager.devcenter.models.Sku; -import com.azure.resourcemanager.devcenter.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class DevBoxDefinitionUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DevBoxDefinitionUpdateProperties model = BinaryData.fromString( - "{\"imageReference\":{\"id\":\"htwdwrftswibyrcd\",\"exactVersion\":\"h\"},\"sku\":{\"name\":\"fwpracstwi\",\"tier\":\"Standard\",\"size\":\"evxccedcp\",\"family\":\"dyodnwzxltj\",\"capacity\":424916927},\"osStorageType\":\"ltiugcxnavv\",\"hibernateSupport\":\"Disabled\"}") - .toObject(DevBoxDefinitionUpdateProperties.class); - Assertions.assertEquals("htwdwrftswibyrcd", model.imageReference().id()); - Assertions.assertEquals("fwpracstwi", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("evxccedcp", model.sku().size()); - Assertions.assertEquals("dyodnwzxltj", model.sku().family()); - Assertions.assertEquals(424916927, model.sku().capacity()); - Assertions.assertEquals("ltiugcxnavv", model.osStorageType()); - Assertions.assertEquals(HibernateSupport.DISABLED, model.hibernateSupport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DevBoxDefinitionUpdateProperties model - = new DevBoxDefinitionUpdateProperties().withImageReference(new ImageReference().withId("htwdwrftswibyrcd")) - .withSku(new Sku().withName("fwpracstwi") - .withTier(SkuTier.STANDARD) - .withSize("evxccedcp") - .withFamily("dyodnwzxltj") - .withCapacity(424916927)) - .withOsStorageType("ltiugcxnavv") - .withHibernateSupport(HibernateSupport.DISABLED); - model = BinaryData.fromObject(model).toObject(DevBoxDefinitionUpdateProperties.class); - Assertions.assertEquals("htwdwrftswibyrcd", model.imageReference().id()); - Assertions.assertEquals("fwpracstwi", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("evxccedcp", model.sku().size()); - Assertions.assertEquals("dyodnwzxltj", model.sku().family()); - Assertions.assertEquals(424916927, model.sku().capacity()); - Assertions.assertEquals("ltiugcxnavv", model.osStorageType()); - Assertions.assertEquals(HibernateSupport.DISABLED, model.hibernateSupport()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionUpdateTests.java deleted file mode 100644 index 06c02b43aa26..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevBoxDefinitionUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.DevBoxDefinitionUpdate; -import com.azure.resourcemanager.devcenter.models.HibernateSupport; -import com.azure.resourcemanager.devcenter.models.ImageReference; -import com.azure.resourcemanager.devcenter.models.Sku; -import com.azure.resourcemanager.devcenter.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DevBoxDefinitionUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DevBoxDefinitionUpdate model = BinaryData.fromString( - "{\"properties\":{\"imageReference\":{\"id\":\"j\",\"exactVersion\":\"hkr\"},\"sku\":{\"name\":\"bdeibqipqk\",\"tier\":\"Basic\",\"size\":\"ndzwmkrefa\",\"family\":\"jorwkqnyhgbij\",\"capacity\":1741167059},\"osStorageType\":\"fxzsjabibsyst\",\"hibernateSupport\":\"Enabled\"},\"tags\":{\"ncj\":\"jpvkvpbjxbkzbzkd\",\"zhjjklffhmouwq\":\"budurgkakmo\",\"eeyebi\":\"gzrf\",\"wrv\":\"ikayuhqlbjbsybb\"},\"location\":\"dgmfpgvmpipasl\"}") - .toObject(DevBoxDefinitionUpdate.class); - Assertions.assertEquals("jpvkvpbjxbkzbzkd", model.tags().get("ncj")); - Assertions.assertEquals("dgmfpgvmpipasl", model.location()); - Assertions.assertEquals("j", model.imageReference().id()); - Assertions.assertEquals("bdeibqipqk", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("ndzwmkrefa", model.sku().size()); - Assertions.assertEquals("jorwkqnyhgbij", model.sku().family()); - Assertions.assertEquals(1741167059, model.sku().capacity()); - Assertions.assertEquals("fxzsjabibsyst", model.osStorageType()); - Assertions.assertEquals(HibernateSupport.ENABLED, model.hibernateSupport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DevBoxDefinitionUpdate model = new DevBoxDefinitionUpdate() - .withTags(mapOf("ncj", "jpvkvpbjxbkzbzkd", "zhjjklffhmouwq", "budurgkakmo", "eeyebi", "gzrf", "wrv", - "ikayuhqlbjbsybb")) - .withLocation("dgmfpgvmpipasl") - .withImageReference(new ImageReference().withId("j")) - .withSku(new Sku().withName("bdeibqipqk") - .withTier(SkuTier.BASIC) - .withSize("ndzwmkrefa") - .withFamily("jorwkqnyhgbij") - .withCapacity(1741167059)) - .withOsStorageType("fxzsjabibsyst") - .withHibernateSupport(HibernateSupport.ENABLED); - model = BinaryData.fromObject(model).toObject(DevBoxDefinitionUpdate.class); - Assertions.assertEquals("jpvkvpbjxbkzbzkd", model.tags().get("ncj")); - Assertions.assertEquals("dgmfpgvmpipasl", model.location()); - Assertions.assertEquals("j", model.imageReference().id()); - Assertions.assertEquals("bdeibqipqk", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("ndzwmkrefa", model.sku().size()); - Assertions.assertEquals("jorwkqnyhgbij", model.sku().family()); - Assertions.assertEquals(1741167059, model.sku().capacity()); - Assertions.assertEquals("fxzsjabibsyst", model.osStorageType()); - Assertions.assertEquals(HibernateSupport.ENABLED, model.hibernateSupport()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevCenterProjectCatalogSettingsTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevCenterProjectCatalogSettingsTests.java deleted file mode 100644 index e20f468b02a7..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevCenterProjectCatalogSettingsTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CatalogItemSyncEnableStatus; -import com.azure.resourcemanager.devcenter.models.DevCenterProjectCatalogSettings; -import org.junit.jupiter.api.Assertions; - -public final class DevCenterProjectCatalogSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DevCenterProjectCatalogSettings model = BinaryData.fromString("{\"catalogItemSyncEnableStatus\":\"Enabled\"}") - .toObject(DevCenterProjectCatalogSettings.class); - Assertions.assertEquals(CatalogItemSyncEnableStatus.ENABLED, model.catalogItemSyncEnableStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DevCenterProjectCatalogSettings model = new DevCenterProjectCatalogSettings() - .withCatalogItemSyncEnableStatus(CatalogItemSyncEnableStatus.ENABLED); - model = BinaryData.fromObject(model).toObject(DevCenterProjectCatalogSettings.class); - Assertions.assertEquals(CatalogItemSyncEnableStatus.ENABLED, model.catalogItemSyncEnableStatus()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevCenterSkuInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevCenterSkuInnerTests.java deleted file mode 100644 index a3d330ac47a4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/DevCenterSkuInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.DevCenterSkuInner; -import com.azure.resourcemanager.devcenter.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class DevCenterSkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DevCenterSkuInner model = BinaryData.fromString( - "{\"resourceType\":\"mwctondzjluudfd\",\"locations\":[\"gytsbwtovv\"],\"capabilities\":[{\"name\":\"inqfiufxqknpirgn\",\"value\":\"ttwqmsni\"},{\"name\":\"cdm\",\"value\":\"r\"},{\"name\":\"lpijnkrxfrd\",\"value\":\"c\"}],\"name\":\"atiz\",\"tier\":\"Standard\",\"size\":\"asxifto\",\"family\":\"yzhftwesgogczh\",\"capacity\":1907577103}") - .toObject(DevCenterSkuInner.class); - Assertions.assertEquals("atiz", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("asxifto", model.size()); - Assertions.assertEquals("yzhftwesgogczh", model.family()); - Assertions.assertEquals(1907577103, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DevCenterSkuInner model = new DevCenterSkuInner().withName("atiz") - .withTier(SkuTier.STANDARD) - .withSize("asxifto") - .withFamily("yzhftwesgogczh") - .withCapacity(1907577103); - model = BinaryData.fromObject(model).toObject(DevCenterSkuInner.class); - Assertions.assertEquals("atiz", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("asxifto", model.size()); - Assertions.assertEquals("yzhftwesgogczh", model.family()); - Assertions.assertEquals(1907577103, model.capacity()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EndpointDependencyTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EndpointDependencyTests.java deleted file mode 100644 index 2cb03411120b..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EndpointDependencyTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EndpointDependency; - -public final class EndpointDependencyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointDependency model = BinaryData.fromString( - "{\"domainName\":\"ieknl\",\"description\":\"riaa\",\"endpointDetails\":[{\"port\":343253872},{\"port\":891454353},{\"port\":846289749},{\"port\":225178915}]}") - .toObject(EndpointDependency.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDependency model = new EndpointDependency(); - model = BinaryData.fromObject(model).toObject(EndpointDependency.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EndpointDetailTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EndpointDetailTests.java deleted file mode 100644 index bc922a0fe783..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EndpointDetailTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EndpointDetail; - -public final class EndpointDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointDetail model = BinaryData.fromString("{\"port\":803078065}").toObject(EndpointDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDetail model = new EndpointDetail(); - model = BinaryData.fromObject(model).toObject(EndpointDetail.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionInnerTests.java deleted file mode 100644 index 806d76057b45..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.EnvironmentDefinitionInner; - -public final class EnvironmentDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentDefinitionInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"sfcpkvxodpuozm\",\"parameters\":[{\"id\":\"agfuaxbezyiu\",\"name\":\"ktwh\",\"description\":\"xw\",\"type\":\"object\",\"readOnly\":false,\"required\":true},{\"id\":\"ureximoryocfs\",\"name\":\"s\",\"description\":\"ddystkiiuxhqy\",\"type\":\"number\",\"readOnly\":true,\"required\":false},{\"id\":\"b\",\"name\":\"czvyifq\",\"description\":\"kdvjsll\",\"type\":\"array\",\"readOnly\":false,\"required\":true}],\"templatePath\":\"t\",\"validationStatus\":\"Unknown\"},\"id\":\"ulexxbczwtr\",\"name\":\"wiqzbqjvsovmyo\",\"type\":\"acspkwl\"}") - .toObject(EnvironmentDefinitionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentDefinitionInner model = new EnvironmentDefinitionInner(); - model = BinaryData.fromObject(model).toObject(EnvironmentDefinitionInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionListResultTests.java deleted file mode 100644 index 0824ad7d56c6..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentDefinitionListResult; - -public final class EnvironmentDefinitionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"xuigdtopbobj\",\"parameters\":[{\"id\":\"e\",\"name\":\"a\",\"description\":\"uhrzayvvt\",\"type\":\"integer\",\"readOnly\":false,\"required\":true}],\"templatePath\":\"tkftutqxlngx\",\"validationStatus\":\"Failed\"},\"id\":\"ugnxkrxdqmi\",\"name\":\"tthzrvqd\",\"type\":\"abhjybi\"},{\"properties\":{\"description\":\"oqfbowskanyk\",\"parameters\":[{\"id\":\"u\",\"name\":\"wgqyw\",\"description\":\"drvyn\",\"type\":\"boolean\",\"readOnly\":true,\"required\":false},{\"id\":\"gyncocpecfvmmc\",\"name\":\"fsxlzevgbmqjqa\",\"description\":\"y\",\"type\":\"object\",\"readOnly\":true,\"required\":false},{\"id\":\"uvcc\",\"name\":\"nfnbacfionlebxe\",\"description\":\"gtzxdpn\",\"type\":\"number\",\"readOnly\":true,\"required\":true},{\"id\":\"feallnwsu\",\"name\":\"snjampmng\",\"description\":\"scxaq\",\"type\":\"integer\",\"readOnly\":true,\"required\":true}],\"templatePath\":\"nqvpkvlrxnje\",\"validationStatus\":\"Failed\"},\"id\":\"pheoflokeyy\",\"name\":\"enjbdlwtgrhp\",\"type\":\"jp\"},{\"properties\":{\"description\":\"asxazjpqyegualhb\",\"parameters\":[{\"id\":\"jj\",\"name\":\"v\",\"description\":\"dgwdslfhot\",\"type\":\"object\",\"readOnly\":true,\"required\":true},{\"id\":\"bjnpg\",\"name\":\"ftadehxnltyfs\",\"description\":\"pusuesn\",\"type\":\"array\",\"readOnly\":true,\"required\":false}],\"templatePath\":\"orxzdmohctbqvud\",\"validationStatus\":\"Pending\"},\"id\":\"dnvowg\",\"name\":\"jjugwdkcglhslaz\",\"type\":\"dyggdtjixhbku\"},{\"properties\":{\"description\":\"wey\",\"parameters\":[{\"id\":\"n\",\"name\":\"fyexfwhy\",\"description\":\"i\",\"type\":\"string\",\"readOnly\":false,\"required\":false},{\"id\":\"tynnaamdectehfi\",\"name\":\"cj\",\"description\":\"pvhez\",\"type\":\"object\",\"readOnly\":true,\"required\":true},{\"id\":\"efovgmk\",\"name\":\"leyyvx\",\"description\":\"jpkcattpng\",\"type\":\"object\",\"readOnly\":true,\"required\":true}],\"templatePath\":\"pjhvmdajvnys\",\"validationStatus\":\"Succeeded\"},\"id\":\"e\",\"name\":\"a\",\"type\":\"oaeupfhyhltrpmo\"}],\"nextLink\":\"mcmatuokthfuiu\"}") - .toObject(EnvironmentDefinitionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentDefinitionListResult model = new EnvironmentDefinitionListResult(); - model = BinaryData.fromObject(model).toObject(EnvironmentDefinitionListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionParameterTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionParameterTests.java deleted file mode 100644 index b7412ea36813..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionParameterTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentDefinitionParameter; - -public final class EnvironmentDefinitionParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentDefinitionParameter model = BinaryData.fromString( - "{\"id\":\"mzsb\",\"name\":\"oggigrxwburv\",\"description\":\"xjnspy\",\"type\":\"boolean\",\"readOnly\":true,\"required\":false}") - .toObject(EnvironmentDefinitionParameter.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentDefinitionParameter model = new EnvironmentDefinitionParameter(); - model = BinaryData.fromObject(model).toObject(EnvironmentDefinitionParameter.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionPropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionPropertiesTests.java deleted file mode 100644 index b9462dcff488..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionPropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.EnvironmentDefinitionProperties; - -public final class EnvironmentDefinitionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentDefinitionProperties model = BinaryData.fromString( - "{\"description\":\"dobpxjmflbvvn\",\"parameters\":[{\"id\":\"cciw\",\"name\":\"juqk\",\"description\":\"sa\",\"type\":\"integer\",\"readOnly\":false,\"required\":true},{\"id\":\"skghsauuimj\",\"name\":\"xieduugidyjrr\",\"description\":\"y\",\"type\":\"object\",\"readOnly\":false,\"required\":true},{\"id\":\"onpc\",\"name\":\"ocohslkevleg\",\"description\":\"fbuhfmvfaxkffe\",\"type\":\"integer\",\"readOnly\":true,\"required\":false}],\"templatePath\":\"zy\",\"validationStatus\":\"Failed\"}") - .toObject(EnvironmentDefinitionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentDefinitionProperties model = new EnvironmentDefinitionProperties(); - model = BinaryData.fromObject(model).toObject(EnvironmentDefinitionProperties.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogWithResponseMockTests.java deleted file mode 100644 index d6b3b83b5efb..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetByProjectCatalogWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentDefinitionsGetByProjectCatalogWithResponseMockTests { - @Test - public void testGetByProjectCatalogWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"ojhp\",\"parameters\":[{\"id\":\"mdxotngfdgu\",\"name\":\"yzihgrkyuizabsn\",\"description\":\"pphoj\",\"type\":\"integer\",\"readOnly\":true,\"required\":false},{\"id\":\"gzfc\",\"name\":\"gomfgbeglq\",\"description\":\"eohibet\",\"type\":\"number\",\"readOnly\":false,\"required\":false}],\"templatePath\":\"fxeeebtijvacvbm\",\"validationStatus\":\"Pending\"},\"id\":\"q\",\"name\":\"lajrnwxacevehj\",\"type\":\"uyxoaf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentDefinition response = manager.environmentDefinitions() - .getByProjectCatalogWithResponse("fuojrngif", "rzpasccbiuimzdly", "dfqwmkyoq", "fdvruz", - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetWithResponseMockTests.java deleted file mode 100644 index 2abd0fedbce4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentDefinitionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"vpbdbzqgq\",\"parameters\":[{\"id\":\"dsvqwt\",\"name\":\"ky\",\"description\":\"cysihs\",\"type\":\"integer\",\"readOnly\":true,\"required\":false},{\"id\":\"sdtmcdzs\",\"name\":\"cohdx\",\"description\":\"lm\",\"type\":\"object\",\"readOnly\":true,\"required\":true},{\"id\":\"dbevwqqxeysko\",\"name\":\"zinkfkbgbzbowxeq\",\"description\":\"ljmygvkzqkjjeokb\",\"type\":\"array\",\"readOnly\":true,\"required\":false},{\"id\":\"czurtlei\",\"name\":\"xbkwv\",\"description\":\"nzvdfbzdixzmq\",\"type\":\"string\",\"readOnly\":false,\"required\":true}],\"templatePath\":\"qhewj\",\"validationStatus\":\"Failed\"},\"id\":\"gsbos\",\"name\":\"zelndlatutmzlbi\",\"type\":\"jlvfhrbbpneqv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentDefinition response = manager.environmentDefinitions() - .getWithResponse("k", "vlgo", "bmftpmdt", "fjltfvnzcyjtotp", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogMockTests.java deleted file mode 100644 index d755a2bc1494..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByCatalogMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentDefinitionsListByCatalogMockTests { - @Test - public void testListByCatalog() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"pyznuciqd\",\"parameters\":[{\"id\":\"iitdfuxt\",\"name\":\"siibmiybnnustgn\",\"description\":\"hnmgixhcm\",\"type\":\"string\",\"readOnly\":false,\"required\":false}],\"templatePath\":\"or\",\"validationStatus\":\"Succeeded\"},\"id\":\"yprotwyp\",\"name\":\"ndm\",\"type\":\"xhugcm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.environmentDefinitions() - .listByCatalog("aoqltfaey", "inmfgvxirp", "hriypoqeyhlqhy", 1212152728, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogMockTests.java deleted file mode 100644 index 192a66d1bb79..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentDefinitionsListByProjectCatalogMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentDefinitionsListByProjectCatalogMockTests { - @Test - public void testListByProjectCatalog() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"pgdakchzyvli\",\"parameters\":[{\"id\":\"kcxk\",\"name\":\"bn\",\"description\":\"ysux\",\"type\":\"array\",\"readOnly\":true,\"required\":false},{\"id\":\"wijpsttexoqqpwc\",\"name\":\"ufmhrunc\",\"description\":\"mqspkcdqzhlctdd\",\"type\":\"number\",\"readOnly\":true,\"required\":false}],\"templatePath\":\"chrqb\",\"validationStatus\":\"Unknown\"},\"id\":\"cgegydcwbo\",\"name\":\"jumvqqolihrraio\",\"type\":\"aubrjtloq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.environmentDefinitions() - .listByProjectCatalog("utlwexxwla", "niexzsrzpgepq", "yb", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentRoleTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentRoleTests.java deleted file mode 100644 index 5807716db078..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentRoleTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; - -public final class EnvironmentRoleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentRole model = BinaryData.fromString("{\"roleName\":\"rmnjijpx\",\"description\":\"q\"}") - .toObject(EnvironmentRole.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentRole model = new EnvironmentRole(); - model = BinaryData.fromObject(model).toObject(EnvironmentRole.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeInnerTests.java deleted file mode 100644 index 6864b61c0c7d..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.EnvironmentTypeInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentTypeInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"TransientFailure\",\"displayName\":\"nojvknmefqsg\"},\"tags\":{\"j\":\"hapjyzhpvgqz\"},\"id\":\"xdjzlmwlxk\",\"name\":\"ug\",\"type\":\"hzovawjvzunlut\"}") - .toObject(EnvironmentTypeInner.class); - Assertions.assertEquals("hapjyzhpvgqz", model.tags().get("j")); - Assertions.assertEquals("nojvknmefqsg", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentTypeInner model - = new EnvironmentTypeInner().withTags(mapOf("j", "hapjyzhpvgqz")).withDisplayName("nojvknmefqsg"); - model = BinaryData.fromObject(model).toObject(EnvironmentTypeInner.class); - Assertions.assertEquals("hapjyzhpvgqz", model.tags().get("j")); - Assertions.assertEquals("nojvknmefqsg", model.displayName()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeListResultTests.java deleted file mode 100644 index 48be6be8741a..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeListResult; - -public final class EnvironmentTypeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentTypeListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleted\",\"displayName\":\"wbcrnwbmehhseyv\"},\"tags\":{\"hspkdeemao\":\"rts\",\"gkvtmelmqkrhah\":\"mx\",\"duala\":\"ljuahaquhcdh\",\"rcrgvx\":\"xqpvfadmw\"},\"id\":\"gomz\",\"name\":\"fmisg\",\"type\":\"bnbbeldawkz\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"displayName\":\"urqhaka\"},\"tags\":{\"i\":\"shsfwxosowzxcu\",\"ucww\":\"jooxdjebw\",\"bvmeuecivy\":\"vo\"},\"id\":\"ce\",\"name\":\"ojgjrwjueiotwmc\",\"type\":\"ytdxwit\"},{\"properties\":{\"provisioningState\":\"Updated\",\"displayName\":\"wgqwgxhn\"},\"tags\":{\"bkpyc\":\"x\",\"l\":\"klwndnhjdauwhv\",\"xujznbmpowu\":\"zbtd\",\"lupj\":\"przqlveu\"},\"id\":\"hfxobbcswsrtj\",\"name\":\"iplrbpbewtghfgb\",\"type\":\"c\"},{\"properties\":{\"provisioningState\":\"MovingResources\",\"displayName\":\"lvqhjkbegibtnmx\"},\"tags\":{\"j\":\"wwaloayqcgwrt\",\"yzm\":\"zg\"},\"id\":\"xongmtsavjcbpwxq\",\"name\":\"srknftguv\",\"type\":\"iuhprwmdyvxqta\"}],\"nextLink\":\"iwwroyqbexrmc\"}") - .toObject(EnvironmentTypeListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentTypeListResult model = new EnvironmentTypeListResult(); - model = BinaryData.fromObject(model).toObject(EnvironmentTypeListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypePropertiesTests.java deleted file mode 100644 index 6495f9956b2d..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.EnvironmentTypeProperties; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentTypeProperties model - = BinaryData.fromString("{\"provisioningState\":\"NotSpecified\",\"displayName\":\"rnxipei\"}") - .toObject(EnvironmentTypeProperties.class); - Assertions.assertEquals("rnxipei", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentTypeProperties model = new EnvironmentTypeProperties().withDisplayName("rnxipei"); - model = BinaryData.fromObject(model).toObject(EnvironmentTypeProperties.class); - Assertions.assertEquals("rnxipei", model.displayName()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeUpdatePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeUpdatePropertiesTests.java deleted file mode 100644 index b79fdee437f1..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeUpdatePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.EnvironmentTypeUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentTypeUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentTypeUpdateProperties model = BinaryData.fromString("{\"displayName\":\"jzuaejxdultskzbb\"}") - .toObject(EnvironmentTypeUpdateProperties.class); - Assertions.assertEquals("jzuaejxdultskzbb", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentTypeUpdateProperties model - = new EnvironmentTypeUpdateProperties().withDisplayName("jzuaejxdultskzbb"); - model = BinaryData.fromObject(model).toObject(EnvironmentTypeUpdateProperties.class); - Assertions.assertEquals("jzuaejxdultskzbb", model.displayName()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeUpdateTests.java deleted file mode 100644 index 2d3600d43f01..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypeUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentTypeUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentTypeUpdate model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"umveekgpwozuhkf\"},\"tags\":{\"waboe\":\"jyofdxluusdtto\",\"bxwyjsflhhcaa\":\"qvkelnsm\"}}") - .toObject(EnvironmentTypeUpdate.class); - Assertions.assertEquals("jyofdxluusdtto", model.tags().get("waboe")); - Assertions.assertEquals("umveekgpwozuhkf", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentTypeUpdate model - = new EnvironmentTypeUpdate().withTags(mapOf("waboe", "jyofdxluusdtto", "bxwyjsflhhcaa", "qvkelnsm")) - .withDisplayName("umveekgpwozuhkf"); - model = BinaryData.fromObject(model).toObject(EnvironmentTypeUpdate.class); - Assertions.assertEquals("jyofdxluusdtto", model.tags().get("waboe")); - Assertions.assertEquals("umveekgpwozuhkf", model.displayName()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index b6f734d8b5ad..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesCreateOrUpdateWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentType; -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 reactor.core.publisher.Mono; - -public final class EnvironmentTypesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"TransientFailure\",\"displayName\":\"paglqivbgk\"},\"tags\":{\"pubcpzgpxtivhjk\":\"hpzvuqdflvoniyp\",\"hgovfgp\":\"idibgqjxgpn\",\"zvuporqzdfuydz\":\"kqmhhaowjr\"},\"id\":\"fvxcnqmxqpswo\",\"name\":\"mvkhlggd\",\"type\":\"bemzqkzszuwi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentType response = manager.environmentTypes() - .define("nknlqwzdvpi") - .withExistingDevcenter("jletlxsmrpddo", "ifamowazi") - .withTags(mapOf("kfkyjp", "ygjbmzyospspsh")) - .withDisplayName("zdtmaajquhuxylrj") - .create(); - - Assertions.assertEquals("hpzvuqdflvoniyp", response.tags().get("pubcpzgpxtivhjk")); - Assertions.assertEquals("paglqivbgk", response.displayName()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteWithResponseMockTests.java deleted file mode 100644 index f5ee9f81d020..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesDeleteWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentTypesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.environmentTypes() - .deleteWithResponse("mrnjh", "sujz", "czytqjtwhauunfpr", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetWithResponseMockTests.java deleted file mode 100644 index eff78fd11400..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"mkzjvkviir\"},\"tags\":{\"ra\":\"grwsdp\",\"ctctbrxkjz\":\"zvzbglbyv\",\"bkgozxwopdbydpi\":\"rgxffmshkw\",\"nugj\":\"qaclnapxbiy\"},\"id\":\"fsmfcttuxuuyi\",\"name\":\"flqo\",\"type\":\"quvre\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentType response = manager.environmentTypes() - .getWithResponse("qmp", "zruwn", "qxpxiwfcngjsaa", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("grwsdp", response.tags().get("ra")); - Assertions.assertEquals("mkzjvkviir", response.displayName()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterMockTests.java deleted file mode 100644 index 87c01614ee34..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/EnvironmentTypesListByDevCenterMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentTypesListByDevCenterMockTests { - @Test - public void testListByDevCenter() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updated\",\"displayName\":\"hsyrqunj\"},\"tags\":{\"ulkpakd\":\"enx\",\"wtqabpxuckp\":\"ifmjnn\"},\"id\":\"qoweyirdhl\",\"name\":\"sn\",\"type\":\"wfl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.environmentTypes() - .listByDevCenter("j", "ytunlbfjkwr", 1064304425, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("enx", response.iterator().next().tags().get("ulkpakd")); - Assertions.assertEquals("hsyrqunj", response.iterator().next().displayName()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateMockTests.java deleted file mode 100644 index 0af0f4aea7f0..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesCreateOrUpdateMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Gallery; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GalleriesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"galleryResourceId\":\"fdwfmvigorqj\"},\"id\":\"tzh\",\"name\":\"aglkafhon\",\"type\":\"juj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Gallery response = manager.galleries() - .define("kyrioovzid") - .withExistingDevcenter("ybbabpfhvfsl", "vntjlrigjk") - .withGalleryResourceId("abzmifrygznmmaxr") - .create(); - - Assertions.assertEquals("fdwfmvigorqj", response.galleryResourceId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetWithResponseMockTests.java deleted file mode 100644 index 36709df77bdd..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Gallery; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GalleriesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"galleryResourceId\":\"xtbjwgnyfusfzsv\"},\"id\":\"ikzhajqglcfhmlrq\",\"name\":\"yxynq\",\"type\":\"zrdpsovwxznptgoe\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Gallery response - = manager.galleries().getWithResponse("waz", "nqnm", "jng", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("xtbjwgnyfusfzsv", response.galleryResourceId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterMockTests.java deleted file mode 100644 index e7e719445c14..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleriesListByDevCenterMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Gallery; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GalleriesListByDevCenterMockTests { - @Test - public void testListByDevCenter() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"StorageProvisioningFailed\",\"galleryResourceId\":\"btqwpwyawbzas\"},\"id\":\"ucljgkyexaoguya\",\"name\":\"p\",\"type\":\"dsdaultxijjumf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.galleries() - .listByDevCenter("rqwexjkmfxapjwog", "qnobp", 1221074180, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("btqwpwyawbzas", response.iterator().next().galleryResourceId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryInnerTests.java deleted file mode 100644 index 2be27c80877c..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.GalleryInner; -import org.junit.jupiter.api.Assertions; - -public final class GalleryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Updating\",\"galleryResourceId\":\"vf\"},\"id\":\"kymuctqhjfbebr\",\"name\":\"cxerf\",\"type\":\"wutttxfvjrbi\"}") - .toObject(GalleryInner.class); - Assertions.assertEquals("vf", model.galleryResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryInner model = new GalleryInner().withGalleryResourceId("vf"); - model = BinaryData.fromObject(model).toObject(GalleryInner.class); - Assertions.assertEquals("vf", model.galleryResourceId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryListResultTests.java deleted file mode 100644 index 2d5839648d89..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.GalleryListResult; - -public final class GalleryListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updated\",\"galleryResourceId\":\"uxwgipwho\"},\"id\":\"wkgshwa\",\"name\":\"kix\",\"type\":\"bin\"},{\"properties\":{\"provisioningState\":\"TransientFailure\",\"galleryResourceId\":\"ttmrywnuzoqf\"},\"id\":\"yqzrnkcqvyxlw\",\"name\":\"zlsico\",\"type\":\"oqqnwvlryav\"},{\"properties\":{\"provisioningState\":\"Running\",\"galleryResourceId\":\"unmmq\"},\"id\":\"yxzk\",\"name\":\"noc\",\"type\":\"koklya\"},{\"properties\":{\"provisioningState\":\"Creating\",\"galleryResourceId\":\"nuqszfkbey\"},\"id\":\"wrmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"}],\"nextLink\":\"ylihkaetckt\"}") - .toObject(GalleryListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryListResult model = new GalleryListResult(); - model = BinaryData.fromObject(model).toObject(GalleryListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryPropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryPropertiesTests.java deleted file mode 100644 index 6fa607d7a6b3..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/GalleryPropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.GalleryProperties; -import org.junit.jupiter.api.Assertions; - -public final class GalleryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GalleryProperties model - = BinaryData.fromString("{\"provisioningState\":\"MovingResources\",\"galleryResourceId\":\"xepcyvahfn\"}") - .toObject(GalleryProperties.class); - Assertions.assertEquals("xepcyvahfn", model.galleryResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GalleryProperties model = new GalleryProperties().withGalleryResourceId("xepcyvahfn"); - model = BinaryData.fromObject(model).toObject(GalleryProperties.class); - Assertions.assertEquals("xepcyvahfn", model.galleryResourceId()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsInnerTests.java deleted file mode 100644 index c96d82d40315..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.HealthCheckStatusDetailsInner; - -public final class HealthCheckStatusDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthCheckStatusDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"startDateTime\":\"2021-06-01T08:07:59Z\",\"endDateTime\":\"2021-10-20T08:24:02Z\",\"healthChecks\":[{\"status\":\"Pending\",\"displayName\":\"gvmnvuqeq\",\"startDateTime\":\"2021-08-08T15:42:49Z\",\"endDateTime\":\"2021-09-04T08:46:12Z\",\"errorType\":\"stjbkkdmfl\",\"recommendedAction\":\"stmjlxrri\",\"additionalDetails\":\"zapeewchpx\"},{\"status\":\"Unknown\",\"displayName\":\"kuziycsle\",\"startDateTime\":\"2021-05-20T02:11:38Z\",\"endDateTime\":\"2021-06-26T17:11:18Z\",\"errorType\":\"cktyh\",\"recommendedAction\":\"qedcgzulwm\",\"additionalDetails\":\"qzz\"},{\"status\":\"Failed\",\"displayName\":\"pglydz\",\"startDateTime\":\"2021-02-08T17:34:52Z\",\"endDateTime\":\"2021-06-13T21:50:19Z\",\"errorType\":\"ev\",\"recommendedAction\":\"epr\",\"additionalDetails\":\"t\"},{\"status\":\"Warning\",\"displayName\":\"pzdm\",\"startDateTime\":\"2021-04-29T18:17:57Z\",\"endDateTime\":\"2021-08-21T09:22:41Z\",\"errorType\":\"aawzqadfl\",\"recommendedAction\":\"ur\",\"additionalDetails\":\"laecxndticok\"}]},\"id\":\"zmlqtmldgxo\",\"name\":\"firclnpkciayz\",\"type\":\"iykhy\"}") - .toObject(HealthCheckStatusDetailsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthCheckStatusDetailsInner model = new HealthCheckStatusDetailsInner(); - model = BinaryData.fromObject(model).toObject(HealthCheckStatusDetailsInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsListResultTests.java deleted file mode 100644 index 34203a8d7123..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.HealthCheckStatusDetailsListResult; - -public final class HealthCheckStatusDetailsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthCheckStatusDetailsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"startDateTime\":\"2021-03-30T06:07:22Z\",\"endDateTime\":\"2021-04-15T08:04:43Z\",\"healthChecks\":[{\"status\":\"Failed\",\"displayName\":\"ybvpay\",\"startDateTime\":\"2021-11-06T02:11:56Z\",\"endDateTime\":\"2021-10-08T16:55:36Z\",\"errorType\":\"px\",\"recommendedAction\":\"jplmagstcy\",\"additionalDetails\":\"pfkyrkdbdgiogsj\"},{\"status\":\"Running\",\"displayName\":\"qjnobaiyhddviac\",\"startDateTime\":\"2021-08-12T15:52:34Z\",\"endDateTime\":\"2021-04-14T23:17:33Z\",\"errorType\":\"tfpmvmemfnczdw\",\"recommendedAction\":\"b\",\"additionalDetails\":\"xlllchp\"}]},\"id\":\"bzevwrd\",\"name\":\"hfuk\",\"type\":\"vsjcswsmystuluqy\"},{\"properties\":{\"startDateTime\":\"2021-11-06T06:25:44Z\",\"endDateTime\":\"2021-09-07T13:40:13Z\",\"healthChecks\":[{\"status\":\"Passed\",\"displayName\":\"bm\",\"startDateTime\":\"2021-04-13T14:15:11Z\",\"endDateTime\":\"2021-10-29T18:16:53Z\",\"errorType\":\"widf\",\"recommendedAction\":\"sspuunnoxyhkx\",\"additionalDetails\":\"ddrihpf\"},{\"status\":\"Warning\",\"displayName\":\"aaewdaomdjv\",\"startDateTime\":\"2021-11-23T13:46:31Z\",\"endDateTime\":\"2021-04-29T09:29:01Z\",\"errorType\":\"zb\",\"recommendedAction\":\"sgeivsiy\",\"additionalDetails\":\"kdncj\"},{\"status\":\"Failed\",\"displayName\":\"bzo\",\"startDateTime\":\"2021-06-25T22:16:14Z\",\"endDateTime\":\"2021-06-09T08:37:48Z\",\"errorType\":\"p\",\"recommendedAction\":\"y\",\"additionalDetails\":\"gogtqxepnylbf\"}]},\"id\":\"jlyjtlvofq\",\"name\":\"hvfcibyfmow\",\"type\":\"xrkjpvdw\"}],\"nextLink\":\"zwiivwzjbhyzs\"}") - .toObject(HealthCheckStatusDetailsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthCheckStatusDetailsListResult model = new HealthCheckStatusDetailsListResult(); - model = BinaryData.fromObject(model).toObject(HealthCheckStatusDetailsListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsPropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsPropertiesTests.java deleted file mode 100644 index f36f3525b48f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckStatusDetailsPropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.HealthCheckStatusDetailsProperties; - -public final class HealthCheckStatusDetailsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthCheckStatusDetailsProperties model = BinaryData.fromString( - "{\"startDateTime\":\"2021-07-04T23:53:04Z\",\"endDateTime\":\"2021-05-04T05:51:41Z\",\"healthChecks\":[{\"status\":\"Unknown\",\"displayName\":\"vkjlmxhom\",\"startDateTime\":\"2021-10-09T04:46:26Z\",\"endDateTime\":\"2021-11-30T18:11:35Z\",\"errorType\":\"digumbnr\",\"recommendedAction\":\"uzzptjazysdz\",\"additionalDetails\":\"zwwva\"}]}") - .toObject(HealthCheckStatusDetailsProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthCheckStatusDetailsProperties model = new HealthCheckStatusDetailsProperties(); - model = BinaryData.fromObject(model).toObject(HealthCheckStatusDetailsProperties.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckTests.java deleted file mode 100644 index 3983dac0cf55..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/HealthCheckTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.HealthCheck; - -public final class HealthCheckTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthCheck model = BinaryData.fromString( - "{\"status\":\"Unknown\",\"displayName\":\"vv\",\"startDateTime\":\"2021-01-13T03:13:58Z\",\"endDateTime\":\"2021-08-29T14:10:38Z\",\"errorType\":\"hqyikvy\",\"recommendedAction\":\"uyav\",\"additionalDetails\":\"wmn\"}") - .toObject(HealthCheck.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthCheck model = new HealthCheck(); - model = BinaryData.fromObject(model).toObject(HealthCheck.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageInnerTests.java deleted file mode 100644 index 7d0cdd74754f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ImageInner; - -public final class ImageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"zpfzabglc\",\"publisher\":\"xwtctyqiklbbovpl\",\"offer\":\"bhvgy\",\"sku\":\"uosvmkfssxqukk\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":434688137,\"max\":1737094412},\"vCPUs\":{\"min\":538990219,\"max\":543946486}},\"provisioningState\":\"Created\",\"hibernateSupport\":\"Disabled\"},\"id\":\"pvlopwiyighxpkd\",\"name\":\"zb\",\"type\":\"iuebbaumny\"}") - .toObject(ImageInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageInner model = new ImageInner(); - model = BinaryData.fromObject(model).toObject(ImageInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageListResultTests.java deleted file mode 100644 index 8c12b1e48a49..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ImageListResult; - -public final class ImageListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"xjvuujqgidokg\",\"publisher\":\"jyoxgvclt\",\"offer\":\"sncghkjeszz\",\"sku\":\"ijhtxf\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":615517918,\"max\":1787736845},\"vCPUs\":{\"min\":455021190,\"max\":1543510738}},\"provisioningState\":\"MovingResources\",\"hibernateSupport\":\"Disabled\"},\"id\":\"godebfqkkrbmpu\",\"name\":\"gr\",\"type\":\"wflzlfbxzpuzy\"},{\"properties\":{\"description\":\"pnq\",\"publisher\":\"hmgkbrpyy\",\"offer\":\"ibnuqqkpik\",\"sku\":\"rgvtqag\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":855671205,\"max\":850338934},\"vCPUs\":{\"min\":1809689220,\"max\":687911821}},\"provisioningState\":\"Deleted\",\"hibernateSupport\":\"Enabled\"},\"id\":\"rbu\",\"name\":\"rcvpnazzmhjrunmp\",\"type\":\"ttdbhrbnl\"},{\"properties\":{\"description\":\"xmyskp\",\"publisher\":\"enbtkcxywny\",\"offer\":\"rsyn\",\"sku\":\"idybyxczf\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":2035107412,\"max\":1122692891},\"vCPUs\":{\"min\":113016072,\"max\":393084907}},\"provisioningState\":\"TransientFailure\",\"hibernateSupport\":\"Enabled\"},\"id\":\"fkts\",\"name\":\"hsucoc\",\"type\":\"nyyazttbtwwrqpue\"},{\"properties\":{\"description\":\"zywbiex\",\"publisher\":\"eyueaxibxujwb\",\"offer\":\"walm\",\"sku\":\"yoxa\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":1936487561,\"max\":2111181142},\"vCPUs\":{\"min\":350095412,\"max\":901682674}},\"provisioningState\":\"NotSpecified\",\"hibernateSupport\":\"Enabled\"},\"id\":\"v\",\"name\":\"bniwdj\",\"type\":\"wz\"}],\"nextLink\":\"dbpgnxytxhp\"}") - .toObject(ImageListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageListResult model = new ImageListResult(); - model = BinaryData.fromObject(model).toObject(ImageListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagePropertiesTests.java deleted file mode 100644 index 0893cd89c2ca..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ImageProperties; - -public final class ImagePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageProperties model = BinaryData.fromString( - "{\"description\":\"ped\",\"publisher\":\"jn\",\"offer\":\"ckhsmtxpsieb\",\"sku\":\"hvpesapskrdqm\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":1444957859,\"max\":1056627326},\"vCPUs\":{\"min\":2108720528,\"max\":1644974889}},\"provisioningState\":\"Updated\",\"hibernateSupport\":\"Disabled\"}") - .toObject(ImageProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageProperties model = new ImageProperties(); - model = BinaryData.fromObject(model).toObject(ImageProperties.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageReferenceTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageReferenceTests.java deleted file mode 100644 index 8b46e9e8b3b8..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageReferenceTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ImageReference; -import org.junit.jupiter.api.Assertions; - -public final class ImageReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageReference model = BinaryData.fromString("{\"id\":\"yhejhzisxgfp\",\"exactVersion\":\"olppvksrpqvujz\"}") - .toObject(ImageReference.class); - Assertions.assertEquals("yhejhzisxgfp", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageReference model = new ImageReference().withId("yhejhzisxgfp"); - model = BinaryData.fromObject(model).toObject(ImageReference.class); - Assertions.assertEquals("yhejhzisxgfp", model.id()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionInnerTests.java deleted file mode 100644 index 16f55bde83d8..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ImageVersionInner; - -public final class ImageVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageVersionInner model = BinaryData.fromString( - "{\"properties\":{\"name\":\"u\",\"publishedDate\":\"2021-05-30T12:28:52Z\",\"excludeFromLatest\":true,\"osDiskImageSizeInGb\":1508312014,\"provisioningState\":\"Updating\"},\"id\":\"hl\",\"name\":\"qj\",\"type\":\"hckfrlhrx\"}") - .toObject(ImageVersionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageVersionInner model = new ImageVersionInner(); - model = BinaryData.fromObject(model).toObject(ImageVersionInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionListResultTests.java deleted file mode 100644 index 890b117dcab8..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ImageVersionListResult; - -public final class ImageVersionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageVersionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"name\":\"upqsx\",\"publishedDate\":\"2021-01-21T16:22:25Z\",\"excludeFromLatest\":false,\"osDiskImageSizeInGb\":1892680320,\"provisioningState\":\"Failed\"},\"id\":\"o\",\"name\":\"eil\",\"type\":\"vnotyfjfcnj\"},{\"properties\":{\"name\":\"nxdhbt\",\"publishedDate\":\"2020-12-23T07:25:08Z\",\"excludeFromLatest\":false,\"osDiskImageSizeInGb\":1501927720,\"provisioningState\":\"MovingResources\"},\"id\":\"t\",\"name\":\"qnermclfplphoxu\",\"type\":\"crpab\"},{\"properties\":{\"name\":\"psbjta\",\"publishedDate\":\"2021-10-14T16:25:44Z\",\"excludeFromLatest\":true,\"osDiskImageSizeInGb\":2007801220,\"provisioningState\":\"Created\"},\"id\":\"eef\",\"name\":\"zwfqkqujidsuyon\",\"type\":\"bglaocqxtccm\"}],\"nextLink\":\"udxytlmoyrx\"}") - .toObject(ImageVersionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageVersionListResult model = new ImageVersionListResult(); - model = BinaryData.fromObject(model).toObject(ImageVersionListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionPropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionPropertiesTests.java deleted file mode 100644 index f0db8c23145e..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionPropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ImageVersionProperties; - -public final class ImageVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageVersionProperties model = BinaryData.fromString( - "{\"name\":\"kyv\",\"publishedDate\":\"2021-08-31T04:23:50Z\",\"excludeFromLatest\":false,\"osDiskImageSizeInGb\":106855620,\"provisioningState\":\"NotSpecified\"}") - .toObject(ImageVersionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageVersionProperties model = new ImageVersionProperties(); - model = BinaryData.fromObject(model).toObject(ImageVersionProperties.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetWithResponseMockTests.java deleted file mode 100644 index 6ddc787f1fc1..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.ImageVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImageVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"name\":\"ewemxs\",\"publishedDate\":\"2021-04-25T20:12:45Z\",\"excludeFromLatest\":true,\"osDiskImageSizeInGb\":466668490,\"provisioningState\":\"Updating\"},\"id\":\"ehkfkimrtixok\",\"name\":\"fqyinljqepqw\",\"type\":\"ixmonstshiyxg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ImageVersion response = manager.imageVersions() - .getWithResponse("kjexfdeqvhp", "ylkkshkbffmbm", "zjrgyww", "gjxsnptfu", "gicgaaoepttaq", - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageMockTests.java deleted file mode 100644 index de9dfe077d7f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImageVersionsListByImageMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.ImageVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImageVersionsListByImageMockTests { - @Test - public void testListByImage() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"name\":\"zelfwyfwl\",\"publishedDate\":\"2021-05-12T13:23:41Z\",\"excludeFromLatest\":true,\"osDiskImageSizeInGb\":228143723,\"provisioningState\":\"MovingResources\"},\"id\":\"hclafzvaylptrs\",\"name\":\"qwztcmwqkc\",\"type\":\"cxwaxfewz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.imageVersions() - .listByImage("nktwfansnvpdibmi", "ostbzbkiwb", "qnyophzfyls", "crpfbcunez", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesGetWithResponseMockTests.java deleted file mode 100644 index 9624ffe88805..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Image; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImagesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"gi\",\"publisher\":\"cjfelisdjubgg\",\"offer\":\"igkxkbsazga\",\"sku\":\"acy\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":1512551942,\"max\":722640724},\"vCPUs\":{\"min\":1831739785,\"max\":361382788}},\"provisioningState\":\"Succeeded\",\"hibernateSupport\":\"Enabled\"},\"id\":\"lniofrzgbzje\",\"name\":\"mstk\",\"type\":\"nlvxbcuii\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Image response = manager.images() - .getWithResponse("bcblemb", "kbwvqvxkdiv", "ihebwtsw", "zuwfmdur", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterMockTests.java deleted file mode 100644 index 3c4520ab9042..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesListByDevCenterMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Image; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImagesListByDevCenterMockTests { - @Test - public void testListByDevCenter() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"tyjedex\",\"publisher\":\"lfmk\",\"offer\":\"cazuaw\",\"sku\":\"z\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":400870213,\"max\":1288092956},\"vCPUs\":{\"min\":1322793238,\"max\":1568723374}},\"provisioningState\":\"Creating\",\"hibernateSupport\":\"Disabled\"},\"id\":\"sphaivmxyasflvg\",\"name\":\"gzwywak\",\"type\":\"ihknsmjbl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.images().listByDevCenter("ickpz", "cpopmxel", 62072923, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGalleryMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGalleryMockTests.java deleted file mode 100644 index c6fd571ec675..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ImagesListByGalleryMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Image; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ImagesListByGalleryMockTests { - @Test - public void testListByGallery() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"ayxonsupeujl\",\"publisher\":\"nh\",\"offer\":\"sqltnzo\",\"sku\":\"gsxgnxfyqon\",\"recommendedMachineConfiguration\":{\"memory\":{\"min\":1811066896,\"max\":46593633},\"vCPUs\":{\"min\":1576410378,\"max\":887033867}},\"provisioningState\":\"RolloutInProgress\",\"hibernateSupport\":\"Disabled\"},\"id\":\"iqbi\",\"name\":\"htmwwinh\",\"type\":\"hfqpofv\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.images() - .listByGallery("ljhlnymzotq", "ryuzcbmqqv", "mv", 622297852, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ListUsagesResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ListUsagesResultTests.java deleted file mode 100644 index 8d8b60ab84c0..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ListUsagesResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ListUsagesResult; - -public final class ListUsagesResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListUsagesResult model = BinaryData.fromString( - "{\"value\":[{\"currentValue\":6928961478611605886,\"limit\":5360902839879947019,\"unit\":\"Count\",\"name\":{\"localizedValue\":\"yijejvegrhbpnaix\",\"value\":\"ccbdre\"},\"id\":\"hcexdrrvqa\"},{\"currentValue\":1704091583579950228,\"limit\":6945893981350514667,\"unit\":\"Count\",\"name\":{\"localizedValue\":\"hyjsvfycx\",\"value\":\"fvoow\"},\"id\":\"vmtgjqppy\"}],\"nextLink\":\"tronzmyhgfi\"}") - .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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ManagedServiceIdentityTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 767494f903b9..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ManagedServiceIdentityTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.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\":\"ceeca93a-db92-4a5f-b988-ee12e5e33476\",\"tenantId\":\"c408db04-02eb-417b-b53c-5454e1132dcd\",\"type\":\"None\",\"userAssignedIdentities\":{\"jywif\":{\"principalId\":\"7871114c-7886-4a3c-aa79-6cc31d3c2a81\",\"clientId\":\"a6115d1e-3967-4d12-bd1f-681fead93a0c\"},\"saagdf\":{\"principalId\":\"113b8ac3-fdd7-4981-bfb9-e6ec90112005\",\"clientId\":\"208f1652-333b-4630-9325-86a1f0933339\"},\"zlhjxrifkwmrvkt\":{\"principalId\":\"a7c74def-f488-4cb9-a4dd-553805944a95\",\"clientId\":\"60fbf18e-e59d-4b48-93a5-8f93881b65f6\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("jywif", new UserAssignedIdentity(), "saagdf", new UserAssignedIdentity(), - "zlhjxrifkwmrvkt", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsWithResponseMockTests.java deleted file mode 100644 index 950c64d43847..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsGetHealthDetailsWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.HealthCheckStatusDetails; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NetworkConnectionsGetHealthDetailsWithResponseMockTests { - @Test - public void testGetHealthDetailsWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"startDateTime\":\"2021-11-21T17:16:57Z\",\"endDateTime\":\"2021-07-25T21:14:07Z\",\"healthChecks\":[{\"status\":\"Unknown\",\"displayName\":\"tzlswvaj\",\"startDateTime\":\"2021-11-03T15:02:37Z\",\"endDateTime\":\"2021-09-26T07:25:25Z\",\"errorType\":\"joqza\",\"recommendedAction\":\"nwqrjzfrgqh\",\"additionalDetails\":\"hcmbuocnjrohmbp\"},{\"status\":\"Passed\",\"displayName\":\"ameb\",\"startDateTime\":\"2021-06-25T02:42:36Z\",\"endDateTime\":\"2021-01-06T18:36:20Z\",\"errorType\":\"fkmroc\",\"recommendedAction\":\"e\",\"additionalDetails\":\"sm\"},{\"status\":\"Warning\",\"displayName\":\"fpyapucygvoavyu\",\"startDateTime\":\"2021-10-30T10:18:56Z\",\"endDateTime\":\"2021-07-23T07:04:55Z\",\"errorType\":\"hi\",\"recommendedAction\":\"gjlgvvpase\",\"additionalDetails\":\"gbuxantuygdh\"}]},\"id\":\"qipir\",\"name\":\"iwrqofulopmjnl\",\"type\":\"x\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HealthCheckStatusDetails response = manager.networkConnections() - .getHealthDetailsWithResponse("mtuatmzwcjjncqtj", "mizvgbgatzuuvbx", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsMockTests.java deleted file mode 100644 index 59040ae51c28..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListHealthDetailsMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.HealthCheckStatusDetails; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NetworkConnectionsListHealthDetailsMockTests { - @Test - public void testListHealthDetails() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"startDateTime\":\"2021-05-12T08:22:14Z\",\"endDateTime\":\"2021-02-23T23:42:20Z\",\"healthChecks\":[{\"status\":\"Running\",\"displayName\":\"hkrttzrazis\",\"startDateTime\":\"2021-05-21T21:38:58Z\",\"endDateTime\":\"2021-12-09T05:38:48Z\",\"errorType\":\"mvanbwzo\",\"recommendedAction\":\"nrxxbsojklin\",\"additionalDetails\":\"dptysprqs\"},{\"status\":\"Pending\",\"displayName\":\"ojpslsvjgpliufi\",\"startDateTime\":\"2021-03-01T00:59:22Z\",\"endDateTime\":\"2021-02-16T14:43:20Z\",\"errorType\":\"vapcoh\",\"recommendedAction\":\"ucqpqojxcxzrz\",\"additionalDetails\":\"gdzbenr\"}]},\"id\":\"cawetzqddt\",\"name\":\"wflj\",\"type\":\"zn\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkConnections() - .listHealthDetails("kjopwbeon", "lkwzdqybxceakxcp", 1877879239, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsMockTests.java deleted file mode 100644 index c252a0dfc25b..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/NetworkConnectionsListOutboundNetworkDependenciesEndpointsMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.OutboundEnvironmentEndpoint; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NetworkConnectionsListOutboundNetworkDependenciesEndpointsMockTests { - @Test - public void testListOutboundNetworkDependenciesEndpoints() throws Exception { - String responseStr - = "{\"value\":[{\"category\":\"tqpbrlcy\",\"endpoints\":[{\"domainName\":\"zkgofxyf\",\"description\":\"uc\",\"endpointDetails\":[{\"port\":1456514758}]},{\"domainName\":\"jttbstv\",\"description\":\"aqnrmvvfkoxmlg\",\"endpointDetails\":[{\"port\":1858596156},{\"port\":2137769434},{\"port\":480189667}]},{\"domainName\":\"zlpdwwex\",\"description\":\"zvlazipbhpwvqsgn\",\"endpointDetails\":[{\"port\":1287157964},{\"port\":1792217092},{\"port\":2008029409},{\"port\":1210376320}]},{\"domainName\":\"meyyvpkpatlb\",\"description\":\"pzgsk\",\"endpointDetails\":[{\"port\":1155999563}]}]}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkConnections() - .listOutboundNetworkDependenciesEndpoints("hcbjpibk", "phuuuerctato", 762617620, - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationDisplayTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationDisplayTests.java deleted file mode 100644 index 8fafa2d67ddf..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationDisplayTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"ghftqsxhqxujxuk\",\"resource\":\"xdigrjg\",\"operation\":\"fzdm\",\"description\":\"qtfihwhbotzinga\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationInnerTests.java deleted file mode 100644 index e84e5d296616..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.OperationInner; -import com.azure.resourcemanager.devcenter.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"fjvfbgofeljagr\",\"isDataAction\":false,\"display\":{\"provider\":\"dvriiiojnal\",\"resource\":\"fk\",\"operation\":\"vsexsowuelu\",\"description\":\"hahhxvrhmzkwpj\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationListResultTests.java deleted file mode 100644 index ed247d0df4d2..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"fxssm\",\"isDataAction\":true,\"display\":{\"provider\":\"dsrezpdrhneuyow\",\"resource\":\"d\",\"operation\":\"t\",\"description\":\"ib\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"kpzi\",\"isDataAction\":false,\"display\":{\"provider\":\"nlfzxiavrmbz\",\"resource\":\"okixrjqcir\",\"operation\":\"pfrlazsz\",\"description\":\"woiindf\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"wbtlhflsjcdh\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationsListMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationsListMockTests.java deleted file mode 100644 index 704fcf74810a..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OperationsListMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"dqlvhukoveof\",\"isDataAction\":true,\"display\":{\"provider\":\"f\",\"resource\":\"jmvl\",\"operation\":\"z\",\"description\":\"blkujrllfojuidjp\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.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); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OutboundEnvironmentEndpointCollectionTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OutboundEnvironmentEndpointCollectionTests.java deleted file mode 100644 index 55834a3ae966..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OutboundEnvironmentEndpointCollectionTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.OutboundEnvironmentEndpointCollection; -import org.junit.jupiter.api.Assertions; - -public final class OutboundEnvironmentEndpointCollectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutboundEnvironmentEndpointCollection model = BinaryData.fromString( - "{\"value\":[{\"category\":\"ijf\",\"endpoints\":[{\"domainName\":\"o\",\"description\":\"rsg\",\"endpointDetails\":[{}]}]},{\"category\":\"huzqgn\",\"endpoints\":[{\"domainName\":\"ynscl\",\"description\":\"hzvhxnkomtkubo\",\"endpointDetails\":[{},{}]},{\"domainName\":\"vdxzxhihfrbbc\",\"description\":\"qagt\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"lfkqojpy\",\"description\":\"gtrd\",\"endpointDetails\":[{},{}]}]},{\"category\":\"mzzs\",\"endpoints\":[{\"domainName\":\"rnysux\",\"description\":\"rafwgckhocxvdf\",\"endpointDetails\":[{},{}]}]},{\"category\":\"fqroudas\",\"endpoints\":[{\"domainName\":\"h\",\"description\":\"vkbunzozudh\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"moy\",\"description\":\"dyuib\",\"endpointDetails\":[{}]},{\"domainName\":\"nbzydvfvfcj\",\"description\":\"eoisrvhmgor\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"is\",\"description\":\"w\",\"endpointDetails\":[{},{},{}]}]}],\"nextLink\":\"plef\"}") - .toObject(OutboundEnvironmentEndpointCollection.class); - Assertions.assertEquals("plef", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutboundEnvironmentEndpointCollection model = new OutboundEnvironmentEndpointCollection().withNextLink("plef"); - model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointCollection.class); - Assertions.assertEquals("plef", model.nextLink()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OutboundEnvironmentEndpointInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OutboundEnvironmentEndpointInnerTests.java deleted file mode 100644 index a8ed5fc569e0..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/OutboundEnvironmentEndpointInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.OutboundEnvironmentEndpointInner; - -public final class OutboundEnvironmentEndpointInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutboundEnvironmentEndpointInner model = BinaryData.fromString( - "{\"category\":\"vxilcbt\",\"endpoints\":[{\"domainName\":\"zeyqxtjjfzqlqhyc\",\"description\":\"odggx\",\"endpointDetails\":[{\"port\":45499984}]}]}") - .toObject(OutboundEnvironmentEndpointInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutboundEnvironmentEndpointInner model = new OutboundEnvironmentEndpointInner(); - model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointInner.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/PoolUpdatePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/PoolUpdatePropertiesTests.java deleted file mode 100644 index e0f97731af1a..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/PoolUpdatePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.PoolUpdateProperties; -import com.azure.resourcemanager.devcenter.models.LicenseType; -import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; -import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus; -import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PoolUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PoolUpdateProperties model = BinaryData.fromString( - "{\"devBoxDefinitionName\":\"nopqgikyzirtx\",\"networkConnectionName\":\"uxzejntpsew\",\"licenseType\":\"Windows_Client\",\"localAdministrator\":\"Disabled\",\"stopOnDisconnect\":{\"status\":\"Enabled\",\"gracePeriodMinutes\":1456439071},\"singleSignOnStatus\":\"Enabled\",\"displayName\":\"qmi\",\"virtualNetworkType\":\"Managed\",\"managedVirtualNetworkRegions\":[\"ggufhyaomtb\",\"hhavgrvkffovjz\"]}") - .toObject(PoolUpdateProperties.class); - Assertions.assertEquals("nopqgikyzirtx", model.devBoxDefinitionName()); - Assertions.assertEquals("uxzejntpsew", model.networkConnectionName()); - Assertions.assertEquals(LicenseType.WINDOWS_CLIENT, model.licenseType()); - Assertions.assertEquals(LocalAdminStatus.DISABLED, model.localAdministrator()); - Assertions.assertEquals(StopOnDisconnectEnableStatus.ENABLED, model.stopOnDisconnect().status()); - Assertions.assertEquals(1456439071, model.stopOnDisconnect().gracePeriodMinutes()); - Assertions.assertEquals(SingleSignOnStatus.ENABLED, model.singleSignOnStatus()); - Assertions.assertEquals("qmi", model.displayName()); - Assertions.assertEquals(VirtualNetworkType.MANAGED, model.virtualNetworkType()); - Assertions.assertEquals("ggufhyaomtb", model.managedVirtualNetworkRegions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PoolUpdateProperties model = new PoolUpdateProperties().withDevBoxDefinitionName("nopqgikyzirtx") - .withNetworkConnectionName("uxzejntpsew") - .withLicenseType(LicenseType.WINDOWS_CLIENT) - .withLocalAdministrator(LocalAdminStatus.DISABLED) - .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) - .withGracePeriodMinutes(1456439071)) - .withSingleSignOnStatus(SingleSignOnStatus.ENABLED) - .withDisplayName("qmi") - .withVirtualNetworkType(VirtualNetworkType.MANAGED) - .withManagedVirtualNetworkRegions(Arrays.asList("ggufhyaomtb", "hhavgrvkffovjz")); - model = BinaryData.fromObject(model).toObject(PoolUpdateProperties.class); - Assertions.assertEquals("nopqgikyzirtx", model.devBoxDefinitionName()); - Assertions.assertEquals("uxzejntpsew", model.networkConnectionName()); - Assertions.assertEquals(LicenseType.WINDOWS_CLIENT, model.licenseType()); - Assertions.assertEquals(LocalAdminStatus.DISABLED, model.localAdministrator()); - Assertions.assertEquals(StopOnDisconnectEnableStatus.ENABLED, model.stopOnDisconnect().status()); - Assertions.assertEquals(1456439071, model.stopOnDisconnect().gracePeriodMinutes()); - Assertions.assertEquals(SingleSignOnStatus.ENABLED, model.singleSignOnStatus()); - Assertions.assertEquals("qmi", model.displayName()); - Assertions.assertEquals(VirtualNetworkType.MANAGED, model.virtualNetworkType()); - Assertions.assertEquals("ggufhyaomtb", model.managedVirtualNetworkRegions().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/PoolUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/PoolUpdateTests.java deleted file mode 100644 index a221c281b02f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/PoolUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.LicenseType; -import com.azure.resourcemanager.devcenter.models.LocalAdminStatus; -import com.azure.resourcemanager.devcenter.models.PoolUpdate; -import com.azure.resourcemanager.devcenter.models.SingleSignOnStatus; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus; -import com.azure.resourcemanager.devcenter.models.VirtualNetworkType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PoolUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PoolUpdate model = BinaryData.fromString( - "{\"properties\":{\"devBoxDefinitionName\":\"jmfxumvf\",\"networkConnectionName\":\"uyovw\",\"licenseType\":\"Windows_Client\",\"localAdministrator\":\"Enabled\",\"stopOnDisconnect\":{\"status\":\"Disabled\",\"gracePeriodMinutes\":1537243599},\"singleSignOnStatus\":\"Enabled\",\"displayName\":\"wzdgirujbzbo\",\"virtualNetworkType\":\"Unmanaged\",\"managedVirtualNetworkRegions\":[\"tdcqvpniyuj\",\"iylwdshfssnr\",\"gy\",\"frymsgaojfmwnc\"]},\"tags\":{\"rctym\":\"rfh\",\"xacpqjli\":\"xoftpipiwyczu\",\"skasdvlmfwdgzxu\":\"hyus\"},\"location\":\"cvpa\"}") - .toObject(PoolUpdate.class); - Assertions.assertEquals("rfh", model.tags().get("rctym")); - Assertions.assertEquals("cvpa", model.location()); - Assertions.assertEquals("jmfxumvf", model.devBoxDefinitionName()); - Assertions.assertEquals("uyovw", model.networkConnectionName()); - Assertions.assertEquals(LicenseType.WINDOWS_CLIENT, model.licenseType()); - Assertions.assertEquals(LocalAdminStatus.ENABLED, model.localAdministrator()); - Assertions.assertEquals(StopOnDisconnectEnableStatus.DISABLED, model.stopOnDisconnect().status()); - Assertions.assertEquals(1537243599, model.stopOnDisconnect().gracePeriodMinutes()); - Assertions.assertEquals(SingleSignOnStatus.ENABLED, model.singleSignOnStatus()); - Assertions.assertEquals("wzdgirujbzbo", model.displayName()); - Assertions.assertEquals(VirtualNetworkType.UNMANAGED, model.virtualNetworkType()); - Assertions.assertEquals("tdcqvpniyuj", model.managedVirtualNetworkRegions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PoolUpdate model = new PoolUpdate() - .withTags(mapOf("rctym", "rfh", "xacpqjli", "xoftpipiwyczu", "skasdvlmfwdgzxu", "hyus")) - .withLocation("cvpa") - .withDevBoxDefinitionName("jmfxumvf") - .withNetworkConnectionName("uyovw") - .withLicenseType(LicenseType.WINDOWS_CLIENT) - .withLocalAdministrator(LocalAdminStatus.ENABLED) - .withStopOnDisconnect(new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.DISABLED) - .withGracePeriodMinutes(1537243599)) - .withSingleSignOnStatus(SingleSignOnStatus.ENABLED) - .withDisplayName("wzdgirujbzbo") - .withVirtualNetworkType(VirtualNetworkType.UNMANAGED) - .withManagedVirtualNetworkRegions(Arrays.asList("tdcqvpniyuj", "iylwdshfssnr", "gy", "frymsgaojfmwnc")); - model = BinaryData.fromObject(model).toObject(PoolUpdate.class); - Assertions.assertEquals("rfh", model.tags().get("rctym")); - Assertions.assertEquals("cvpa", model.location()); - Assertions.assertEquals("jmfxumvf", model.devBoxDefinitionName()); - Assertions.assertEquals("uyovw", model.networkConnectionName()); - Assertions.assertEquals(LicenseType.WINDOWS_CLIENT, model.licenseType()); - Assertions.assertEquals(LocalAdminStatus.ENABLED, model.localAdministrator()); - Assertions.assertEquals(StopOnDisconnectEnableStatus.DISABLED, model.stopOnDisconnect().status()); - Assertions.assertEquals(1537243599, model.stopOnDisconnect().gracePeriodMinutes()); - Assertions.assertEquals(SingleSignOnStatus.ENABLED, model.singleSignOnStatus()); - Assertions.assertEquals("wzdgirujbzbo", model.displayName()); - Assertions.assertEquals(VirtualNetworkType.UNMANAGED, model.virtualNetworkType()); - Assertions.assertEquals("tdcqvpniyuj", model.managedVirtualNetworkRegions().get(0)); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetWithResponseMockTests.java deleted file mode 100644 index 8b8aa6ecc0f4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AllowedEnvironmentType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectAllowedEnvironmentTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"MovingResources\",\"displayName\":\"pz\"},\"id\":\"kovmribiatt\",\"name\":\"plucfotangcfhnyk\",\"type\":\"cugswvxwlmzqw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AllowedEnvironmentType response = manager.projectAllowedEnvironmentTypes() - .getWithResponse("lwvsgm", "ohqfzizv", "xmmkjs", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListMockTests.java deleted file mode 100644 index 1af0805272e9..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectAllowedEnvironmentTypesListMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.AllowedEnvironmentType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectAllowedEnvironmentTypesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"displayName\":\"nzhrgmqgjsxvpqcb\"},\"id\":\"mbodthsqqgvri\",\"name\":\"bakclacjfrnxous\",\"type\":\"au\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.projectAllowedEnvironmentTypes() - .list("tglxx", "ljfp", 1925996996, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogSettingsTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogSettingsTests.java deleted file mode 100644 index 0cfcc2eb0dae..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectCatalogSettingsTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProjectCatalogSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectCatalogSettings model = BinaryData.fromString( - "{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}") - .toObject(ProjectCatalogSettings.class); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, model.catalogItemSyncTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectCatalogSettings model = new ProjectCatalogSettings().withCatalogItemSyncTypes( - Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION, - CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION)); - model = BinaryData.fromObject(model).toObject(ProjectCatalogSettings.class); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, model.catalogItemSyncTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeInnerTests.java deleted file mode 100644 index fe50202a0ce7..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ProjectEnvironmentTypeInner; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProjectEnvironmentTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectEnvironmentTypeInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Created\",\"environmentCount\":1492751876,\"deploymentTargetId\":\"jnkaljutiiswacff\",\"displayName\":\"k\",\"status\":\"Disabled\",\"creatorRoleAssignment\":{\"roles\":{\"hdlxyjrxsagafcn\":{\"roleName\":\"hqcrailvpnpp\",\"description\":\"flrwd\"},\"kcvqvpke\":{\"roleName\":\"gwq\",\"description\":\"nedgfbc\"}}},\"userRoleAssignments\":{\"rfouyftaakcpw\":{\"roles\":{\"dldwmgxc\":{\"roleName\":\"hvoodsotbobzd\",\"description\":\"cjwvn\"},\"yqsluic\":{\"roleName\":\"slpmutwuo\",\"description\":\"rpkhjwn\"},\"vmwy\":{\"roleName\":\"ggkzzlvmbmpa\",\"description\":\"odfvuefywsbp\"}}},\"kcbcue\":{\"roles\":{\"xvy\":{\"roleName\":\"qtmnubexkpzk\",\"description\":\"ondjmq\"},\"qgxy\":{\"roleName\":\"mg\",\"description\":\"pkwhojvpa\"},\"dd\":{\"roleName\":\"ocmbqfqvmkcxoza\",\"description\":\"helxprglya\"}}},\"sipqii\":{\"roles\":{\"bahwfl\":{\"roleName\":\"gciqibrh\",\"description\":\"xsdqrhzoymibmrqy\"},\"iexpbtgiwbwo\":{\"roleName\":\"zdtmhrkwofy\",\"description\":\"oqac\"},\"okulpiujwa\":{\"roleName\":\"washr\",\"description\":\"tkcnqxwb\"}}}}},\"tags\":{\"iuqgbdbutauv\":\"uqerpqlpqwc\"},\"identity\":{\"principalId\":\"74619636-032f-40aa-8b90-ba2a36ff92d1\",\"tenantId\":\"5230998e-8323-47fd-a56e-08060b69f320\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"hykojoxafnndlpic\":{\"principalId\":\"256784f3-76b5-493a-abec-5d4014cae167\",\"clientId\":\"d8abc427-2e02-4783-a756-a0eb1b7e2394\"},\"ymkcdyhb\":{\"principalId\":\"8a1da538-f1e9-4fff-94c1-24ed4528fe52\",\"clientId\":\"8716f06d-e26e-4b4c-9f26-81cc17dc7c8b\"},\"pwdreqnovvqf\":{\"principalId\":\"6b92de7f-c98a-4b78-b136-aad4c30b7eee\",\"clientId\":\"89f46085-3794-402e-b927-17aa8c692767\"}}},\"location\":\"ljxywsu\",\"id\":\"yrs\",\"name\":\"dsytgadgvr\",\"type\":\"ea\"}") - .toObject(ProjectEnvironmentTypeInner.class); - Assertions.assertEquals("uqerpqlpqwc", model.tags().get("iuqgbdbutauv")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ljxywsu", model.location()); - Assertions.assertEquals("jnkaljutiiswacff", model.deploymentTargetId()); - Assertions.assertEquals("k", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.DISABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectEnvironmentTypeInner model = new ProjectEnvironmentTypeInner() - .withTags(mapOf("iuqgbdbutauv", "uqerpqlpqwc")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("hykojoxafnndlpic", new UserAssignedIdentity(), "ymkcdyhb", - new UserAssignedIdentity(), "pwdreqnovvqf", new UserAssignedIdentity()))) - .withLocation("ljxywsu") - .withDeploymentTargetId("jnkaljutiiswacff") - .withDisplayName("k") - .withStatus(EnvironmentTypeEnableStatus.DISABLED) - .withCreatorRoleAssignment(new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment() - .withRoles(mapOf("hdlxyjrxsagafcn", new EnvironmentRole(), "kcvqvpke", new EnvironmentRole()))) - .withUserRoleAssignments(mapOf("rfouyftaakcpw", - new UserRoleAssignmentValue().withRoles(mapOf("dldwmgxc", new EnvironmentRole(), "yqsluic", - new EnvironmentRole(), "vmwy", new EnvironmentRole())), - "kcbcue", - new UserRoleAssignmentValue().withRoles( - mapOf("xvy", new EnvironmentRole(), "qgxy", new EnvironmentRole(), "dd", new EnvironmentRole())), - "sipqii", new UserRoleAssignmentValue().withRoles(mapOf("bahwfl", new EnvironmentRole(), "iexpbtgiwbwo", - new EnvironmentRole(), "okulpiujwa", new EnvironmentRole())))); - model = BinaryData.fromObject(model).toObject(ProjectEnvironmentTypeInner.class); - Assertions.assertEquals("uqerpqlpqwc", model.tags().get("iuqgbdbutauv")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ljxywsu", model.location()); - Assertions.assertEquals("jnkaljutiiswacff", model.deploymentTargetId()); - Assertions.assertEquals("k", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.DISABLED, model.status()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeListResultTests.java deleted file mode 100644 index 8985622b4cea..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeListResult; - -public final class ProjectEnvironmentTypeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectEnvironmentTypeListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"StorageProvisioningFailed\",\"environmentCount\":581406254,\"deploymentTargetId\":\"auvjfdxxivet\",\"displayName\":\"cqaqtdoqmcbx\",\"status\":\"Enabled\",\"creatorRoleAssignment\":{\"roles\":{\"lqbhsf\":{}}},\"userRoleAssignments\":{\"bfovasrruvwbhsq\":{\"roles\":{\"tkblmpewww\":{},\"bkrvrnsvshqj\":{},\"hxcr\":{}}},\"otftpvjzbexilz\":{\"roles\":{\"bcgjbirxbp\":{},\"bsrfbj\":{},\"dtws\":{}}}}},\"tags\":{\"aruoujmkcjhwqyt\":\"qqnvwpmq\",\"bnw\":\"r\",\"enq\":\"ewgdrjervn\",\"ndoygmifthnzdnd\":\"eh\"},\"identity\":{\"principalId\":\"cf5b13a1-c0b5-42cc-ab80-1dfa16b6fdde\",\"tenantId\":\"839c5364-3503-4463-a751-116c6cd8ee94\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ynduha\":{\"principalId\":\"7bad815f-8cc3-4136-bb9e-24b32ffe73f2\",\"clientId\":\"30510258-b217-4fe8-a63f-42296890a2ec\"}}},\"location\":\"qlkth\",\"id\":\"aqolbgycduiertg\",\"name\":\"cym\",\"type\":\"aolps\"},{\"properties\":{\"provisioningState\":\"RolloutInProgress\",\"environmentCount\":718226275,\"deploymentTargetId\":\"dnbbglzps\",\"displayName\":\"ydmcwyhzdxssa\",\"status\":\"Disabled\",\"creatorRoleAssignment\":{\"roles\":{\"dfznudaodv\":{},\"zbn\":{},\"blylpstdbh\":{},\"xsrz\":{}}},\"userRoleAssignments\":{\"tmweriofzpyq\":{\"roles\":{\"rsc\":{},\"ntnev\":{},\"iwjmygtdssls\":{}}},\"dnkwwtppjflcxog\":{\"roles\":{\"wab\":{},\"ets\":{},\"hszhedplvwiwu\":{},\"mwmbes\":{}}},\"bdagxt\":{\"roles\":{\"onz\":{},\"nsikvmkqzeqqkdl\":{},\"fzxmhhvhgureodkw\":{}}},\"ripl\":{\"roles\":{\"dxbx\":{},\"akbogqxndlkzgxh\":{}}}}},\"tags\":{\"wlrbqtkoievseo\":\"dxunkbebxmubyyn\",\"wzizxbmpgcjefuzm\":\"gqrlltmuwla\"},\"identity\":{\"principalId\":\"5ce37899-930f-40f6-ae73-5d90b0678c9c\",\"tenantId\":\"608a21be-60de-417b-b80e-12a0383e0dd9\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"orppxebmnzbtb\":{\"principalId\":\"d88a12c8-3a0d-42b3-861d-c302a40df5f8\",\"clientId\":\"8a660f7f-9ef0-4989-a5ab-16a24d79fb68\"}}},\"location\":\"pglkf\",\"id\":\"hdneuelfph\",\"name\":\"dyhtozfikdowwquu\",\"type\":\"xzxcl\"}],\"nextLink\":\"thhqzonosggbh\"}") - .toObject(ProjectEnvironmentTypeListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectEnvironmentTypeListResult model = new ProjectEnvironmentTypeListResult(); - model = BinaryData.fromObject(model).toObject(ProjectEnvironmentTypeListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypePropertiesTests.java deleted file mode 100644 index 3cb41a964d92..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ProjectEnvironmentTypeProperties; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProjectEnvironmentTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectEnvironmentTypeProperties model = BinaryData.fromString( - "{\"provisioningState\":\"NotSpecified\",\"environmentCount\":999689633,\"deploymentTargetId\":\"arrwlquu\",\"displayName\":\"fqka\",\"status\":\"Enabled\",\"creatorRoleAssignment\":{\"roles\":{\"ohqkvpuvksgpls\":{\"roleName\":\"pubjibw\",\"description\":\"f\"},\"ihleos\":{\"roleName\":\"nynfsynljphuo\",\"description\":\"odlqiyntor\"},\"ioxiysuiizyn\":{\"roleName\":\"w\",\"description\":\"mslyzrpzbchckqqz\"}}},\"userRoleAssignments\":{\"nayrhyrnxxmueedn\":{\"roles\":{\"mabiknsorgjhxb\":{\"roleName\":\"rwyhqmibzyhwitsm\",\"description\":\"yynpcdpumnzgmwz\"},\"lxdy\":{\"roleName\":\"tlwwrlk\",\"description\":\"tncvokot\"},\"vpa\":{\"roleName\":\"syocogjltdtbnnha\",\"description\":\"ocrkvcikh\"},\"ccjzkzivgvv\":{\"roleName\":\"gxqquezik\",\"description\":\"ggxkallatmelwuip\"}}}}}") - .toObject(ProjectEnvironmentTypeProperties.class); - Assertions.assertEquals("arrwlquu", model.deploymentTargetId()); - Assertions.assertEquals("fqka", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectEnvironmentTypeProperties model - = new ProjectEnvironmentTypeProperties().withDeploymentTargetId("arrwlquu") - .withDisplayName("fqka") - .withStatus(EnvironmentTypeEnableStatus.ENABLED) - .withCreatorRoleAssignment( - new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment().withRoles(mapOf("ohqkvpuvksgpls", - new EnvironmentRole(), "ihleos", new EnvironmentRole(), "ioxiysuiizyn", new EnvironmentRole()))) - .withUserRoleAssignments(mapOf("nayrhyrnxxmueedn", - new UserRoleAssignmentValue().withRoles(mapOf("mabiknsorgjhxb", new EnvironmentRole(), "lxdy", - new EnvironmentRole(), "vpa", new EnvironmentRole(), "ccjzkzivgvv", new EnvironmentRole())))); - model = BinaryData.fromObject(model).toObject(ProjectEnvironmentTypeProperties.class); - Assertions.assertEquals("arrwlquu", model.deploymentTargetId()); - Assertions.assertEquals("fqka", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, model.status()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignmentTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignmentTests.java deleted file mode 100644 index a620e121d604..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignmentTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import java.util.HashMap; -import java.util.Map; - -public final class ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment model = BinaryData.fromString( - "{\"roles\":{\"eqidbqfatpx\":{\"roleName\":\"dgqggebdu\",\"description\":\"g\"},\"jqbjhhy\":{\"roleName\":\"rxcyjmoad\",\"description\":\"varmywdmj\"},\"uhpkxkgymar\":{\"roleName\":\"rw\",\"description\":\"co\"},\"ssofwqmzqa\":{\"roleName\":\"n\",\"description\":\"xqugjhkycubedd\"}}}") - .toObject(ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment model - = new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment() - .withRoles(mapOf("eqidbqfatpx", new EnvironmentRole(), "jqbjhhy", new EnvironmentRole(), "uhpkxkgymar", - new EnvironmentRole(), "ssofwqmzqa", new EnvironmentRole())); - model - = BinaryData.fromObject(model).toObject(ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment.class); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdatePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdatePropertiesTests.java deleted file mode 100644 index 6e3b05589b17..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdatePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ProjectEnvironmentTypeUpdateProperties; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProjectEnvironmentTypeUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectEnvironmentTypeUpdateProperties model = BinaryData.fromString( - "{\"deploymentTargetId\":\"dvstkw\",\"displayName\":\"tchealmf\",\"status\":\"Enabled\",\"creatorRoleAssignment\":{\"roles\":{\"udxepxgyqagv\":{\"roleName\":\"dvwvgpio\",\"description\":\"wxrt\"},\"j\":{\"roleName\":\"mnpkukghimdblxg\",\"description\":\"mfnjh\"}}},\"userRoleAssignments\":{\"vxwc\":{\"roles\":{\"a\":{\"roleName\":\"kfoqreyfkzikfj\",\"description\":\"n\"}}},\"zikhl\":{\"roles\":{\"abfatkl\":{\"roleName\":\"c\",\"description\":\"elsfeaen\"},\"xagl\":{\"roleName\":\"xbjhwuaanozjosph\",\"description\":\"ulpjr\"},\"fcktqumiekke\":{\"roleName\":\"imjwosyt\",\"description\":\"tcs\"}}}}}") - .toObject(ProjectEnvironmentTypeUpdateProperties.class); - Assertions.assertEquals("dvstkw", model.deploymentTargetId()); - Assertions.assertEquals("tchealmf", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectEnvironmentTypeUpdateProperties model - = new ProjectEnvironmentTypeUpdateProperties().withDeploymentTargetId("dvstkw") - .withDisplayName("tchealmf") - .withStatus(EnvironmentTypeEnableStatus.ENABLED) - .withCreatorRoleAssignment(new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment() - .withRoles(mapOf("udxepxgyqagv", new EnvironmentRole(), "j", new EnvironmentRole()))) - .withUserRoleAssignments( - mapOf("vxwc", new UserRoleAssignmentValue().withRoles(mapOf("a", new EnvironmentRole())), "zikhl", - new UserRoleAssignmentValue().withRoles(mapOf("abfatkl", new EnvironmentRole(), "xagl", - new EnvironmentRole(), "fcktqumiekke", new EnvironmentRole())))); - model = BinaryData.fromObject(model).toObject(ProjectEnvironmentTypeUpdateProperties.class); - Assertions.assertEquals("dvstkw", model.deploymentTargetId()); - Assertions.assertEquals("tchealmf", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, model.status()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdateTests.java deleted file mode 100644 index 31bca803ce3b..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypeUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdate; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProjectEnvironmentTypeUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectEnvironmentTypeUpdate model = BinaryData.fromString( - "{\"properties\":{\"deploymentTargetId\":\"kniod\",\"displayName\":\"oebwnujhemms\",\"status\":\"Enabled\",\"creatorRoleAssignment\":{\"roles\":{\"f\":{\"roleName\":\"dtjinfw\",\"description\":\"fltkacjv\"},\"blylsyxkqjnsj\":{\"roleName\":\"lfoakg\",\"description\":\"fpagaowpulp\"},\"kfzbeyvpnqicvi\":{\"roleName\":\"vti\",\"description\":\"xsdszuempsb\"},\"hmlwpaztzpo\":{\"roleName\":\"kjj\",\"description\":\"xrbuukzclew\"}}},\"userRoleAssignments\":{\"aznqntoru\":{\"roles\":{\"zfeqztppri\":{\"roleName\":\"yfzqwhxxbu\",\"description\":\"a\"},\"dpfuvg\":{\"roleName\":\"xorjaltolmncwsob\",\"description\":\"csdbnwdcfhuc\"},\"udutnco\":{\"roleName\":\"bjj\",\"description\":\"nvxbvt\"},\"bgdknnqv\":{\"roleName\":\"r\",\"description\":\"qtvcofudflvkgj\"}}},\"khazxkhnzbonlwn\":{\"roles\":{\"etaebu\":{\"roleName\":\"a\",\"description\":\"kycgrauwj\"},\"tpuqujmq\":{\"roleName\":\"vdmovsmzlxwabm\",\"description\":\"efkifr\"},\"ezkojvdcp\":{\"roleName\":\"kfbtndoaongbjc\",\"description\":\"ujitcjedftww\"},\"iqopidoamciod\":{\"roleName\":\"oqouicybxarzgszu\",\"description\":\"x\"}}},\"dcngqqmoakufgmj\":{\"roles\":{\"t\":{\"roleName\":\"okdwb\",\"description\":\"kszzcmrvexztv\"},\"aw\":{\"roleName\":\"sfraoyzko\",\"description\":\"tlmngu\"},\"r\":{\"roleName\":\"ldsyuuximerqfob\",\"description\":\"znkbykutwpfhpagm\"},\"twvogvbbe\":{\"roleName\":\"dsnfdsdoakgtdl\",\"description\":\"kzevdlhewpusds\"}}},\"l\":{\"roles\":{\"hziuiefozbhdms\":{\"roleName\":\"dgrtwaenuuzkopbm\",\"description\":\"rfdwoyu\"}}}}},\"tags\":{\"ae\":\"hoftr\",\"ah\":\"u\",\"piyylhalnswhccsp\":\"icslfaoq\",\"scywuggwoluhc\":\"kaivwit\"},\"identity\":{\"principalId\":\"a1a137ed-7aca-4b3b-be54-6c687f49e61b\",\"tenantId\":\"72d30c96-04c8-4b18-a886-9f22b12d7eed\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"sbrgz\":{\"principalId\":\"f0ba38c0-ed17-4977-ab24-6fabc582b397\",\"clientId\":\"096ab311-e1dd-43f1-81de-bb6fb2e6c733\"}}}}") - .toObject(ProjectEnvironmentTypeUpdate.class); - Assertions.assertEquals("hoftr", model.tags().get("ae")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("kniod", model.deploymentTargetId()); - Assertions.assertEquals("oebwnujhemms", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectEnvironmentTypeUpdate model = new ProjectEnvironmentTypeUpdate() - .withTags(mapOf("ae", "hoftr", "ah", "u", "piyylhalnswhccsp", "icslfaoq", "scywuggwoluhc", "kaivwit")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("sbrgz", new UserAssignedIdentity()))) - .withDeploymentTargetId("kniod") - .withDisplayName("oebwnujhemms") - .withStatus(EnvironmentTypeEnableStatus.ENABLED) - .withCreatorRoleAssignment(new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment() - .withRoles(mapOf("f", new EnvironmentRole(), "blylsyxkqjnsj", new EnvironmentRole(), "kfzbeyvpnqicvi", - new EnvironmentRole(), "hmlwpaztzpo", new EnvironmentRole()))) - .withUserRoleAssignments(mapOf("aznqntoru", - new UserRoleAssignmentValue().withRoles(mapOf("zfeqztppri", new EnvironmentRole(), "dpfuvg", - new EnvironmentRole(), "udutnco", new EnvironmentRole(), "bgdknnqv", new EnvironmentRole())), - "khazxkhnzbonlwn", - new UserRoleAssignmentValue().withRoles(mapOf("etaebu", new EnvironmentRole(), "tpuqujmq", - new EnvironmentRole(), "ezkojvdcp", new EnvironmentRole(), "iqopidoamciod", new EnvironmentRole())), - "dcngqqmoakufgmj", - new UserRoleAssignmentValue().withRoles(mapOf("t", new EnvironmentRole(), "aw", new EnvironmentRole(), - "r", new EnvironmentRole(), "twvogvbbe", new EnvironmentRole())), - "l", new UserRoleAssignmentValue().withRoles(mapOf("hziuiefozbhdms", new EnvironmentRole())))); - model = BinaryData.fromObject(model).toObject(ProjectEnvironmentTypeUpdate.class); - Assertions.assertEquals("hoftr", model.tags().get("ae")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("kniod", model.deploymentTargetId()); - Assertions.assertEquals("oebwnujhemms", model.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, model.status()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 640bb3ea40a0..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -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 reactor.core.publisher.Mono; - -public final class ProjectEnvironmentTypesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Accepted\",\"environmentCount\":1601507048,\"deploymentTargetId\":\"k\",\"displayName\":\"aimmoiroqb\",\"status\":\"Disabled\",\"creatorRoleAssignment\":{\"roles\":{\"sjcaacfdmmcpugm\":{\"roleName\":\"apyyrmfsvbpavbo\",\"description\":\"ppdbwnupgahxkum\"}}},\"userRoleAssignments\":{\"chorimkrsr\":{\"roles\":{\"vufhbzehewhoq\":{},\"nlbqnbldxeaclg\":{}}},\"aabeolhbhlvbmxuq\":{\"roles\":{\"ucsofldpuviyf\":{}}},\"siowlkjxnqpv\":{\"roles\":{\"xtkcudfbsfar\":{}}}}},\"tags\":{\"saoafcluqvox\":\"stmhqykizmd\",\"gwe\":\"ycjimryvwgcwwpbm\",\"efoh\":\"ydsx\",\"mtkhlowkxxpvbr\":\"cbvopwndyqleallk\"},\"identity\":{\"principalId\":\"fbfd6108-9e0c-4b96-a04c-9e02ff2a73ba\",\"tenantId\":\"6d70021e-b46a-429d-b34f-947efba3234b\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"hotlhikcyychunsj\":{\"principalId\":\"e9d4400c-0d2d-46fa-a2bf-b3499c649c4d\",\"clientId\":\"59a2e49b-7c02-417a-92f8-05282ad28672\"},\"rtws\":{\"principalId\":\"1808689b-59ba-4a5a-8dac-d3c82f0633db\",\"clientId\":\"f9d62a64-a9d2-4613-b724-682a12f39afa\"},\"vuicp\":{\"principalId\":\"a784aa71-ac5b-4470-bf09-c3e3d93f45eb\",\"clientId\":\"91812808-dae6-4d9d-8427-6f9d0f224b5b\"}}},\"location\":\"trrmhwrb\",\"id\":\"pyf\",\"name\":\"ubhvj\",\"type\":\"lrocuyzlwh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProjectEnvironmentType response = manager.projectEnvironmentTypes() - .define("etndnbfqyggagf") - .withExistingProject("uuuybnchrsziz", "yuel") - .withRegion("yuicdhzbdy") - .withTags(mapOf("nwvroevytlyokrr", "annovvoxczytpr", "uxvnsasbcrymodi", "o", "lmv", "rxklobdxnazpmk", - "zxlioh", "vfxzopjh")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("ba", new UserAssignedIdentity(), "bbnz", new UserAssignedIdentity(), - "knapq", new UserAssignedIdentity()))) - .withDeploymentTargetId("wahzjmucftbyr") - .withDisplayName("rohkpigqfusu") - .withStatus(EnvironmentTypeEnableStatus.ENABLED) - .withCreatorRoleAssignment( - new ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment().withRoles(mapOf("ydyynfsvkh", - new EnvironmentRole(), "khnmgbrou", new EnvironmentRole(), "wjxhpdulon", new EnvironmentRole()))) - .withUserRoleAssignments(mapOf("kfuarenlv", - new UserRoleAssignmentValue().withRoles(mapOf("qwtehtuevr", new EnvironmentRole(), "rljyoogwxhnsdu", - new EnvironmentRole(), "gwbsreurf", new EnvironmentRole())), - "chaqdtvqec", - new UserRoleAssignmentValue() - .withRoles(mapOf("klnvnafvvkyfede", new EnvironmentRole(), "jboslcqxypok", new EnvironmentRole(), - "hminqcymczngnbdx", new EnvironmentRole(), "ewuninvud", new EnvironmentRole())), - "xzvtzna", new UserRoleAssignmentValue().withRoles(mapOf("tmxxdtddmflhuy", new EnvironmentRole())))) - .create(); - - Assertions.assertEquals("stmhqykizmd", response.tags().get("saoafcluqvox")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("trrmhwrb", response.location()); - Assertions.assertEquals("k", response.deploymentTargetId()); - Assertions.assertEquals("aimmoiroqb", response.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.DISABLED, response.status()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteWithResponseMockTests.java deleted file mode 100644 index e5682af34b1f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesDeleteWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectEnvironmentTypesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.projectEnvironmentTypes() - .deleteWithResponse("ikczvvitacgxmf", "sserxhtvsoxhlwn", "sjgqrsxyp", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetWithResponseMockTests.java deleted file mode 100644 index 630143cb6f26..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectEnvironmentTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Created\",\"environmentCount\":1418512133,\"deploymentTargetId\":\"xlzhcoxovnekh\",\"displayName\":\"lusfnrdtjxtxrdcq\",\"status\":\"Disabled\",\"creatorRoleAssignment\":{\"roles\":{\"ughtuqfecjxeygtu\":{\"roleName\":\"gepuslvyjtc\",\"description\":\"wkasiziesf\"},\"zrhwp\":{\"roleName\":\"uicbuewmrsw\",\"description\":\"lx\"},\"bxncnwfepbnw\":{\"roleName\":\"xjbaqehgpdohzjq\",\"description\":\"ucoig\"},\"dlfgtdysnaq\":{\"roleName\":\"m\",\"description\":\"gcgbjb\"}}},\"userRoleAssignments\":{\"eg\":{\"roles\":{\"ctqhamzjrwdk\":{},\"zeqyjleziun\":{},\"xdfzantkw\":{}}},\"m\":{\"roles\":{\"lbnseqac\":{},\"jvpilguooqja\":{}}},\"delqacslmoto\":{\"roles\":{\"gueiookjbsahrtdt\":{}}},\"ab\":{\"roles\":{\"fxof\":{},\"cjkgdirazftxej\":{}}}}},\"tags\":{\"pexcmjurbuhh\":\"jtmvc\",\"wkffdjkt\":\"kyqltqsrogt\",\"n\":\"ysidfvclgl\",\"qogsfikayian\":\"uijtkbu\"},\"identity\":{\"principalId\":\"bb868084-2498-4cb7-9ddd-99c42584864d\",\"tenantId\":\"7d541e15-3060-442e-a324-15f18f0c57ad\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"qxfzyjqttvwk\":{\"principalId\":\"690802ce-69b2-43f3-b8d1-a693cdb586d9\",\"clientId\":\"2386f85e-f708-4829-b7d7-3beced5ce28b\"}}},\"location\":\"hjpenuygbq\",\"id\":\"qekewvnqvcd\",\"name\":\"guaucmfdjwnla\",\"type\":\"punj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProjectEnvironmentType response = manager.projectEnvironmentTypes() - .getWithResponse("nszonwpngaj", "n", "ixjawrtm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jtmvc", response.tags().get("pexcmjurbuhh")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("hjpenuygbq", response.location()); - Assertions.assertEquals("xlzhcoxovnekh", response.deploymentTargetId()); - Assertions.assertEquals("lusfnrdtjxtxrdcq", response.displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.DISABLED, response.status()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListMockTests.java deleted file mode 100644 index c62ef5e270ff..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectEnvironmentTypesListMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.EnvironmentTypeEnableStatus; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectEnvironmentType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectEnvironmentTypesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"environmentCount\":979398617,\"deploymentTargetId\":\"jibuzphdug\",\"displayName\":\"iknp\",\"status\":\"Enabled\",\"creatorRoleAssignment\":{\"roles\":{\"x\":{\"roleName\":\"qhibtozipqwjedm\",\"description\":\"r\"},\"gcl\":{\"roleName\":\"wpktvqylkmqpzoyh\",\"description\":\"bcg\"},\"hpzpo\":{\"roleName\":\"oebqinjipn\",\"description\":\"fujqlafcba\"},\"uartvti\":{\"roleName\":\"iyjwpfilkmkkho\",\"description\":\"dndviauogp\"}}},\"userRoleAssignments\":{\"xffi\":{\"roles\":{\"chnmna\":{},\"mnxhkxjqirwrweo\":{}}},\"ttaboidvmfqh\":{\"roles\":{\"wrsnewmozqvbu\":{},\"qmamhsycxhxzga\":{}}}}},\"tags\":{\"g\":\"bowsepd\",\"c\":\"mtdherngb\",\"obkauxofsh\":\"uahokq\"},\"identity\":{\"principalId\":\"4c58b0cf-10ee-4e52-8e14-95b155b9bb5d\",\"tenantId\":\"11cfb244-b80e-4c69-a491-cea4bbdefabb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"iywzejy\":{\"principalId\":\"817851ec-78de-4826-b4b2-ec7dae60ada1\",\"clientId\":\"83713492-1d29-4dbc-9170-f5013ee2ef9c\"},\"lwkojpllndnpdw\":{\"principalId\":\"b8fcac5f-62f2-4819-a9ed-ab4c251b29bd\",\"clientId\":\"0f75c803-2535-4bec-9757-b3b159690ce3\"},\"afgfugsnn\":{\"principalId\":\"32090794-adca-4920-a9ac-b11223be4759\",\"clientId\":\"f8fe44b7-6977-4a49-ac1c-434307620cf8\"},\"et\":{\"principalId\":\"61db8b70-8713-4401-8563-d386722e616d\",\"clientId\":\"70324f99-665d-49e1-9a05-c64a542f0fe2\"}}},\"location\":\"ypococtfjgtixr\",\"id\":\"zuyt\",\"name\":\"rmlmuowo\",\"type\":\"bauiropi\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.projectEnvironmentTypes() - .list("vtxnjmxmcuqud", "cvclxynpdk", 1887329670, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bowsepd", response.iterator().next().tags().get("g")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("ypococtfjgtixr", response.iterator().next().location()); - Assertions.assertEquals("jibuzphdug", response.iterator().next().deploymentTargetId()); - Assertions.assertEquals("iknp", response.iterator().next().displayName()); - Assertions.assertEquals(EnvironmentTypeEnableStatus.ENABLED, response.iterator().next().status()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectInnerTests.java deleted file mode 100644 index 5e93886bef93..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ProjectInner; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProjectInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"devCenterUri\":\"jdous\",\"devCenterId\":\"qvkoc\",\"description\":\"jdkwtnhxbnjb\",\"maxDevBoxesPerUser\":703766696,\"displayName\":\"rglssainqpj\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"57787e3b-2b33-4331-99dd-cbe45020da13\",\"tenantId\":\"ae03694d-71a9-4886-b7be-fda36b629931\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"gxsabkyq\":{\"principalId\":\"a76d32de-83b1-465c-a635-74d7981e548c\",\"clientId\":\"24253647-10e4-4aad-ab26-6798901fef21\"},\"jitcjczdzevn\":{\"principalId\":\"a2cfa346-6a0c-4106-b511-188fdbb329ab\",\"clientId\":\"82a295d3-59fc-4158-8090-a8893e620357\"},\"rwpdappdsbdkvwrw\":{\"principalId\":\"3a4ea746-661d-4e99-8aaa-8b53ba699197\",\"clientId\":\"feb69166-b5bd-41b5-a58b-97ce842407ce\"},\"usnhutje\":{\"principalId\":\"a0dd647e-fae9-465b-a310-d3655ef6cc99\",\"clientId\":\"4041d98e-e490-4974-b97a-2326f29c2cef\"}}},\"location\":\"mrldhu\",\"tags\":{\"ablgphuticndvk\":\"zdatqxhocdg\"},\"id\":\"ozwyiftyhxhuro\",\"name\":\"ftyxolniw\",\"type\":\"wcukjfkgiawxk\"}") - .toObject(ProjectInner.class); - Assertions.assertEquals("mrldhu", model.location()); - Assertions.assertEquals("zdatqxhocdg", model.tags().get("ablgphuticndvk")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("qvkoc", model.devCenterId()); - Assertions.assertEquals("jdkwtnhxbnjb", model.description()); - Assertions.assertEquals(703766696, model.maxDevBoxesPerUser()); - Assertions.assertEquals("rglssainqpj", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectInner model - = new ProjectInner().withLocation("mrldhu") - .withTags(mapOf("ablgphuticndvk", "zdatqxhocdg")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("gxsabkyq", new UserAssignedIdentity(), "jitcjczdzevn", - new UserAssignedIdentity(), "rwpdappdsbdkvwrw", new UserAssignedIdentity(), "usnhutje", - new UserAssignedIdentity()))) - .withDevCenterId("qvkoc") - .withDescription("jdkwtnhxbnjb") - .withMaxDevBoxesPerUser(703766696) - .withDisplayName("rglssainqpj") - .withCatalogSettings(new ProjectCatalogSettings() - .withCatalogItemSyncTypes(Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, - CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION))); - model = BinaryData.fromObject(model).toObject(ProjectInner.class); - Assertions.assertEquals("mrldhu", model.location()); - Assertions.assertEquals("zdatqxhocdg", model.tags().get("ablgphuticndvk")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("qvkoc", model.devCenterId()); - Assertions.assertEquals("jdkwtnhxbnjb", model.description()); - Assertions.assertEquals(703766696, model.maxDevBoxesPerUser()); - Assertions.assertEquals("rglssainqpj", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectListResultTests.java deleted file mode 100644 index 019be4c7bce5..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ProjectListResult; - -public final class ProjectListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"devCenterUri\":\"my\",\"devCenterId\":\"kdtmlxhekuk\",\"description\":\"txukcdmp\",\"maxDevBoxesPerUser\":1492414283,\"displayName\":\"y\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"69954acb-185b-43d6-88ff-308c1afbf8fa\",\"tenantId\":\"18de6a54-12e7-44e0-a093-41b2f93b8694\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"lhmwhfpmrqobm\":{\"principalId\":\"e4e05135-280a-4448-8c2b-c5379ad02bdf\",\"clientId\":\"acc4aad6-190c-4c08-ba3c-f623167defb2\"}}},\"location\":\"kknryrtihf\",\"tags\":{\"zufcyzkohdbi\":\"jbpzvgnwzsymg\",\"th\":\"anufhfcbjysag\",\"yscnpqxu\":\"qhabifpikxwcz\",\"mjgr\":\"ivyqniwbybrkxvd\"},\"id\":\"fwvuk\",\"name\":\"gaudcc\",\"type\":\"nhsjcnyej\"},{\"properties\":{\"provisioningState\":\"RolloutInProgress\",\"devCenterUri\":\"tnapczwlokjyemkk\",\"devCenterId\":\"ipjoxzjnchgejs\",\"description\":\"dmailzydehojw\",\"maxDevBoxesPerUser\":302858012,\"displayName\":\"xinpmqnjaq\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"791f23ca-cf40-49ad-a2fb-7f27eea2aea7\",\"tenantId\":\"b6015faf-a395-4479-86ab-5eaedb246c88\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"gjvw\":{\"principalId\":\"91c013af-dc9e-4a3a-8ee8-c2432d2dff87\",\"clientId\":\"273329e7-0742-44ed-9242-21ac45de9d54\"},\"atscmd\":{\"principalId\":\"653ded32-c981-4134-85c3-4da102c29d54\",\"clientId\":\"65b74888-bfd2-4e0e-a569-454ef99a766e\"},\"hulsuuvmkjozkrwf\":{\"principalId\":\"50384d86-1dba-420e-8259-e9276337f699\",\"clientId\":\"9945e40c-4920-459c-8e8a-7971064f3eab\"},\"odjpslwejd\":{\"principalId\":\"f1cc0011-0445-414c-bf4e-888e62d36da8\",\"clientId\":\"8a3f9462-3dde-4e4c-8571-e303afb11000\"}}},\"location\":\"wryoqpsoacc\",\"tags\":{\"lahbcryff\":\"akl\",\"xpaojakhmsbz\":\"fdosyg\",\"hlxaolthqtr\":\"hcrzevd\"},\"id\":\"qjbpfzfsin\",\"name\":\"gvfcj\",\"type\":\"wzo\"},{\"properties\":{\"provisioningState\":\"Created\",\"devCenterUri\":\"elluwfziton\",\"devCenterId\":\"qfpjk\",\"description\":\"xofpdvhpfxxypi\",\"maxDevBoxesPerUser\":7569944,\"displayName\":\"ayhuy\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"b97c9e49-ffcd-477a-9a48-314fc19d368c\",\"tenantId\":\"c3bacf91-7ea7-48c9-9fd7-365fbcd6eed9\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"vamih\":{\"principalId\":\"6f7cb81a-b3c2-42db-aef7-d8f8b3e77824\",\"clientId\":\"6644dbf2-2aa8-4b99-8226-fe752485318d\"},\"narxzxtheotus\":{\"principalId\":\"6633bf3d-36e3-4f62-9851-46dd05cbfc67\",\"clientId\":\"4c821175-9dd8-4b5e-a85c-5658b7511d6f\"},\"evcciqihnhun\":{\"principalId\":\"b55e6b94-fe49-4e05-8894-35b37f6c0f13\",\"clientId\":\"f0b6131c-6717-4fd8-b4cc-801646d5b831\"}}},\"location\":\"wjzrnfygxgisp\",\"tags\":{\"ofx\":\"tzfkufubl\"},\"id\":\"eofjaeqjh\",\"name\":\"jbasvmsmjqulngs\",\"type\":\"tnb\"}],\"nextLink\":\"kzgcwrwcl\"}") - .toObject(ProjectListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectListResult model = new ProjectListResult(); - model = BinaryData.fromObject(model).toObject(ProjectListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectPropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectPropertiesTests.java deleted file mode 100644 index 67bea52fc61e..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectPropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ProjectProperties; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProjectPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Running\",\"devCenterUri\":\"lwckbasyypnddhs\",\"devCenterId\":\"bacphejko\",\"description\":\"nqgoulzndli\",\"maxDevBoxesPerUser\":1462222832,\"displayName\":\"kgfg\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}}") - .toObject(ProjectProperties.class); - Assertions.assertEquals("bacphejko", model.devCenterId()); - Assertions.assertEquals("nqgoulzndli", model.description()); - Assertions.assertEquals(1462222832, model.maxDevBoxesPerUser()); - Assertions.assertEquals("kgfg", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectProperties model = new ProjectProperties().withDevCenterId("bacphejko") - .withDescription("nqgoulzndli") - .withMaxDevBoxesPerUser(1462222832) - .withDisplayName("kgfg") - .withCatalogSettings(new ProjectCatalogSettings().withCatalogItemSyncTypes( - Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION, - CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION))); - model = BinaryData.fromObject(model).toObject(ProjectProperties.class); - Assertions.assertEquals("bacphejko", model.devCenterId()); - Assertions.assertEquals("nqgoulzndli", model.description()); - Assertions.assertEquals(1462222832, model.maxDevBoxesPerUser()); - Assertions.assertEquals("kgfg", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectUpdatePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectUpdatePropertiesTests.java deleted file mode 100644 index cab8bfa75882..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectUpdatePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ProjectUpdateProperties; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProjectUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectUpdateProperties model = BinaryData.fromString( - "{\"devCenterId\":\"qsrxybzqqed\",\"description\":\"tbciqfouflmm\",\"maxDevBoxesPerUser\":799119693,\"displayName\":\"modmglougpb\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}}") - .toObject(ProjectUpdateProperties.class); - Assertions.assertEquals("qsrxybzqqed", model.devCenterId()); - Assertions.assertEquals("tbciqfouflmm", model.description()); - Assertions.assertEquals(799119693, model.maxDevBoxesPerUser()); - Assertions.assertEquals("modmglougpb", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectUpdateProperties model = new ProjectUpdateProperties().withDevCenterId("qsrxybzqqed") - .withDescription("tbciqfouflmm") - .withMaxDevBoxesPerUser(799119693) - .withDisplayName("modmglougpb") - .withCatalogSettings(new ProjectCatalogSettings() - .withCatalogItemSyncTypes(Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, - CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION))); - model = BinaryData.fromObject(model).toObject(ProjectUpdateProperties.class); - Assertions.assertEquals("qsrxybzqqed", model.devCenterId()); - Assertions.assertEquals("tbciqfouflmm", model.description()); - Assertions.assertEquals(799119693, model.maxDevBoxesPerUser()); - Assertions.assertEquals("modmglougpb", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectUpdateTests.java deleted file mode 100644 index 731df962aa34..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import com.azure.resourcemanager.devcenter.models.ProjectUpdate; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProjectUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProjectUpdate model = BinaryData.fromString( - "{\"properties\":{\"devCenterId\":\"wgcu\",\"description\":\"tumkdosvqwhbm\",\"maxDevBoxesPerUser\":1497620633,\"displayName\":\"jfddgmbmbe\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"7270899c-84fd-41e8-9980-7785adfbe95f\",\"tenantId\":\"260a3084-5f25-4849-8446-3177dd693a6b\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"algbquxigjyjg\":{\"principalId\":\"ef84a46a-6cce-4e30-bc32-e8c66f45d84f\",\"clientId\":\"87f4c383-429c-4b69-8a61-22630dafc507\"},\"o\":{\"principalId\":\"14fddd0b-be53-456b-bbab-c9d0e6d0e47c\",\"clientId\":\"08bc1c58-1524-47ce-86c5-8e7225db61f4\"},\"rtxilner\":{\"principalId\":\"f7e8cb35-3a74-4cc4-889a-bf2a90ce6916\",\"clientId\":\"33d93201-40af-4c01-a405-bfcebcf24f84\"}}},\"tags\":{\"awrlyx\":\"ysvlejuvf\",\"nwbxgjvtbvpyssz\":\"jkcpr\"},\"location\":\"rujqg\"}") - .toObject(ProjectUpdate.class); - Assertions.assertEquals("ysvlejuvf", model.tags().get("awrlyx")); - Assertions.assertEquals("rujqg", model.location()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("wgcu", model.devCenterId()); - Assertions.assertEquals("tumkdosvqwhbm", model.description()); - Assertions.assertEquals(1497620633, model.maxDevBoxesPerUser()); - Assertions.assertEquals("jfddgmbmbe", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectUpdate model = new ProjectUpdate().withTags(mapOf("awrlyx", "ysvlejuvf", "nwbxgjvtbvpyssz", "jkcpr")) - .withLocation("rujqg") - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("algbquxigjyjg", new UserAssignedIdentity(), "o", - new UserAssignedIdentity(), "rtxilner", new UserAssignedIdentity()))) - .withDevCenterId("wgcu") - .withDescription("tumkdosvqwhbm") - .withMaxDevBoxesPerUser(1497620633) - .withDisplayName("jfddgmbmbe") - .withCatalogSettings(new ProjectCatalogSettings().withCatalogItemSyncTypes( - Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION, - CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION))); - model = BinaryData.fromObject(model).toObject(ProjectUpdate.class); - Assertions.assertEquals("ysvlejuvf", model.tags().get("awrlyx")); - Assertions.assertEquals("rujqg", model.location()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("wgcu", model.devCenterId()); - Assertions.assertEquals("tumkdosvqwhbm", model.description()); - Assertions.assertEquals(1497620633, model.maxDevBoxesPerUser()); - Assertions.assertEquals("jfddgmbmbe", model.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - model.catalogSettings().catalogItemSyncTypes().get(0)); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateMockTests.java deleted file mode 100644 index 00c45f3437cf..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsCreateOrUpdateMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.Project; -import com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"devCenterUri\":\"zddrt\",\"devCenterId\":\"doj\",\"description\":\"xv\",\"maxDevBoxesPerUser\":1550017967,\"displayName\":\"fdeesvecuijpxtx\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"d2522435-fc65-4115-b662-ffeae82b9030\",\"tenantId\":\"9204adbb-f6dc-4b05-b805-a6c490865c3f\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ibabxvititvtzeex\":{\"principalId\":\"4dd6ba84-6db6-4a91-ae58-35dde20d7b20\",\"clientId\":\"1d51f9d9-c99f-495c-8793-57d4297642d4\"},\"xtfglecdmdqb\":{\"principalId\":\"b5c40601-95ff-4c08-8beb-4ceebb99416d\",\"clientId\":\"f7f319d8-3f60-4e4a-a39f-50869f5068b0\"}}},\"location\":\"ypq\",\"tags\":{\"vodhtn\":\"fjacbslhhxudb\"},\"id\":\"irudh\",\"name\":\"m\",\"type\":\"es\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Project response = manager.projects() - .define("hcans") - .withRegion("bjjidjksyxky") - .withExistingResourceGroup("zyqdrfegcealzx") - .withTags(mapOf("nljlageuaulx", "evblbje", "svxeizzgwklnsr", "nsmjbnkppxynen")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("gfmo", new UserAssignedIdentity(), "hpqgatjeaahhvj", - new UserAssignedIdentity(), "akz", new UserAssignedIdentity()))) - .withDevCenterId("fajuwas") - .withDescription("daeyygux") - .withMaxDevBoxesPerUser(346438296) - .withDisplayName("qzhzbezkgimsi") - .withCatalogSettings(new ProjectCatalogSettings().withCatalogItemSyncTypes( - Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION))) - .create(); - - Assertions.assertEquals("ypq", response.location()); - Assertions.assertEquals("fjacbslhhxudb", response.tags().get("vodhtn")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("doj", response.devCenterId()); - Assertions.assertEquals("xv", response.description()); - Assertions.assertEquals(1550017967, response.maxDevBoxesPerUser()); - Assertions.assertEquals("fdeesvecuijpxtx", response.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - response.catalogSettings().catalogItemSyncTypes().get(0)); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 8a2cfc542603..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsGetByResourceGroupWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.Project; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"MovingResources\",\"devCenterUri\":\"mewip\",\"devCenterId\":\"ekdxuku\",\"description\":\"sjjxundxgketw\",\"maxDevBoxesPerUser\":1226400983,\"displayName\":\"jhfjmhvvmuvgpm\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"4b2fad98-3016-4ce4-bb55-f509b1daf450\",\"tenantId\":\"23d3614f-c594-4764-8fe7-484fd2d118e8\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"yihsasbhudypohyu\":{\"principalId\":\"b505a655-f762-4332-9fdc-27811b212008\",\"clientId\":\"020e2658-4e3b-4b2b-aef6-6d248baf0fa0\"},\"lynsqyrpf\":{\"principalId\":\"7d51c2df-55fd-468c-b476-1f2b6718c189\",\"clientId\":\"cabdbcd3-c384-4f4f-9428-73fbf0f9ab72\"},\"rlttymsjnygqdnfw\":{\"principalId\":\"7b766ca7-ab11-4df1-9ede-4cc7c4297c3e\",\"clientId\":\"165f7104-618e-4e17-b166-111c7eb346d4\"},\"zgtila\":{\"principalId\":\"75d755fe-3f5a-4793-b410-6a655831df23\",\"clientId\":\"c53e9a1a-7dad-4792-bb01-8141affbe8df\"}}},\"location\":\"nfhqlyvijouwivk\",\"tags\":{\"ti\":\"zunbixx\",\"vtsoxf\":\"vcpwpgclrc\",\"m\":\"kenx\",\"ao\":\"yefrpmpdnqqska\"},\"id\":\"vmm\",\"name\":\"npqfrtqlkzmeg\",\"type\":\"itgvkx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Project response = manager.projects() - .getByResourceGroupWithResponse("vetnwsdtutn", "lduycv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nfhqlyvijouwivk", response.location()); - Assertions.assertEquals("zunbixx", response.tags().get("ti")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("ekdxuku", response.devCenterId()); - Assertions.assertEquals("sjjxundxgketw", response.description()); - Assertions.assertEquals(1226400983, response.maxDevBoxesPerUser()); - Assertions.assertEquals("jhfjmhvvmuvgpm", response.displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - response.catalogSettings().catalogItemSyncTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupMockTests.java deleted file mode 100644 index 21232e1cda4a..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsListByResourceGroupMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.Project; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"StorageProvisioningFailed\",\"devCenterUri\":\"nwiaaomyl\",\"devCenterId\":\"azul\",\"description\":\"ethwwnpjhlfz\",\"maxDevBoxesPerUser\":1188676468,\"displayName\":\"hwahfbousn\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"72b0a040-4cf8-4ec7-ae44-c75ea724ce87\",\"tenantId\":\"be00fe87-a5f4-4d21-bf17-345d21579253\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"xykxhdj\":{\"principalId\":\"997ed452-24ce-4c08-b4d4-5cdbe44bb135\",\"clientId\":\"77a0df63-c74c-4761-aa91-1492f3069bbb\"},\"mmbcxfhbcp\":{\"principalId\":\"5340f4a9-19bf-4c31-87f8-0dc7d2f94a74\",\"clientId\":\"9e6eea54-5617-4666-bc41-7b7e4bbd7a6a\"},\"vxcjzhqizxfpxtgq\":{\"principalId\":\"2e361301-e777-42b1-96a3-e11fe66458a2\",\"clientId\":\"76c30ea1-e58b-4b9a-868e-f4dfb3e3e9b2\"}}},\"location\":\"javftjuhdqa\",\"tags\":{\"hfcf\":\"tgguwpijrajcivmm\",\"nzqodfvpg\":\"wrxgkneuvy\"},\"id\":\"hoxgsgbpf\",\"name\":\"zdjtxvzflbqv\",\"type\":\"aqvlgafcqusr\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.projects().listByResourceGroup("talhsnvkcdmxzr", 1745804403, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("javftjuhdqa", response.iterator().next().location()); - Assertions.assertEquals("tgguwpijrajcivmm", response.iterator().next().tags().get("hfcf")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals("azul", response.iterator().next().devCenterId()); - Assertions.assertEquals("ethwwnpjhlfz", response.iterator().next().description()); - Assertions.assertEquals(1188676468, response.iterator().next().maxDevBoxesPerUser()); - Assertions.assertEquals("hwahfbousn", response.iterator().next().displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - response.iterator().next().catalogSettings().catalogItemSyncTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsListMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsListMockTests.java deleted file mode 100644 index f696f811a51e..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ProjectsListMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.devcenter.models.Project; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"devCenterUri\":\"fmmfblcqcu\",\"devCenterId\":\"gqibrtalmetttw\",\"description\":\"slqxi\",\"maxDevBoxesPerUser\":5802151,\"displayName\":\"ooizqseyp\",\"catalogSettings\":{\"catalogItemSyncTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}},\"identity\":{\"principalId\":\"d58bb4f7-4c74-426f-afb1-1edd677076ab\",\"tenantId\":\"e0d2dc21-426f-46cc-b267-4e141e874f58\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"g\":{\"principalId\":\"607547a9-b6d4-41f2-afa9-7d25d01f3852\",\"clientId\":\"8c72ed7c-b60d-46af-b87e-6887a4c97d7f\"},\"oxslh\":{\"principalId\":\"d88b24f6-80f5-4415-9cfc-03eefd824181\",\"clientId\":\"a99d9280-7668-4f08-aad5-c54d41e65e32\"}}},\"location\":\"hlabrq\",\"tags\":{\"aehvvibrxjjstoq\":\"zjcjbtr\",\"bklftidgfcwqmpim\":\"eitpkxztmo\",\"yhohujswtwkozzwc\":\"qxzhem\"},\"id\":\"lkb\",\"name\":\"wpfaj\",\"type\":\"jwltlwtjjgu\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.projects().list(148819128, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hlabrq", response.iterator().next().location()); - Assertions.assertEquals("zjcjbtr", response.iterator().next().tags().get("aehvvibrxjjstoq")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals("gqibrtalmetttw", response.iterator().next().devCenterId()); - Assertions.assertEquals("slqxi", response.iterator().next().description()); - Assertions.assertEquals(5802151, response.iterator().next().maxDevBoxesPerUser()); - Assertions.assertEquals("ooizqseyp", response.iterator().next().displayName()); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, - response.iterator().next().catalogSettings().catalogItemSyncTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/RecommendedMachineConfigurationTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/RecommendedMachineConfigurationTests.java deleted file mode 100644 index 9964a3be4125..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/RecommendedMachineConfigurationTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.RecommendedMachineConfiguration; - -public final class RecommendedMachineConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecommendedMachineConfiguration model = BinaryData - .fromString( - "{\"memory\":{\"min\":38172527,\"max\":1341187268},\"vCPUs\":{\"min\":1152812045,\"max\":827449551}}") - .toObject(RecommendedMachineConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecommendedMachineConfiguration model = new RecommendedMachineConfiguration(); - model = BinaryData.fromObject(model).toObject(RecommendedMachineConfiguration.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ResourceRangeTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ResourceRangeTests.java deleted file mode 100644 index 8c6d83bdc2db..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ResourceRangeTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ResourceRange; - -public final class ResourceRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceRange model - = BinaryData.fromString("{\"min\":650590587,\"max\":1413439990}").toObject(ResourceRange.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceRange model = new ResourceRange(); - model = BinaryData.fromObject(model).toObject(ResourceRange.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleInnerTests.java deleted file mode 100644 index 179229899aef..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ScheduleInner; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -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\":{\"provisioningState\":\"Updated\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"vnqqybaryeua\",\"timeZone\":\"kq\",\"state\":\"Enabled\",\"tags\":{\"ewdjcvbquwrb\":\"slesjcbhernnt\",\"vvhmxtdrj\":\"hwagohbuffkmrqe\",\"jvewzcjznmwcp\":\"utacoe\"},\"location\":\"uaadraufactkahzo\"},\"id\":\"jjziuxxpsh\",\"name\":\"eekulfgslqubkwd\",\"type\":\"enr\"}") - .toObject(ScheduleInner.class); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.typePropertiesType()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("vnqqybaryeua", model.time()); - Assertions.assertEquals("kq", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.ENABLED, model.state()); - Assertions.assertEquals("slesjcbhernnt", model.tags().get("ewdjcvbquwrb")); - Assertions.assertEquals("uaadraufactkahzo", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleInner model = new ScheduleInner().withTypePropertiesType(ScheduledType.STOP_DEV_BOX) - .withFrequency(ScheduledFrequency.DAILY) - .withTime("vnqqybaryeua") - .withTimeZone("kq") - .withState(ScheduleEnableStatus.ENABLED) - .withTags(mapOf("ewdjcvbquwrb", "slesjcbhernnt", "vvhmxtdrj", "hwagohbuffkmrqe", "jvewzcjznmwcp", "utacoe")) - .withLocation("uaadraufactkahzo"); - model = BinaryData.fromObject(model).toObject(ScheduleInner.class); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.typePropertiesType()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("vnqqybaryeua", model.time()); - Assertions.assertEquals("kq", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.ENABLED, model.state()); - Assertions.assertEquals("slesjcbhernnt", model.tags().get("ewdjcvbquwrb")); - Assertions.assertEquals("uaadraufactkahzo", model.location()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleListResultTests.java deleted file mode 100644 index c7e45e8557d4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ScheduleListResult; - -public final class ScheduleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"i\",\"timeZone\":\"nhn\",\"state\":\"Disabled\",\"tags\":{\"cesutrgjupauut\":\"qjzgxmrhublw\"},\"location\":\"oqh\"},\"id\":\"ejqgw\",\"name\":\"pnfqntcyp\",\"type\":\"xjvfoimwksl\"},{\"properties\":{\"provisioningState\":\"Creating\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"dfcea\",\"timeZone\":\"lhvygdyftu\",\"state\":\"Disabled\",\"tags\":{\"biwkojgcyzt\":\"awjs\",\"qphchqnrnrpxehuw\":\"fmznba\",\"bydvkhbejdz\":\"ykqgaifmvik\",\"srhnjivo\":\"xcv\"},\"location\":\"tnovqfzgemjdftul\"},\"id\":\"tduceamt\",\"name\":\"czu\",\"type\":\"m\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"knssxmojm\",\"timeZone\":\"p\",\"state\":\"Disabled\",\"tags\":{\"ql\":\"kwcf\"},\"location\":\"x\"},\"id\":\"czheyd\",\"name\":\"sdshmkxmaehvb\",\"type\":\"xu\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"baxk\",\"timeZone\":\"ywrckp\",\"state\":\"Disabled\",\"tags\":{\"uudl\":\"pluodpv\",\"ostgkts\":\"zibt\",\"zedqbcvhzlhplo\":\"vdxec\",\"qfbumlkxtrqjf\":\"qkdlw\"},\"location\":\"lmbtxhwgfwsrt\"},\"id\":\"coezbrhubskh\",\"name\":\"dyg\",\"type\":\"ookk\"}],\"nextLink\":\"qjbvleorfmlu\"}") - .toObject(ScheduleListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleListResult model = new ScheduleListResult(); - model = BinaryData.fromObject(model).toObject(ScheduleListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulePropertiesTests.java deleted file mode 100644 index 6598c2da5c4e..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ScheduleProperties; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -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( - "{\"provisioningState\":\"Updating\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"zpjuohminyfl\",\"timeZone\":\"rwm\",\"state\":\"Disabled\",\"tags\":{\"xpgpq\":\"klvxwmyg\",\"daxconfozauorsuk\":\"hiszepnnbjcrxgib\"},\"location\":\"wbqpl\"}") - .toObject(ScheduleProperties.class); - Assertions.assertEquals("klvxwmyg", model.tags().get("xpgpq")); - Assertions.assertEquals("wbqpl", model.location()); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.type()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("zpjuohminyfl", model.time()); - Assertions.assertEquals("rwm", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleProperties model - = new ScheduleProperties().withTags(mapOf("xpgpq", "klvxwmyg", "daxconfozauorsuk", "hiszepnnbjcrxgib")) - .withLocation("wbqpl") - .withType(ScheduledType.STOP_DEV_BOX) - .withFrequency(ScheduledFrequency.DAILY) - .withTime("zpjuohminyfl") - .withTimeZone("rwm") - .withState(ScheduleEnableStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(ScheduleProperties.class); - Assertions.assertEquals("klvxwmyg", model.tags().get("xpgpq")); - Assertions.assertEquals("wbqpl", model.location()); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.type()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("zpjuohminyfl", model.time()); - Assertions.assertEquals("rwm", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleUpdatePropertiesTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleUpdatePropertiesTests.java deleted file mode 100644 index 4bb65cac8f12..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleUpdatePropertiesTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.ScheduleUpdateProperties; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleUpdateProperties model = BinaryData.fromString( - "{\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"epzl\",\"timeZone\":\"hw\",\"state\":\"Disabled\",\"tags\":{\"qdunvmnnrwrbior\":\"wey\",\"v\":\"talywjhhgdnhxms\",\"ox\":\"omi\"},\"location\":\"dufiq\"}") - .toObject(ScheduleUpdateProperties.class); - Assertions.assertEquals("wey", model.tags().get("qdunvmnnrwrbior")); - Assertions.assertEquals("dufiq", model.location()); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.type()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("epzl", model.time()); - Assertions.assertEquals("hw", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleUpdateProperties model = new ScheduleUpdateProperties() - .withTags(mapOf("qdunvmnnrwrbior", "wey", "v", "talywjhhgdnhxms", "ox", "omi")) - .withLocation("dufiq") - .withType(ScheduledType.STOP_DEV_BOX) - .withFrequency(ScheduledFrequency.DAILY) - .withTime("epzl") - .withTimeZone("hw") - .withState(ScheduleEnableStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(ScheduleUpdateProperties.class); - Assertions.assertEquals("wey", model.tags().get("qdunvmnnrwrbior")); - Assertions.assertEquals("dufiq", model.location()); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.type()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("epzl", model.time()); - Assertions.assertEquals("hw", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleUpdateTests.java deleted file mode 100644 index c1d110e07a8f..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/ScheduleUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduleUpdate; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleUpdate model = BinaryData.fromString( - "{\"properties\":{\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"ofjchvcyyysf\",\"timeZone\":\"otcubi\",\"state\":\"Disabled\",\"tags\":{\"qonmacj\":\"w\",\"izsh\":\"k\"},\"location\":\"cimpevfg\"}}") - .toObject(ScheduleUpdate.class); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.type()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("ofjchvcyyysf", model.time()); - Assertions.assertEquals("otcubi", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state()); - Assertions.assertEquals("w", model.tags().get("qonmacj")); - Assertions.assertEquals("cimpevfg", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleUpdate model = new ScheduleUpdate().withType(ScheduledType.STOP_DEV_BOX) - .withFrequency(ScheduledFrequency.DAILY) - .withTime("ofjchvcyyysf") - .withTimeZone("otcubi") - .withState(ScheduleEnableStatus.DISABLED) - .withTags(mapOf("qonmacj", "w", "izsh", "k")) - .withLocation("cimpevfg"); - model = BinaryData.fromObject(model).toObject(ScheduleUpdate.class); - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, model.type()); - Assertions.assertEquals(ScheduledFrequency.DAILY, model.frequency()); - Assertions.assertEquals("ofjchvcyyysf", model.time()); - Assertions.assertEquals("otcubi", model.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, model.state()); - Assertions.assertEquals("w", model.tags().get("qonmacj")); - Assertions.assertEquals("cimpevfg", model.location()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateMockTests.java deleted file mode 100644 index d239894d8db9..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesCreateOrUpdateMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Schedule; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -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 reactor.core.publisher.Mono; - -public final class SchedulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"pxycphdr\",\"timeZone\":\"jkhvyomacluzvxnq\",\"state\":\"Enabled\",\"tags\":{\"wmkoisq\":\"pd\"},\"location\":\"sffxui\"},\"id\":\"csypobkdqzrdzsyl\",\"name\":\"llg\",\"type\":\"rc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schedule response = manager.schedules() - .define("fkvcisi") - .withExistingPool("pomyqwcabvnuile", "yaswlpaugmr", "fjlrxwtoauk") - .withRegion("msplzgaufcshhvn") - .withTags(mapOf("l", "omguamlj")) - .withTypePropertiesType(ScheduledType.STOP_DEV_BOX) - .withFrequency(ScheduledFrequency.DAILY) - .withTime("wuived") - .withTimeZone("gyeewxeiq") - .withState(ScheduleEnableStatus.DISABLED) - .withTop(288574233) - .create(); - - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, response.typePropertiesType()); - Assertions.assertEquals(ScheduledFrequency.DAILY, response.frequency()); - Assertions.assertEquals("pxycphdr", response.time()); - Assertions.assertEquals("jkhvyomacluzvxnq", response.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.ENABLED, response.state()); - Assertions.assertEquals("pd", response.tags().get("wmkoisq")); - Assertions.assertEquals("sffxui", response.location()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetWithResponseMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetWithResponseMockTests.java deleted file mode 100644 index d8b226b72cb4..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesGetWithResponseMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Schedule; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchedulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Updated\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"rglvaw\",\"timeZone\":\"z\",\"state\":\"Enabled\",\"tags\":{\"bkmifoxxkub\":\"ivlsbbjpmc\",\"gvgovpbbttefjo\":\"phavpmhbrb\",\"kdfrdbiqmrjgeihf\":\"nssqyzqed\"},\"location\":\"ggwfiwz\"},\"id\":\"mjpb\",\"name\":\"ephmgtvljvrcmyfq\",\"type\":\"pgxh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schedule response = manager.schedules() - .getWithResponse("totiowlxteqdptjg", "dtguk", "anblwphqlkccu", "gygqwah", 755006489, - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, response.typePropertiesType()); - Assertions.assertEquals(ScheduledFrequency.DAILY, response.frequency()); - Assertions.assertEquals("rglvaw", response.time()); - Assertions.assertEquals("z", response.timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.ENABLED, response.state()); - Assertions.assertEquals("ivlsbbjpmc", response.tags().get("bkmifoxxkub")); - Assertions.assertEquals("ggwfiwz", response.location()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolMockTests.java deleted file mode 100644 index 6fec0e68a17a..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SchedulesListByPoolMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Schedule; -import com.azure.resourcemanager.devcenter.models.ScheduleEnableStatus; -import com.azure.resourcemanager.devcenter.models.ScheduledFrequency; -import com.azure.resourcemanager.devcenter.models.ScheduledType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchedulesListByPoolMockTests { - @Test - public void testListByPool() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"StorageProvisioningFailed\",\"type\":\"StopDevBox\",\"frequency\":\"Daily\",\"time\":\"xw\",\"timeZone\":\"fykhvuhxepmru\",\"state\":\"Disabled\",\"tags\":{\"lujdjltymkmv\":\"aobn\",\"pphkixkykxds\":\"uihywart\"},\"location\":\"pemmucfxhik\"},\"id\":\"lrmymyincqlhri\",\"name\":\"wslmiiiovgqcg\",\"type\":\"uugqk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.schedules() - .listByPool("oewbid", "vteo", "xvgpiude", 1691899028, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ScheduledType.STOP_DEV_BOX, response.iterator().next().typePropertiesType()); - Assertions.assertEquals(ScheduledFrequency.DAILY, response.iterator().next().frequency()); - Assertions.assertEquals("xw", response.iterator().next().time()); - Assertions.assertEquals("fykhvuhxepmru", response.iterator().next().timeZone()); - Assertions.assertEquals(ScheduleEnableStatus.DISABLED, response.iterator().next().state()); - Assertions.assertEquals("aobn", response.iterator().next().tags().get("lujdjltymkmv")); - Assertions.assertEquals("pemmucfxhik", response.iterator().next().location()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkuListResultTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkuListResultTests.java deleted file mode 100644 index 3fbd7c0237d5..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkuListResultTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.SkuListResult; - -public final class SkuListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuListResult model = BinaryData.fromString( - "{\"value\":[{\"resourceType\":\"lwfffi\",\"locations\":[\"jpqqmted\",\"tmmjihyeozph\",\"wau\",\"qncygupkvi\"],\"capabilities\":[{\"name\":\"cwxqu\",\"value\":\"vzhfstotxhoj\"},{\"name\":\"bypel\",\"value\":\"uvhixbjxyfwn\"},{\"name\":\"r\",\"value\":\"o\"},{\"name\":\"ttpkiwkkbnujrywv\",\"value\":\"lbfpncurd\"}],\"name\":\"iwii\",\"tier\":\"Standard\",\"size\":\"wubxc\",\"family\":\"h\",\"capacity\":1060824316}],\"nextLink\":\"fdntwjchrdgoih\"}") - .toObject(SkuListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuListResult model = new SkuListResult(); - model = BinaryData.fromObject(model).toObject(SkuListResult.class); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkuTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkuTests.java deleted file mode 100644 index 1091ce11f2a2..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkuTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.Sku; -import com.azure.resourcemanager.devcenter.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\":\"ibyqunyowxwlmdj\",\"tier\":\"Premium\",\"size\":\"g\",\"family\":\"fvpdbo\",\"capacity\":2095776205}") - .toObject(Sku.class); - Assertions.assertEquals("ibyqunyowxwlmdj", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - Assertions.assertEquals("g", model.size()); - Assertions.assertEquals("fvpdbo", model.family()); - Assertions.assertEquals(2095776205, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("ibyqunyowxwlmdj") - .withTier(SkuTier.PREMIUM) - .withSize("g") - .withFamily("fvpdbo") - .withCapacity(2095776205); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("ibyqunyowxwlmdj", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - Assertions.assertEquals("g", model.size()); - Assertions.assertEquals("fvpdbo", model.family()); - Assertions.assertEquals(2095776205, model.capacity()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkusListMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkusListMockTests.java deleted file mode 100644 index 5597258f9f68..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SkusListMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.DevCenterSku; -import com.azure.resourcemanager.devcenter.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SkusListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"resourceType\":\"mpxdlvy\",\"locations\":[\"e\",\"crse\",\"wjksghudgzhxo\",\"jggsvo\"],\"capabilities\":[{\"name\":\"ibdafhrkmdyom\",\"value\":\"fbvfbhdy\"},{\"name\":\"hpwpgddeimawzovg\",\"value\":\"um\"}],\"name\":\"ikjcjcazt\",\"tier\":\"Standard\",\"size\":\"sqowxwc\",\"family\":\"likytwvczcswka\",\"capacity\":1614313914}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.skus().list(1273125095, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ikjcjcazt", response.iterator().next().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().tier()); - Assertions.assertEquals("sqowxwc", response.iterator().next().size()); - Assertions.assertEquals("likytwvczcswka", response.iterator().next().family()); - Assertions.assertEquals(1614313914, response.iterator().next().capacity()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/StopOnDisconnectConfigurationTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/StopOnDisconnectConfigurationTests.java deleted file mode 100644 index cad6c4214e99..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/StopOnDisconnectConfigurationTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration; -import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus; -import org.junit.jupiter.api.Assertions; - -public final class StopOnDisconnectConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StopOnDisconnectConfiguration model - = BinaryData.fromString("{\"status\":\"Enabled\",\"gracePeriodMinutes\":1224652239}") - .toObject(StopOnDisconnectConfiguration.class); - Assertions.assertEquals(StopOnDisconnectEnableStatus.ENABLED, model.status()); - Assertions.assertEquals(1224652239, model.gracePeriodMinutes()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StopOnDisconnectConfiguration model - = new StopOnDisconnectConfiguration().withStatus(StopOnDisconnectEnableStatus.ENABLED) - .withGracePeriodMinutes(1224652239); - model = BinaryData.fromObject(model).toObject(StopOnDisconnectConfiguration.class); - Assertions.assertEquals(StopOnDisconnectEnableStatus.ENABLED, model.status()); - Assertions.assertEquals(1224652239, model.gracePeriodMinutes()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SyncStatsTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SyncStatsTests.java deleted file mode 100644 index a6a72270b524..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/SyncStatsTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.CatalogItemType; -import com.azure.resourcemanager.devcenter.models.SyncStats; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SyncStatsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncStats model = BinaryData.fromString( - "{\"added\":1878270858,\"updated\":54654595,\"unchanged\":825369958,\"removed\":1635783635,\"validationErrors\":1240813814,\"synchronizationErrors\":1410609059,\"syncedCatalogItemTypes\":[\"EnvironmentDefinition\",\"EnvironmentDefinition\"]}") - .toObject(SyncStats.class); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, model.syncedCatalogItemTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncStats model = new SyncStats().withSyncedCatalogItemTypes( - Arrays.asList(CatalogItemType.ENVIRONMENT_DEFINITION, CatalogItemType.ENVIRONMENT_DEFINITION)); - model = BinaryData.fromObject(model).toObject(SyncStats.class); - Assertions.assertEquals(CatalogItemType.ENVIRONMENT_DEFINITION, model.syncedCatalogItemTypes().get(0)); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/TrackedResourceUpdateTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/TrackedResourceUpdateTests.java deleted file mode 100644 index ec925ecbe521..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/TrackedResourceUpdateTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.TrackedResourceUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TrackedResourceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrackedResourceUpdate model - = BinaryData.fromString("{\"tags\":{\"jzyflu\":\"deupewnwrei\"},\"location\":\"rh\"}") - .toObject(TrackedResourceUpdate.class); - Assertions.assertEquals("deupewnwrei", model.tags().get("jzyflu")); - Assertions.assertEquals("rh", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrackedResourceUpdate model - = new TrackedResourceUpdate().withTags(mapOf("jzyflu", "deupewnwrei")).withLocation("rh"); - model = BinaryData.fromObject(model).toObject(TrackedResourceUpdate.class); - Assertions.assertEquals("deupewnwrei", model.tags().get("jzyflu")); - Assertions.assertEquals("rh", model.location()); - } - - // 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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsageInnerTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsageInnerTests.java deleted file mode 100644 index 3fd804ebbf3c..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsageInnerTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.fluent.models.UsageInner; -import com.azure.resourcemanager.devcenter.models.UsageName; -import com.azure.resourcemanager.devcenter.models.UsageUnit; -import org.junit.jupiter.api.Assertions; - -public final class UsageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageInner model = BinaryData.fromString( - "{\"currentValue\":3797997651495402097,\"limit\":1729044894039608020,\"unit\":\"Count\",\"name\":{\"localizedValue\":\"rrjreafxtsgu\",\"value\":\"jglikkxwslolb\"},\"id\":\"vuzlm\"}") - .toObject(UsageInner.class); - Assertions.assertEquals(3797997651495402097L, model.currentValue()); - Assertions.assertEquals(1729044894039608020L, model.limit()); - Assertions.assertEquals(UsageUnit.COUNT, model.unit()); - Assertions.assertEquals("rrjreafxtsgu", model.name().localizedValue()); - Assertions.assertEquals("jglikkxwslolb", model.name().value()); - Assertions.assertEquals("vuzlm", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageInner model = new UsageInner().withCurrentValue(3797997651495402097L) - .withLimit(1729044894039608020L) - .withUnit(UsageUnit.COUNT) - .withName(new UsageName().withLocalizedValue("rrjreafxtsgu").withValue("jglikkxwslolb")) - .withId("vuzlm"); - model = BinaryData.fromObject(model).toObject(UsageInner.class); - Assertions.assertEquals(3797997651495402097L, model.currentValue()); - Assertions.assertEquals(1729044894039608020L, model.limit()); - Assertions.assertEquals(UsageUnit.COUNT, model.unit()); - Assertions.assertEquals("rrjreafxtsgu", model.name().localizedValue()); - Assertions.assertEquals("jglikkxwslolb", model.name().value()); - Assertions.assertEquals("vuzlm", model.id()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsageNameTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsageNameTests.java deleted file mode 100644 index 3c68082df9c8..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsageNameTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.UsageName; -import org.junit.jupiter.api.Assertions; - -public final class UsageNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageName model = BinaryData.fromString("{\"localizedValue\":\"elfk\",\"value\":\"plcrpwjxeznoig\"}") - .toObject(UsageName.class); - Assertions.assertEquals("elfk", model.localizedValue()); - Assertions.assertEquals("plcrpwjxeznoig", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageName model = new UsageName().withLocalizedValue("elfk").withValue("plcrpwjxeznoig"); - model = BinaryData.fromObject(model).toObject(UsageName.class); - Assertions.assertEquals("elfk", model.localizedValue()); - Assertions.assertEquals("plcrpwjxeznoig", model.value()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationMockTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationMockTests.java deleted file mode 100644 index 92fa9cf7ead3..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UsagesListByLocationMockTests.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.devcenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.devcenter.DevCenterManager; -import com.azure.resourcemanager.devcenter.models.Usage; -import com.azure.resourcemanager.devcenter.models.UsageUnit; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesListByLocationMockTests { - @Test - public void testListByLocation() throws Exception { - String responseStr - = "{\"value\":[{\"currentValue\":831872911038436770,\"limit\":6597084071377063219,\"unit\":\"Count\",\"name\":{\"localizedValue\":\"htomflrytswfp\",\"value\":\"dgycxnmskwhqjjy\"},\"id\":\"urlpshh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DevCenterManager manager = DevCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.usages().listByLocation("sjcitdigsxc", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(831872911038436770L, response.iterator().next().currentValue()); - Assertions.assertEquals(6597084071377063219L, response.iterator().next().limit()); - Assertions.assertEquals(UsageUnit.COUNT, response.iterator().next().unit()); - Assertions.assertEquals("htomflrytswfp", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("dgycxnmskwhqjjy", response.iterator().next().name().value()); - Assertions.assertEquals("urlpshh", response.iterator().next().id()); - } -} diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UserAssignedIdentityTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 35c1e70687ae..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UserAssignedIdentityTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"1ca27cba-54a9-4fb8-a914-219597ff8004\",\"clientId\":\"6eb0281f-d2a5-45c6-8774-a13d181ab947\"}") - .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/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UserRoleAssignmentValueTests.java b/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UserRoleAssignmentValueTests.java deleted file mode 100644 index bad265e006c3..000000000000 --- a/sdk/devcenter/azure-resourcemanager-devcenter/src/test/java/com/azure/resourcemanager/devcenter/generated/UserRoleAssignmentValueTests.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.devcenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.devcenter.models.EnvironmentRole; -import com.azure.resourcemanager.devcenter.models.UserRoleAssignmentValue; -import java.util.HashMap; -import java.util.Map; - -public final class UserRoleAssignmentValueTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserRoleAssignmentValue model = BinaryData.fromString( - "{\"roles\":{\"evfdnwnwm\":{\"roleName\":\"nbyxbaaabjyv\",\"description\":\"ffimrzrtuzqogsex\"},\"thzvaytdwkqbrqu\":{\"roleName\":\"zsyyceuzso\",\"description\":\"judpfrxt\"},\"oaxoruzfgsqu\":{\"roleName\":\"axhexiilivp\",\"description\":\"iirqtd\"},\"wxuqlcvydypatdoo\":{\"roleName\":\"xrxxlep\",\"description\":\"amxjezwlw\"}}}") - .toObject(UserRoleAssignmentValue.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserRoleAssignmentValue model = new UserRoleAssignmentValue() - .withRoles(mapOf("evfdnwnwm", new EnvironmentRole(), "thzvaytdwkqbrqu", new EnvironmentRole(), - "oaxoruzfgsqu", new EnvironmentRole(), "wxuqlcvydypatdoo", new EnvironmentRole())); - model = BinaryData.fromObject(model).toObject(UserRoleAssignmentValue.class); - } - - // 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; - } -}