diff --git a/sdk/devcenter/azure-developer-devcenter/CHANGELOG.md b/sdk/devcenter/azure-developer-devcenter/CHANGELOG.md index 9d952121d00db..e26bb1d03798c 100644 --- a/sdk/devcenter/azure-developer-devcenter/CHANGELOG.md +++ b/sdk/devcenter/azure-developer-devcenter/CHANGELOG.md @@ -2,14 +2,29 @@ ## 1.1.0-beta.1 (Unreleased) +### Breaking Changes + +#### `implementation.DeploymentEnvironmentsClientImpl$DeploymentEnvironmentsClientService` was modified + +* `createOrUpdateEnvironment(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed +* `createOrUpdateEnvironmentSync(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed + +#### `implementation.DevBoxesClientImpl$DevBoxesClientService` was modified + +* `createDevBox(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed +* `createDevBoxSync(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was removed + ### Features Added -### Breaking Changes +#### `implementation.DeploymentEnvironmentsClientImpl$DeploymentEnvironmentsClientService` was modified -### Bugs Fixed +* `createOrUpdateEnvironmentSync(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added +* `createOrUpdateEnvironment(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added -### Other Changes +#### `implementation.DevBoxesClientImpl$DevBoxesClientService` was modified +* `createDevBoxSync(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added +* `createDevBox(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions,com.azure.core.util.Context)` was added ## 1.0.4 (2024-09-27) diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesAsyncClient.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesAsyncClient.java index 4e7b4276eba86..bb8d0c9910e44 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesAsyncClient.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesAsyncClient.java @@ -599,7 +599,7 @@ public Mono> getDevBoxWithResponse(String projectName, Stri * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -973,7 +973,7 @@ public Mono> skipActionWithResponse(String projectName, String us * context. * @param devBoxName Display name for the Dev Box. * @param actionName The name of the action. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1028,7 +1028,7 @@ public Mono> delayActionWithResponse(String projectName, St * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1542,7 +1542,7 @@ public Mono skipAction(String projectName, String userId, String devBoxNam * context. * @param devBoxName Display name for the Dev Box. * @param actionName The name of the action. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1569,7 +1569,7 @@ public Mono delayAction(String projectName, String userId, String * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClient.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClient.java index 29d14987c4044..22f41b76c13fe 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClient.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClient.java @@ -593,7 +593,7 @@ public Response getDevBoxWithResponse(String projectName, String use * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -966,7 +966,7 @@ public Response skipActionWithResponse(String projectName, String userId, * context. * @param devBoxName Display name for the Dev Box. * @param actionName The name of the action. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1020,7 +1020,7 @@ public Response delayActionWithResponse(String projectName, String u * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1462,7 +1462,7 @@ public void skipAction(String projectName, String userId, String devBoxName, Str * context. * @param devBoxName Display name for the Dev Box. * @param actionName The name of the action. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1489,7 +1489,7 @@ public DevBoxAction delayAction(String projectName, String userId, String devBox * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java index cdee11e3d00b5..c417ff3fe93ee 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java @@ -2375,7 +2375,7 @@ public Response getDevBoxWithResponse(String projectName, String use * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -2502,7 +2502,7 @@ private Mono> createDevBoxWithResponseAsync(String projectN * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -2628,7 +2628,7 @@ private Response createDevBoxWithResponse(String projectName, String * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -2759,7 +2759,7 @@ public PollerFlux beginCreateDevBoxAsync(String projectN * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -2890,7 +2890,7 @@ public SyncPoller beginCreateDevBox(String projectName, * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -3021,7 +3021,7 @@ public PollerFlux beginCreateDevBoxWithModelA * } * * - * @param projectName The DevCenter Project upon which to execute the operation. + * @param projectName The DevCenter Project upon which to execute operations. * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName The name of a Dev Box. @@ -4760,7 +4760,7 @@ public Response skipActionWithResponse(String projectName, String userId, * context. * @param devBoxName Display name for the Dev Box. * @param actionName The name of the action. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4801,7 +4801,7 @@ public Mono> delayActionWithResponseAsync(String projectNam * context. * @param devBoxName Display name for the Dev Box. * @param actionName The name of the action. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4855,7 +4855,7 @@ public Response delayActionWithResponse(String projectName, String u * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4913,7 +4913,7 @@ private Mono> delayAllActionsSinglePageAsync(String pr * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4970,7 +4970,7 @@ public PagedFlux delayAllActionsAsync(String projectName, String use * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5027,7 +5027,7 @@ private PagedResponse delayAllActionsSinglePage(String projectName, * @param userId The AAD object id of the user. If value is 'me', the identity is taken from the authentication * context. * @param devBoxName Display name for the Dev Box. - * @param delayUntil The time to delay the Dev Box action or actions until. + * @param delayUntil The time to delay the Dev Box action or actions until, in RFC3339 format. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBox.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBox.java index c0a4439b750e9..e9239008bf0a8 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBox.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBox.java @@ -114,7 +114,7 @@ public final class DevBox implements JsonSerializable { private DevBoxImageReference imageReference; /* - * Creation time of this Dev Box. + * Creation time of this Dev Box, in RFC3339 format. */ @Generated private OffsetDateTime createdTime; @@ -291,7 +291,7 @@ public DevBoxImageReference getImageReference() { } /** - * Get the createdTime property: Creation time of this Dev Box. + * Get the createdTime property: Creation time of this Dev Box, in RFC3339 format. * * @return the createdTime value. */ diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxAction.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxAction.java index a9482f84db421..90bca15f8cf84 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxAction.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxAction.java @@ -39,7 +39,7 @@ public final class DevBoxAction implements JsonSerializable { private final String sourceId; /* - * The earliest time that the action could occur (UTC). + * The earliest time that the action could occur (UTC), in RFC3339 format. */ @Generated private OffsetDateTime suspendedUntil; @@ -93,7 +93,7 @@ public String getSourceId() { } /** - * Get the suspendedUntil property: The earliest time that the action could occur (UTC). + * Get the suspendedUntil property: The earliest time that the action could occur (UTC), in RFC3339 format. * * @return the suspendedUntil value. */ diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxImageReference.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxImageReference.java index 3e523b131fe6f..0d30f37c4db26 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxImageReference.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevBoxImageReference.java @@ -44,7 +44,7 @@ public final class DevBoxImageReference implements JsonSerializable { /* - * The time the action will be triggered (UTC). + * The time the action will be triggered (UTC), in RFC3339 format. */ @Generated private final OffsetDateTime scheduledTime; @@ -37,7 +37,7 @@ private DevBoxNextAction(OffsetDateTime scheduledTime) { } /** - * Get the scheduledTime property: The time the action will be triggered (UTC). + * Get the scheduledTime property: The time the action will be triggered (UTC), in RFC3339 format. * * @return the scheduledTime value. */ diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevCenterOperationDetails.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevCenterOperationDetails.java index 93d0796197cf9..b87816dc8b1ed 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevCenterOperationDetails.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/models/DevCenterOperationDetails.java @@ -46,13 +46,13 @@ public final class DevCenterOperationDetails implements JsonSerializable response + = devBoxesClient.beginCreateDevBox("myProject", "me", "MyDevBox", new DevBox("LargeDevWorkStationPool")); + // END:com.azure.developer.devcenter.generated.createdevbox.createsorreplacesadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/CreatesOrUpdatesAnEnvironment.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/CreatesOrUpdatesAnEnvironment.java new file mode 100644 index 0000000000000..36c5d661b787f --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/CreatesOrUpdatesAnEnvironment.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.util.HashMap; +import java.util.Map; + +public class CreatesOrUpdatesAnEnvironment { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.createorupdateenvironment.createsorupdatesanenvironment + SyncPoller response + = deploymentEnvironmentsClient.beginCreateOrUpdateEnvironment("myProject", "me", "mydevenv", + new DevCenterEnvironment("DevTest", "main", "helloworld") + .setParameters(mapOf("functionAppRuntime", "node", "storageAccountType", "Standard_LRS"))); + // END:com.azure.developer.devcenter.generated.createorupdateenvironment.createsorupdatesanenvironment + } + + // 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-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DelaysAllActions.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DelaysAllActions.java new file mode 100644 index 0000000000000..7d3e1c6bcc869 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DelaysAllActions.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxActionDelayResult; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; + +public class DelaysAllActions { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.delayallactions.delaysallactions + PagedIterable response = devBoxesClient.delayAllActions("myProject", "me", "myDevBox", + OffsetDateTime.parse("2022-09-30T17:00:00Z")); + // END:com.azure.developer.devcenter.generated.delayallactions.delaysallactions + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DelaysTheOccurrenceOfAnAction.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DelaysTheOccurrenceOfAnAction.java new file mode 100644 index 0000000000000..cf3e638ce6fe1 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DelaysTheOccurrenceOfAnAction.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; + +public class DelaysTheOccurrenceOfAnAction { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.delayaction.delaystheoccurrenceofanaction + DevBoxAction response = devBoxesClient.delayAction("myProject", "me", "myDevBox", "schedule-default", + OffsetDateTime.parse("2022-09-30T17:00:00Z")); + // END:com.azure.developer.devcenter.generated.delayaction.delaystheoccurrenceofanaction + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DeletesADevBox.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DeletesADevBox.java new file mode 100644 index 0000000000000..a3739dd63616d --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DeletesADevBox.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeletesADevBox { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.deletedevbox.deletesadevbox + SyncPoller response + = devBoxesClient.beginDeleteDevBox("myProject", "me", "MyDevBox"); + // END:com.azure.developer.devcenter.generated.deletedevbox.deletesadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DeletesAnEnvironmentAndAllItsAssociatedResources.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DeletesAnEnvironmentAndAllItsAssociatedResources.java new file mode 100644 index 0000000000000..b01379f61a9e6 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/DeletesAnEnvironmentAndAllItsAssociatedResources.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeletesAnEnvironmentAndAllItsAssociatedResources { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.deleteenvironment.deletesanenvironmentandallitsassociatedresources + SyncPoller response + = deploymentEnvironmentsClient.beginDeleteEnvironment("myProject", "me", "mydevenv"); + // END:com.azure.developer.devcenter.generated.deleteenvironment.deletesanenvironmentandallitsassociatedresources + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetAnEnvironmentDefinitionFromACatalog.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetAnEnvironmentDefinitionFromACatalog.java new file mode 100644 index 0000000000000..160360315ccb9 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetAnEnvironmentDefinitionFromACatalog.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.EnvironmentDefinition; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAnEnvironmentDefinitionFromACatalog { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getenvironmentdefinition.getanenvironmentdefinitionfromacatalog + EnvironmentDefinition response + = deploymentEnvironmentsClient.getEnvironmentDefinition("myProject", "myCatalog", "foo"); + // END:com.azure.developer.devcenter.generated.getenvironmentdefinition.getanenvironmentdefinitionfromacatalog + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsADevBox.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsADevBox.java new file mode 100644 index 0000000000000..f4f0fa013a60c --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsADevBox.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsADevBox { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getdevbox.getsadevbox + DevBox response = devBoxesClient.getDevBox("myProject", "me", "MyDevBox"); + // END:com.azure.developer.devcenter.generated.getdevbox.getsadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAPool.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAPool.java new file mode 100644 index 0000000000000..251e47cb65550 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAPool.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxPool; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsAPool { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getpool.getsapool + DevBoxPool response = devBoxesClient.getPool("myProject", "DevPool"); + // END:com.azure.developer.devcenter.generated.getpool.getsapool + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAProject.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAProject.java new file mode 100644 index 0000000000000..abadcfaef6965 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAProject.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevCenterClient; +import com.azure.developer.devcenter.DevCenterClientBuilder; +import com.azure.developer.devcenter.models.DevCenterProject; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsAProject { + public static void main(String[] args) { + DevCenterClient devCenterClient + = new DevCenterClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getproject.getsaproject + DevCenterProject response = devCenterClient.getProject("myProject"); + // END:com.azure.developer.devcenter.generated.getproject.getsaproject + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsASchedule.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsASchedule.java new file mode 100644 index 0000000000000..e1c0e527cb3e5 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsASchedule.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxSchedule; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsASchedule { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getschedule.getsaschedule + DevBoxSchedule response = devBoxesClient.getSchedule("myProject", "DevPool", "default"); + // END:com.azure.developer.devcenter.generated.getschedule.getsaschedule + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAnAction.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAnAction.java new file mode 100644 index 0000000000000..c5dd7fb199065 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAnAction.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsAnAction { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getdevboxaction.getsanaction + DevBoxAction response = devBoxesClient.getDevBoxAction("myProject", "me", "myDevBox", "schedule-default"); + // END:com.azure.developer.devcenter.generated.getdevboxaction.getsanaction + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAnEnvironment.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAnEnvironment.java new file mode 100644 index 0000000000000..d784ef010167f --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsAnEnvironment.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsAnEnvironment { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getenvironment.getsanenvironment + DevCenterEnvironment response = deploymentEnvironmentsClient.getEnvironment("myProject", "me", "mydevenv"); + // END:com.azure.developer.devcenter.generated.getenvironment.getsanenvironment + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsRDPConnectionInfo.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsRDPConnectionInfo.java new file mode 100644 index 0000000000000..332104b386db5 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsRDPConnectionInfo.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.RemoteConnection; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsRDPConnectionInfo { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getremoteconnection.getsrdpconnectioninfo + RemoteConnection response = devBoxesClient.getRemoteConnection("myProject", "me", "MyDevBox"); + // END:com.azure.developer.devcenter.generated.getremoteconnection.getsrdpconnectioninfo + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsTheSpecifiedCatalogWithinTheProject.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsTheSpecifiedCatalogWithinTheProject.java new file mode 100644 index 0000000000000..02f8f0ec87638 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/GetsTheSpecifiedCatalogWithinTheProject.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterCatalog; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetsTheSpecifiedCatalogWithinTheProject { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.getcatalog.getsthespecifiedcatalogwithintheproject + DevCenterCatalog response = deploymentEnvironmentsClient.getCatalog("myProject", "foo"); + // END:com.azure.developer.devcenter.generated.getcatalog.getsthespecifiedcatalogwithintheproject + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsActionsOnADevBox.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsActionsOnADevBox.java new file mode 100644 index 0000000000000..a1a0edc80def0 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsActionsOnADevBox.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsActionsOnADevBox { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listdevboxactions.listsactionsonadevbox + PagedIterable response = devBoxesClient.listDevBoxActions("myProject", "me", "myDevBox"); + // END:com.azure.developer.devcenter.generated.listdevboxactions.listsactionsonadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableForAProject.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableForAProject.java new file mode 100644 index 0000000000000..0d9f5e33ef5b8 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableForAProject.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.EnvironmentDefinition; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAllEnvironmentDefinitionsAvailableForAProject { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listenvironmentdefinitions.listsallenvironmentdefinitionsavailableforaproject + PagedIterable response + = deploymentEnvironmentsClient.listEnvironmentDefinitions("myProject"); + // END:com.azure.developer.devcenter.generated.listenvironmentdefinitions.listsallenvironmentdefinitionsavailableforaproject + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableWithinACatalog.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableWithinACatalog.java new file mode 100644 index 0000000000000..27f1121b0b9e8 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableWithinACatalog.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.EnvironmentDefinition; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAllEnvironmentDefinitionsAvailableWithinACatalog { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listenvironmentdefinitionsbycatalog.listsallenvironmentdefinitionsavailablewithinacatalog + PagedIterable response + = deploymentEnvironmentsClient.listEnvironmentDefinitionsByCatalog("myProject", "myCatalog"); + // END:com.azure.developer.devcenter.generated.listenvironmentdefinitionsbycatalog.listsallenvironmentdefinitionsavailablewithinacatalog + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentTypesConfiguredForAProject.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentTypesConfiguredForAProject.java new file mode 100644 index 0000000000000..211117fd161c6 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentTypesConfiguredForAProject.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterEnvironmentType; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAllEnvironmentTypesConfiguredForAProject { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listenvironmenttypes.listsallenvironmenttypesconfiguredforaproject + PagedIterable response + = deploymentEnvironmentsClient.listEnvironmentTypes("myProject"); + // END:com.azure.developer.devcenter.generated.listenvironmenttypes.listsallenvironmenttypesconfiguredforaproject + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllOfTheCatalogsAvailableForAProject.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllOfTheCatalogsAvailableForAProject.java new file mode 100644 index 0000000000000..26e520ff4c39e --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllOfTheCatalogsAvailableForAProject.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterCatalog; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAllOfTheCatalogsAvailableForAProject { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listcatalogs.listsallofthecatalogsavailableforaproject + PagedIterable response = deploymentEnvironmentsClient.listCatalogs("myProject"); + // END:com.azure.developer.devcenter.generated.listcatalogs.listsallofthecatalogsavailableforaproject + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllProjects.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllProjects.java new file mode 100644 index 0000000000000..9eaa2cc70d960 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAllProjects.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevCenterClient; +import com.azure.developer.devcenter.DevCenterClientBuilder; +import com.azure.developer.devcenter.models.DevCenterProject; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAllProjects { + public static void main(String[] args) { + DevCenterClient devCenterClient + = new DevCenterClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listprojects.listsallprojects + PagedIterable response = devCenterClient.listProjects(); + // END:com.azure.developer.devcenter.generated.listprojects.listsallprojects + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAvailablePools.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAvailablePools.java new file mode 100644 index 0000000000000..119b8cf733cf9 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAvailablePools.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxPool; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAvailablePools { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listpools.listsavailablepools + PagedIterable response = devBoxesClient.listPools("myProject"); + // END:com.azure.developer.devcenter.generated.listpools.listsavailablepools + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAvailableSchedulesForAPool.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAvailableSchedulesForAPool.java new file mode 100644 index 0000000000000..4a891b3c1f55c --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsAvailableSchedulesForAPool.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBoxSchedule; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsAvailableSchedulesForAPool { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listschedules.listsavailableschedulesforapool + PagedIterable response = devBoxesClient.listSchedules("myProject", "DevPool"); + // END:com.azure.developer.devcenter.generated.listschedules.listsavailableschedulesforapool + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheDevCenterForAParticularUser.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheDevCenterForAParticularUser.java new file mode 100644 index 0000000000000..acc19a5263dc3 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheDevCenterForAParticularUser.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsDevBoxesInTheDevCenterForAParticularUser { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listalldevboxesbyuser.listsdevboxesinthedevcenterforaparticularuser + PagedIterable response = devBoxesClient.listAllDevBoxesByUser("me"); + // END:com.azure.developer.devcenter.generated.listalldevboxesbyuser.listsdevboxesinthedevcenterforaparticularuser + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheProjectForAParticularUser.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheProjectForAParticularUser.java new file mode 100644 index 0000000000000..3665b8c335e9e --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheProjectForAParticularUser.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsDevBoxesInTheProjectForAParticularUser { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listdevboxes.listsdevboxesintheprojectforaparticularuser + PagedIterable response = devBoxesClient.listDevBoxes("myProject", "me"); + // END:com.azure.developer.devcenter.generated.listdevboxes.listsdevboxesintheprojectforaparticularuser + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesThatTheCallerHasAccessToInTheDevCenter.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesThatTheCallerHasAccessToInTheDevCenter.java new file mode 100644 index 0000000000000..bb24025d5b9a5 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsDevBoxesThatTheCallerHasAccessToInTheDevCenter.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsDevBoxesThatTheCallerHasAccessToInTheDevCenter { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listalldevboxes.listsdevboxesthatthecallerhasaccesstointhedevcenter + PagedIterable response = devBoxesClient.listAllDevBoxes(); + // END:com.azure.developer.devcenter.generated.listalldevboxes.listsdevboxesthatthecallerhasaccesstointhedevcenter + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProject.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProject.java new file mode 100644 index 0000000000000..35c23f4c2f13a --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProject.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsTheEnvironmentsForAProject { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listallenvironments.liststheenvironmentsforaproject + PagedIterable response = deploymentEnvironmentsClient.listAllEnvironments("myProject"); + // END:com.azure.developer.devcenter.generated.listallenvironments.liststheenvironmentsforaproject + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectAndUser.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectAndUser.java new file mode 100644 index 0000000000000..351f919a2527a --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectAndUser.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsTheEnvironmentsForAProjectAndUser { + public static void main(String[] args) { + DeploymentEnvironmentsClient deploymentEnvironmentsClient + = new DeploymentEnvironmentsClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.listenvironments.liststheenvironmentsforaprojectanduser + PagedIterable response = deploymentEnvironmentsClient.listEnvironments("myProject", "me"); + // END:com.azure.developer.devcenter.generated.listenvironments.liststheenvironmentsforaprojectanduser + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/RestartsADevBox.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/RestartsADevBox.java new file mode 100644 index 0000000000000..d64a1ed173513 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/RestartsADevBox.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class RestartsADevBox { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.restartdevbox.restartsadevbox + SyncPoller response + = devBoxesClient.beginRestartDevBox("myProject", "me", "MyDevBox"); + // END:com.azure.developer.devcenter.generated.restartdevbox.restartsadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/SkipsAnOccurrenceOfAnAction.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/SkipsAnOccurrenceOfAnAction.java new file mode 100644 index 0000000000000..ea7216afb4af7 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/SkipsAnOccurrenceOfAnAction.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class SkipsAnOccurrenceOfAnAction { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.skipaction.skipsanoccurrenceofanaction + devBoxesClient.skipAction("myProject", "me", "myDevBox", "schedule-default"); + // END:com.azure.developer.devcenter.generated.skipaction.skipsanoccurrenceofanaction + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/StartsADevBox.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/StartsADevBox.java new file mode 100644 index 0000000000000..55dc09a945994 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/StartsADevBox.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class StartsADevBox { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.startdevbox.startsadevbox + SyncPoller response + = devBoxesClient.beginStartDevBox("myProject", "me", "MyDevBox"); + // END:com.azure.developer.devcenter.generated.startdevbox.startsadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/StopsADevBox.java b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/StopsADevBox.java new file mode 100644 index 0000000000000..6687618b4fd08 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/samples/java/com/azure/developer/devcenter/generated/StopsADevBox.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class StopsADevBox { + public static void main(String[] args) { + DevBoxesClient devBoxesClient + = new DevBoxesClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com") + .buildClient(); + // BEGIN:com.azure.developer.devcenter.generated.stopdevbox.stopsadevbox + SyncPoller response + = devBoxesClient.beginStopDevBox("myProject", "me", "MyDevBox", true); + // END:com.azure.developer.devcenter.generated.stopdevbox.stopsadevbox + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/CreatesOrReplacesADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/CreatesOrReplacesADevBoxTests.java new file mode 100644 index 0000000000000..03994fc019a52 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/CreatesOrReplacesADevBoxTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class CreatesOrReplacesADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testCreatesOrReplacesADevBoxTests() { + // method invocation + SyncPoller response = setPlaybackSyncPollerPollInterval( + devBoxesClient.beginCreateDevBox("myProject", "me", "MyDevBox", new DevBox("LargeDevWorkStationPool"))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/CreatesOrUpdatesAnEnvironmentTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/CreatesOrUpdatesAnEnvironmentTests.java new file mode 100644 index 0000000000000..467b7c42eec23 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/CreatesOrUpdatesAnEnvironmentTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class CreatesOrUpdatesAnEnvironmentTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testCreatesOrUpdatesAnEnvironmentTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(deploymentEnvironmentsClient.beginCreateOrUpdateEnvironment("myProject", + "me", "mydevenv", new DevCenterEnvironment("DevTest", "main", "helloworld") + .setParameters(mapOf("functionAppRuntime", "node", "storageAccountType", "Standard_LRS")))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } + + // 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-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DelaysAllActionsTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DelaysAllActionsTests.java new file mode 100644 index 0000000000000..6e35eae343bd8 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DelaysAllActionsTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.developer.devcenter.models.DevBoxActionDelayResult; +import com.azure.developer.devcenter.models.DevBoxActionDelayStatus; +import com.azure.developer.devcenter.models.DevBoxActionType; +import com.azure.developer.devcenter.models.DevBoxNextAction; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DelaysAllActionsTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testDelaysAllActionsTests() { + // method invocation + PagedIterable response = devBoxesClient.delayAllActions("myProject", "me", "myDevBox", + OffsetDateTime.parse("2022-09-30T17:00:00Z")); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBoxActionDelayResult firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "actionName" + Assertions.assertEquals("schedule-default", firstItem.getActionName()); + // verify property "delayStatus" + Assertions.assertEquals(DevBoxActionDelayStatus.SUCCEEDED, firstItem.getDelayStatus()); + // verify property "action" + DevBoxAction firstItemAction = firstItem.getAction(); + Assertions.assertNotNull(firstItemAction); + Assertions.assertEquals("schedule-default", firstItemAction.getName()); + Assertions.assertEquals(DevBoxActionType.STOP, firstItemAction.getActionType()); + Assertions.assertEquals("/projects/myProject/pools/myPool/schedules/default", firstItemAction.getSourceId()); + Assertions.assertNotNull(firstItemAction.getSuspendedUntil()); + DevBoxNextAction firstItemActionNextAction = firstItemAction.getNextAction(); + Assertions.assertNotNull(firstItemActionNextAction); + Assertions.assertNotNull(firstItemActionNextAction.getScheduledTime()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DelaysTheOccurrenceOfAnActionTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DelaysTheOccurrenceOfAnActionTests.java new file mode 100644 index 0000000000000..3349eeaaa0e94 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DelaysTheOccurrenceOfAnActionTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.developer.devcenter.models.DevBoxActionType; +import com.azure.developer.devcenter.models.DevBoxNextAction; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DelaysTheOccurrenceOfAnActionTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testDelaysTheOccurrenceOfAnActionTests() { + // method invocation + DevBoxAction response = devBoxesClient.delayAction("myProject", "me", "myDevBox", "schedule-default", + OffsetDateTime.parse("2022-09-30T17:00:00Z")); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("schedule-default", response.getName()); + // verify property "actionType" + Assertions.assertEquals(DevBoxActionType.STOP, response.getActionType()); + // verify property "sourceId" + Assertions.assertEquals("/projects/myProject/pools/myPool/schedules/default", response.getSourceId()); + // verify property "suspendedUntil" + Assertions.assertNotNull(response.getSuspendedUntil()); + // verify property "nextAction" + DevBoxNextAction responseNextAction = response.getNextAction(); + Assertions.assertNotNull(responseNextAction); + Assertions.assertNotNull(responseNextAction.getScheduledTime()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DeletesADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DeletesADevBoxTests.java new file mode 100644 index 0000000000000..376914e1b0d95 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DeletesADevBoxTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeletesADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testDeletesADevBoxTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(devBoxesClient.beginDeleteDevBox("myProject", "me", "MyDevBox")); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DeletesAnEnvironmentAndAllItsAssociatedResourcesTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DeletesAnEnvironmentAndAllItsAssociatedResourcesTests.java new file mode 100644 index 0000000000000..600dcf8484f9b --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DeletesAnEnvironmentAndAllItsAssociatedResourcesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeletesAnEnvironmentAndAllItsAssociatedResourcesTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testDeletesAnEnvironmentAndAllItsAssociatedResourcesTests() { + // method invocation + SyncPoller response = setPlaybackSyncPollerPollInterval( + deploymentEnvironmentsClient.beginDeleteEnvironment("myProject", "me", "mydevenv")); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DevCenterClientTestBase.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DevCenterClientTestBase.java new file mode 100644 index 0000000000000..5d01f31705493 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/DevCenterClientTestBase.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.developer.devcenter.DeploymentEnvironmentsClient; +import com.azure.developer.devcenter.DeploymentEnvironmentsClientBuilder; +import com.azure.developer.devcenter.DevBoxesClient; +import com.azure.developer.devcenter.DevBoxesClientBuilder; +import com.azure.developer.devcenter.DevCenterClient; +import com.azure.developer.devcenter.DevCenterClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +class DevCenterClientTestBase extends TestProxyTestBase { + protected DevCenterClient devCenterClient; + + protected DevBoxesClient devBoxesClient; + + protected DeploymentEnvironmentsClient deploymentEnvironmentsClient; + + @Override + protected void beforeTest() { + DevCenterClientBuilder devCenterClientbuilder + = new DevCenterClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + devCenterClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + devCenterClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + devCenterClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + devCenterClient = devCenterClientbuilder.buildClient(); + + DevBoxesClientBuilder devBoxesClientbuilder + = new DevBoxesClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + devBoxesClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + devBoxesClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + devBoxesClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + devBoxesClient = devBoxesClientbuilder.buildClient(); + + DeploymentEnvironmentsClientBuilder deploymentEnvironmentsClientbuilder + = new DeploymentEnvironmentsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deploymentEnvironmentsClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + deploymentEnvironmentsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + deploymentEnvironmentsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + deploymentEnvironmentsClient = deploymentEnvironmentsClientbuilder.buildClient(); + + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetAnEnvironmentDefinitionFromACatalogTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetAnEnvironmentDefinitionFromACatalogTests.java new file mode 100644 index 0000000000000..a127001decacb --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetAnEnvironmentDefinitionFromACatalogTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.EnvironmentDefinition; +import com.azure.developer.devcenter.models.EnvironmentDefinitionParameter; +import com.azure.developer.devcenter.models.EnvironmentDefinitionParameterType; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetAnEnvironmentDefinitionFromACatalogTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetAnEnvironmentDefinitionFromACatalogTests() { + // method invocation + EnvironmentDefinition response + = deploymentEnvironmentsClient.getEnvironmentDefinition("myProject", "myCatalog", "foo"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "id" + Assertions.assertEquals("/projects/myProject/catalogs/myCatalog/environmentDefinitions/foo", response.getId()); + // verify property "name" + Assertions.assertEquals("foo", response.getName()); + // verify property "catalogName" + Assertions.assertEquals("myCatalog", response.getCatalogName()); + // verify property "description" + Assertions.assertEquals("This environment definition is just for example purposes.", response.getDescription()); + // verify property "parameters" + List responseParameters = response.getParameters(); + EnvironmentDefinitionParameter responseParametersFirstItem = responseParameters.iterator().next(); + Assertions.assertNotNull(responseParametersFirstItem); + Assertions.assertEquals("functionAppRuntime", responseParametersFirstItem.getId()); + Assertions.assertEquals("Function App Runtime", responseParametersFirstItem.getName()); + Assertions.assertEquals("dotnet", responseParametersFirstItem.getDefaultValue()); + Assertions.assertEquals(EnvironmentDefinitionParameterType.STRING, + responseParametersFirstItem.getParameterType()); + Assertions.assertEquals(true, responseParametersFirstItem.isRequired()); + List responseParametersFirstItemAllowed = responseParametersFirstItem.getAllowed(); + Assertions.assertEquals("node", responseParametersFirstItemAllowed.iterator().next()); + // verify property "parametersSchema" + Assertions.assertEquals( + "{\"type\":\"object\",\"properties\":{\"functionAppRuntime\":{\"$id\":\"functionAppRuntime\",\"value\":\"dotnet\",\"displayName\":\"Function App Runtime\",\"type\":\"string\",\"enum\":[\"node\",\"dotnet\",\"java\"]},\"storageAccountType\":{\"$id\":\"storageAccountType\",\"value\":\"Standard_LRS\",\"displayName\":\"Storage Account Type\",\"type\":\"string\",\"enum\":[\"Standard_LRS\",\"Standard_GRS\",\"Standard_RAGRS\"]},\"httpsOnly\":{\"$id\":\"httpsOnly\",\"value\":true,\"displayName\":\"HTTPS only\",\"type\":\"boolean\"}},\"required\":[\"functionAppRuntime\",\"storageAccountType\"]}", + response.getParametersSchema()); + // verify property "templatePath" + Assertions.assertEquals("azuredeploy.json", response.getTemplatePath()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsADevBoxTests.java new file mode 100644 index 0000000000000..3775b365648a6 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsADevBoxTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevBox; +import com.azure.developer.devcenter.models.DevBoxHardwareProfile; +import com.azure.developer.devcenter.models.DevBoxImageReference; +import com.azure.developer.devcenter.models.DevBoxOsType; +import com.azure.developer.devcenter.models.DevBoxProvisioningState; +import com.azure.developer.devcenter.models.DevBoxStorageProfile; +import com.azure.developer.devcenter.models.HibernateSupport; +import com.azure.developer.devcenter.models.OsDisk; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsADevBoxTests() { + // method invocation + DevBox response = devBoxesClient.getDevBox("myProject", "me", "MyDevBox"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("MyDevBox", response.getName()); + // verify property "projectName" + Assertions.assertEquals("ContosoProject", response.getProjectName()); + // verify property "poolName" + Assertions.assertEquals("LargeDevWorkStationPool", response.getPoolName()); + // verify property "hibernateSupport" + Assertions.assertEquals(HibernateSupport.ENABLED, response.getHibernateSupport()); + // verify property "provisioningState" + Assertions.assertEquals(DevBoxProvisioningState.SUCCEEDED, response.getProvisioningState()); + // verify property "location" + Assertions.assertEquals("centralus", response.getLocation()); + // verify property "osType" + Assertions.assertEquals(DevBoxOsType.WINDOWS, response.getOsType()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", response.getUserId()); + // verify property "hardwareProfile" + DevBoxHardwareProfile responseHardwareProfile = response.getHardwareProfile(); + Assertions.assertNotNull(responseHardwareProfile); + Assertions.assertEquals(8, responseHardwareProfile.getVCpus()); + Assertions.assertEquals(32, responseHardwareProfile.getMemoryInGb()); + // verify property "storageProfile" + DevBoxStorageProfile responseStorageProfile = response.getStorageProfile(); + Assertions.assertNotNull(responseStorageProfile); + OsDisk responseStorageProfileOsDisk = responseStorageProfile.getOsDisk(); + Assertions.assertNotNull(responseStorageProfileOsDisk); + Assertions.assertEquals(1024, responseStorageProfileOsDisk.getDiskSizeInGb()); + // verify property "imageReference" + DevBoxImageReference responseImageReference = response.getImageReference(); + Assertions.assertNotNull(responseImageReference); + Assertions.assertEquals("DevImage", responseImageReference.getName()); + Assertions.assertEquals("1.0.0", responseImageReference.getVersion()); + Assertions.assertNotNull(responseImageReference.getPublishedDate()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAPoolTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAPoolTests.java new file mode 100644 index 0000000000000..bdd772e9436d5 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAPoolTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevBoxHardwareProfile; +import com.azure.developer.devcenter.models.DevBoxImageReference; +import com.azure.developer.devcenter.models.DevBoxOsType; +import com.azure.developer.devcenter.models.DevBoxPool; +import com.azure.developer.devcenter.models.DevBoxStorageProfile; +import com.azure.developer.devcenter.models.HibernateSupport; +import com.azure.developer.devcenter.models.OsDisk; +import com.azure.developer.devcenter.models.PoolHealthStatus; +import com.azure.developer.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.developer.devcenter.models.StopOnDisconnectStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsAPoolTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsAPoolTests() { + // method invocation + DevBoxPool response = devBoxesClient.getPool("myProject", "DevPool"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("LargeDevWorkStationPool", response.getName()); + // verify property "location" + Assertions.assertEquals("centralus", response.getLocation()); + // verify property "osType" + Assertions.assertEquals(DevBoxOsType.WINDOWS, response.getOsType()); + // verify property "hardwareProfile" + DevBoxHardwareProfile responseHardwareProfile = response.getHardwareProfile(); + Assertions.assertNotNull(responseHardwareProfile); + Assertions.assertEquals(8, responseHardwareProfile.getVCpus()); + Assertions.assertEquals(32, responseHardwareProfile.getMemoryInGb()); + // verify property "hibernateSupport" + Assertions.assertEquals(HibernateSupport.ENABLED, response.getHibernateSupport()); + // verify property "storageProfile" + DevBoxStorageProfile responseStorageProfile = response.getStorageProfile(); + Assertions.assertNotNull(responseStorageProfile); + OsDisk responseStorageProfileOsDisk = responseStorageProfile.getOsDisk(); + Assertions.assertNotNull(responseStorageProfileOsDisk); + Assertions.assertEquals(1024, responseStorageProfileOsDisk.getDiskSizeInGb()); + // verify property "imageReference" + DevBoxImageReference responseImageReference = response.getImageReference(); + Assertions.assertNotNull(responseImageReference); + Assertions.assertEquals("DevImage", responseImageReference.getName()); + Assertions.assertEquals("1.0.0", responseImageReference.getVersion()); + Assertions.assertNotNull(responseImageReference.getPublishedDate()); + // verify property "stopOnDisconnect" + StopOnDisconnectConfiguration responseStopOnDisconnect = response.getStopOnDisconnect(); + Assertions.assertNotNull(responseStopOnDisconnect); + Assertions.assertEquals(StopOnDisconnectStatus.ENABLED, responseStopOnDisconnect.getStatus()); + Assertions.assertEquals(60, responseStopOnDisconnect.getGracePeriodInMinutes()); + // verify property "healthStatus" + Assertions.assertEquals(PoolHealthStatus.HEALTHY, response.getHealthStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAProjectTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAProjectTests.java new file mode 100644 index 0000000000000..2ea90a96fce54 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAProjectTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevCenterProject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsAProjectTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsAProjectTests() { + // method invocation + DevCenterProject response = devCenterClient.getProject("myProject"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("DevDiv", response.getName()); + // verify property "description" + Assertions.assertEquals("The developer division", response.getDescription()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAScheduleTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAScheduleTests.java new file mode 100644 index 0000000000000..40f2d514d7bd2 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAScheduleTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevBoxSchedule; +import com.azure.developer.devcenter.models.ScheduleFrequency; +import com.azure.developer.devcenter.models.ScheduleType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsAScheduleTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsAScheduleTests() { + // method invocation + DevBoxSchedule response = devBoxesClient.getSchedule("myProject", "DevPool", "default"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("default", response.getName()); + // verify property "scheduleType" + Assertions.assertEquals(ScheduleType.STOP_DEV_BOX, response.getScheduleType()); + // verify property "scheduleFrequency" + Assertions.assertEquals(ScheduleFrequency.DAILY, response.getScheduleFrequency()); + // verify property "time" + Assertions.assertEquals("17:30", response.getTime()); + // verify property "timeZone" + Assertions.assertEquals("America/Los_Angeles", response.getTimeZone()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAnActionTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAnActionTests.java new file mode 100644 index 0000000000000..2748bb1cb87c0 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAnActionTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.developer.devcenter.models.DevBoxActionType; +import com.azure.developer.devcenter.models.DevBoxNextAction; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsAnActionTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsAnActionTests() { + // method invocation + DevBoxAction response = devBoxesClient.getDevBoxAction("myProject", "me", "myDevBox", "schedule-default"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("schedule-default", response.getName()); + // verify property "actionType" + Assertions.assertEquals(DevBoxActionType.STOP, response.getActionType()); + // verify property "sourceId" + Assertions.assertEquals("/projects/myProject/pools/myPool/schedules/default", response.getSourceId()); + // verify property "nextAction" + DevBoxNextAction responseNextAction = response.getNextAction(); + Assertions.assertNotNull(responseNextAction); + Assertions.assertNotNull(responseNextAction.getScheduledTime()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAnEnvironmentTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAnEnvironmentTests.java new file mode 100644 index 0000000000000..f9fcb494e3b97 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsAnEnvironmentTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.developer.devcenter.models.EnvironmentProvisioningState; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsAnEnvironmentTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsAnEnvironmentTests() { + // method invocation + DevCenterEnvironment response = deploymentEnvironmentsClient.getEnvironment("myProject", "me", "mydevenv"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "parameters" + Assertions.assertNotNull(response.getParameters()); + // verify property "name" + Assertions.assertEquals("mydevenv", response.getName()); + // verify property "environmentTypeName" + Assertions.assertEquals("DevTest", response.getEnvironmentTypeName()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", response.getUserId()); + // verify property "provisioningState" + Assertions.assertEquals(EnvironmentProvisioningState.SUCCEEDED, response.getProvisioningState()); + // verify property "resourceGroupId" + Assertions.assertEquals("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg028321", + response.getResourceGroupId()); + // verify property "catalogName" + Assertions.assertEquals("main", response.getCatalogName()); + // verify property "environmentDefinitionName" + Assertions.assertEquals("helloworld", response.getEnvironmentDefinitionName()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsRDPConnectionInfoTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsRDPConnectionInfoTests.java new file mode 100644 index 0000000000000..b5da4cabe3e0d --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsRDPConnectionInfoTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.RemoteConnection; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsRDPConnectionInfoTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsRDPConnectionInfoTests() { + // method invocation + RemoteConnection response = devBoxesClient.getRemoteConnection("myProject", "me", "MyDevBox"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "webUrl" + Assertions.assertEquals("https://connectionUrl", response.getWebUrl()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsTheSpecifiedCatalogWithinTheProjectTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsTheSpecifiedCatalogWithinTheProjectTests.java new file mode 100644 index 0000000000000..c246883816381 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/GetsTheSpecifiedCatalogWithinTheProjectTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.developer.devcenter.models.DevCenterCatalog; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class GetsTheSpecifiedCatalogWithinTheProjectTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testGetsTheSpecifiedCatalogWithinTheProjectTests() { + // method invocation + DevCenterCatalog response = deploymentEnvironmentsClient.getCatalog("myProject", "foo"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "name" + Assertions.assertEquals("foo", response.getName()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsActionsOnADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsActionsOnADevBoxTests.java new file mode 100644 index 0000000000000..bd015c574284c --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsActionsOnADevBoxTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBoxAction; +import com.azure.developer.devcenter.models.DevBoxActionType; +import com.azure.developer.devcenter.models.DevBoxNextAction; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsActionsOnADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsActionsOnADevBoxTests() { + // method invocation + PagedIterable response = devBoxesClient.listDevBoxActions("myProject", "me", "myDevBox"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBoxAction firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("idle-hibernateondisconnect", firstItem.getName()); + // verify property "actionType" + Assertions.assertEquals(DevBoxActionType.STOP, firstItem.getActionType()); + // verify property "sourceId" + Assertions.assertEquals("/projects/myProject/pools/myPool", firstItem.getSourceId()); + // verify property "nextAction" + DevBoxNextAction firstItemNextAction = firstItem.getNextAction(); + Assertions.assertNotNull(firstItemNextAction); + Assertions.assertNotNull(firstItemNextAction.getScheduledTime()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableForAProjectTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableForAProjectTests.java new file mode 100644 index 0000000000000..add411b8bc681 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableForAProjectTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.EnvironmentDefinition; +import com.azure.developer.devcenter.models.EnvironmentDefinitionParameter; +import com.azure.developer.devcenter.models.EnvironmentDefinitionParameterType; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAllEnvironmentDefinitionsAvailableForAProjectTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAllEnvironmentDefinitionsAvailableForAProjectTests() { + // method invocation + PagedIterable response + = deploymentEnvironmentsClient.listEnvironmentDefinitions("myProject"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + EnvironmentDefinition firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "id" + Assertions.assertEquals("/projects/myProject/catalogs/myCatalog/environmentDefinitions/foo", firstItem.getId()); + // verify property "name" + Assertions.assertEquals("foo", firstItem.getName()); + // verify property "catalogName" + Assertions.assertEquals("myCatalog", firstItem.getCatalogName()); + // verify property "description" + Assertions.assertEquals("This environment definition is just for example purposes.", + firstItem.getDescription()); + // verify property "parameters" + List firstItemParameters = firstItem.getParameters(); + EnvironmentDefinitionParameter firstItemParametersFirstItem = firstItemParameters.iterator().next(); + Assertions.assertNotNull(firstItemParametersFirstItem); + Assertions.assertEquals("functionAppRuntime", firstItemParametersFirstItem.getId()); + Assertions.assertEquals("Function App Runtime", firstItemParametersFirstItem.getName()); + Assertions.assertEquals("dotnet", firstItemParametersFirstItem.getDefaultValue()); + Assertions.assertEquals(EnvironmentDefinitionParameterType.STRING, + firstItemParametersFirstItem.getParameterType()); + Assertions.assertEquals(true, firstItemParametersFirstItem.isRequired()); + List firstItemParametersFirstItemAllowed = firstItemParametersFirstItem.getAllowed(); + Assertions.assertEquals("node", firstItemParametersFirstItemAllowed.iterator().next()); + // verify property "parametersSchema" + Assertions.assertEquals( + "{\"type\":\"object\",\"properties\":{\"functionAppRuntime\":{\"$id\":\"functionAppRuntime\",\"value\":\"dotnet\",\"displayName\":\"Function App Runtime\",\"type\":\"string\",\"enum\":[\"node\",\"dotnet\",\"java\"]},\"storageAccountType\":{\"$id\":\"storageAccountType\",\"value\":\"Standard_LRS\",\"displayName\":\"Storage Account Type\",\"type\":\"string\",\"enum\":[\"Standard_LRS\",\"Standard_GRS\",\"Standard_RAGRS\"]},\"httpsOnly\":{\"$id\":\"httpsOnly\",\"value\":true,\"displayName\":\"HTTPS only\",\"type\":\"boolean\"}},\"required\":[\"functionAppRuntime\",\"storageAccountType\"]}", + firstItem.getParametersSchema()); + // verify property "templatePath" + Assertions.assertEquals("azuredeploy.json", firstItem.getTemplatePath()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableWithinACatalogTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableWithinACatalogTests.java new file mode 100644 index 0000000000000..598163c0092b8 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentDefinitionsAvailableWithinACatalogTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.EnvironmentDefinition; +import com.azure.developer.devcenter.models.EnvironmentDefinitionParameter; +import com.azure.developer.devcenter.models.EnvironmentDefinitionParameterType; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAllEnvironmentDefinitionsAvailableWithinACatalogTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAllEnvironmentDefinitionsAvailableWithinACatalogTests() { + // method invocation + PagedIterable response + = deploymentEnvironmentsClient.listEnvironmentDefinitionsByCatalog("myProject", "myCatalog"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + EnvironmentDefinition firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "id" + Assertions.assertEquals("/projects/myProject/catalogs/myCatalog/environmentDefinitions/foo", firstItem.getId()); + // verify property "name" + Assertions.assertEquals("foo", firstItem.getName()); + // verify property "catalogName" + Assertions.assertEquals("myCatalog", firstItem.getCatalogName()); + // verify property "description" + Assertions.assertEquals("This environment definition is just for example purposes.", + firstItem.getDescription()); + // verify property "parameters" + List firstItemParameters = firstItem.getParameters(); + EnvironmentDefinitionParameter firstItemParametersFirstItem = firstItemParameters.iterator().next(); + Assertions.assertNotNull(firstItemParametersFirstItem); + Assertions.assertEquals("functionAppRuntime", firstItemParametersFirstItem.getId()); + Assertions.assertEquals("Function App Runtime", firstItemParametersFirstItem.getName()); + Assertions.assertEquals("dotnet", firstItemParametersFirstItem.getDefaultValue()); + Assertions.assertEquals(EnvironmentDefinitionParameterType.STRING, + firstItemParametersFirstItem.getParameterType()); + Assertions.assertEquals(true, firstItemParametersFirstItem.isRequired()); + List firstItemParametersFirstItemAllowed = firstItemParametersFirstItem.getAllowed(); + Assertions.assertEquals("node", firstItemParametersFirstItemAllowed.iterator().next()); + // verify property "parametersSchema" + Assertions.assertEquals( + "{\"type\":\"object\",\"properties\":{\"functionAppRuntime\":{\"$id\":\"functionAppRuntime\",\"value\":\"dotnet\",\"displayName\":\"Function App Runtime\",\"type\":\"string\",\"enum\":[\"node\",\"dotnet\",\"java\"]},\"storageAccountType\":{\"$id\":\"storageAccountType\",\"value\":\"Standard_LRS\",\"displayName\":\"Storage Account Type\",\"type\":\"string\",\"enum\":[\"Standard_LRS\",\"Standard_GRS\",\"Standard_RAGRS\"]},\"httpsOnly\":{\"$id\":\"httpsOnly\",\"value\":true,\"displayName\":\"HTTPS only\",\"type\":\"boolean\"}},\"required\":[\"functionAppRuntime\",\"storageAccountType\"]}", + firstItem.getParametersSchema()); + // verify property "templatePath" + Assertions.assertEquals("azuredeploy.json", firstItem.getTemplatePath()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentTypesConfiguredForAProjectTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentTypesConfiguredForAProjectTests.java new file mode 100644 index 0000000000000..465c6e82e251e --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllEnvironmentTypesConfiguredForAProjectTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevCenterEnvironmentType; +import com.azure.developer.devcenter.models.EnvironmentTypeStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAllEnvironmentTypesConfiguredForAProjectTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAllEnvironmentTypesConfiguredForAProjectTests() { + // method invocation + PagedIterable response + = deploymentEnvironmentsClient.listEnvironmentTypes("myProject"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevCenterEnvironmentType firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("devtestenv", firstItem.getName()); + // verify property "deploymentTargetId" + Assertions.assertEquals("/subscriptions/00000000-0000-0000-0000-000000000000", + firstItem.getDeploymentTargetId()); + // verify property "status" + Assertions.assertEquals(EnvironmentTypeStatus.ENABLED, firstItem.getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllOfTheCatalogsAvailableForAProjectTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllOfTheCatalogsAvailableForAProjectTests.java new file mode 100644 index 0000000000000..bcd45b9eb1ae6 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllOfTheCatalogsAvailableForAProjectTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevCenterCatalog; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAllOfTheCatalogsAvailableForAProjectTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAllOfTheCatalogsAvailableForAProjectTests() { + // method invocation + PagedIterable response = deploymentEnvironmentsClient.listCatalogs("myProject"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevCenterCatalog firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("foo", firstItem.getName()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllProjectsTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllProjectsTests.java new file mode 100644 index 0000000000000..776cd519fabe0 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAllProjectsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevCenterProject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAllProjectsTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAllProjectsTests() { + // method invocation + PagedIterable response = devCenterClient.listProjects(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevCenterProject firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("DevDiv", firstItem.getName()); + // verify property "description" + Assertions.assertEquals("The developer division", firstItem.getDescription()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAvailablePoolsTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAvailablePoolsTests.java new file mode 100644 index 0000000000000..887d58b355838 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAvailablePoolsTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBoxHardwareProfile; +import com.azure.developer.devcenter.models.DevBoxImageReference; +import com.azure.developer.devcenter.models.DevBoxOsType; +import com.azure.developer.devcenter.models.DevBoxPool; +import com.azure.developer.devcenter.models.DevBoxStorageProfile; +import com.azure.developer.devcenter.models.HibernateSupport; +import com.azure.developer.devcenter.models.OsDisk; +import com.azure.developer.devcenter.models.PoolHealthStatus; +import com.azure.developer.devcenter.models.StopOnDisconnectConfiguration; +import com.azure.developer.devcenter.models.StopOnDisconnectStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAvailablePoolsTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAvailablePoolsTests() { + // method invocation + PagedIterable response = devBoxesClient.listPools("myProject"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBoxPool firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("LargeDevWorkStationPool", firstItem.getName()); + // verify property "location" + Assertions.assertEquals("centralus", firstItem.getLocation()); + // verify property "osType" + Assertions.assertEquals(DevBoxOsType.WINDOWS, firstItem.getOsType()); + // verify property "hardwareProfile" + DevBoxHardwareProfile firstItemHardwareProfile = firstItem.getHardwareProfile(); + Assertions.assertNotNull(firstItemHardwareProfile); + Assertions.assertEquals(8, firstItemHardwareProfile.getVCpus()); + Assertions.assertEquals(32, firstItemHardwareProfile.getMemoryInGb()); + // verify property "hibernateSupport" + Assertions.assertEquals(HibernateSupport.ENABLED, firstItem.getHibernateSupport()); + // verify property "storageProfile" + DevBoxStorageProfile firstItemStorageProfile = firstItem.getStorageProfile(); + Assertions.assertNotNull(firstItemStorageProfile); + OsDisk firstItemStorageProfileOsDisk = firstItemStorageProfile.getOsDisk(); + Assertions.assertNotNull(firstItemStorageProfileOsDisk); + Assertions.assertEquals(1024, firstItemStorageProfileOsDisk.getDiskSizeInGb()); + // verify property "imageReference" + DevBoxImageReference firstItemImageReference = firstItem.getImageReference(); + Assertions.assertNotNull(firstItemImageReference); + Assertions.assertEquals("DevImage", firstItemImageReference.getName()); + Assertions.assertEquals("1.0.0", firstItemImageReference.getVersion()); + Assertions.assertNotNull(firstItemImageReference.getPublishedDate()); + // verify property "stopOnDisconnect" + StopOnDisconnectConfiguration firstItemStopOnDisconnect = firstItem.getStopOnDisconnect(); + Assertions.assertNotNull(firstItemStopOnDisconnect); + Assertions.assertEquals(StopOnDisconnectStatus.ENABLED, firstItemStopOnDisconnect.getStatus()); + Assertions.assertEquals(60, firstItemStopOnDisconnect.getGracePeriodInMinutes()); + // verify property "healthStatus" + Assertions.assertEquals(PoolHealthStatus.HEALTHY, firstItem.getHealthStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAvailableSchedulesForAPoolTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAvailableSchedulesForAPoolTests.java new file mode 100644 index 0000000000000..840351702ccb7 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsAvailableSchedulesForAPoolTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBoxSchedule; +import com.azure.developer.devcenter.models.ScheduleFrequency; +import com.azure.developer.devcenter.models.ScheduleType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsAvailableSchedulesForAPoolTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsAvailableSchedulesForAPoolTests() { + // method invocation + PagedIterable response = devBoxesClient.listSchedules("myProject", "DevPool"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBoxSchedule firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("default", firstItem.getName()); + // verify property "scheduleType" + Assertions.assertEquals(ScheduleType.STOP_DEV_BOX, firstItem.getScheduleType()); + // verify property "scheduleFrequency" + Assertions.assertEquals(ScheduleFrequency.DAILY, firstItem.getScheduleFrequency()); + // verify property "time" + Assertions.assertEquals("17:30", firstItem.getTime()); + // verify property "timeZone" + Assertions.assertEquals("America/Los_Angeles", firstItem.getTimeZone()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheDevCenterForAParticularUserTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheDevCenterForAParticularUserTests.java new file mode 100644 index 0000000000000..2acde0ae2b374 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheDevCenterForAParticularUserTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.developer.devcenter.models.DevBoxHardwareProfile; +import com.azure.developer.devcenter.models.DevBoxImageReference; +import com.azure.developer.devcenter.models.DevBoxOsType; +import com.azure.developer.devcenter.models.DevBoxProvisioningState; +import com.azure.developer.devcenter.models.DevBoxStorageProfile; +import com.azure.developer.devcenter.models.HibernateSupport; +import com.azure.developer.devcenter.models.OsDisk; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsDevBoxesInTheDevCenterForAParticularUserTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsDevBoxesInTheDevCenterForAParticularUserTests() { + // method invocation + PagedIterable response = devBoxesClient.listAllDevBoxesByUser("me"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBox firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("MyDevBox", firstItem.getName()); + // verify property "projectName" + Assertions.assertEquals("ContosoProject", firstItem.getProjectName()); + // verify property "poolName" + Assertions.assertEquals("LargeDevWorkStationPool", firstItem.getPoolName()); + // verify property "hibernateSupport" + Assertions.assertEquals(HibernateSupport.ENABLED, firstItem.getHibernateSupport()); + // verify property "provisioningState" + Assertions.assertEquals(DevBoxProvisioningState.SUCCEEDED, firstItem.getProvisioningState()); + // verify property "location" + Assertions.assertEquals("centralus", firstItem.getLocation()); + // verify property "osType" + Assertions.assertEquals(DevBoxOsType.WINDOWS, firstItem.getOsType()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", firstItem.getUserId()); + // verify property "hardwareProfile" + DevBoxHardwareProfile firstItemHardwareProfile = firstItem.getHardwareProfile(); + Assertions.assertNotNull(firstItemHardwareProfile); + Assertions.assertEquals(8, firstItemHardwareProfile.getVCpus()); + Assertions.assertEquals(32, firstItemHardwareProfile.getMemoryInGb()); + // verify property "storageProfile" + DevBoxStorageProfile firstItemStorageProfile = firstItem.getStorageProfile(); + Assertions.assertNotNull(firstItemStorageProfile); + OsDisk firstItemStorageProfileOsDisk = firstItemStorageProfile.getOsDisk(); + Assertions.assertNotNull(firstItemStorageProfileOsDisk); + Assertions.assertEquals(1024, firstItemStorageProfileOsDisk.getDiskSizeInGb()); + // verify property "imageReference" + DevBoxImageReference firstItemImageReference = firstItem.getImageReference(); + Assertions.assertNotNull(firstItemImageReference); + Assertions.assertEquals("DevImage", firstItemImageReference.getName()); + Assertions.assertEquals("1.0.0", firstItemImageReference.getVersion()); + Assertions.assertNotNull(firstItemImageReference.getPublishedDate()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheProjectForAParticularUserTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheProjectForAParticularUserTests.java new file mode 100644 index 0000000000000..d80ae34c5c42b --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesInTheProjectForAParticularUserTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.developer.devcenter.models.DevBoxHardwareProfile; +import com.azure.developer.devcenter.models.DevBoxImageReference; +import com.azure.developer.devcenter.models.DevBoxOsType; +import com.azure.developer.devcenter.models.DevBoxProvisioningState; +import com.azure.developer.devcenter.models.DevBoxStorageProfile; +import com.azure.developer.devcenter.models.HibernateSupport; +import com.azure.developer.devcenter.models.OsDisk; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsDevBoxesInTheProjectForAParticularUserTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsDevBoxesInTheProjectForAParticularUserTests() { + // method invocation + PagedIterable response = devBoxesClient.listDevBoxes("myProject", "me"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBox firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("MyDevBox", firstItem.getName()); + // verify property "projectName" + Assertions.assertEquals("ContosoProject", firstItem.getProjectName()); + // verify property "poolName" + Assertions.assertEquals("LargeDevWorkStationPool", firstItem.getPoolName()); + // verify property "hibernateSupport" + Assertions.assertEquals(HibernateSupport.ENABLED, firstItem.getHibernateSupport()); + // verify property "provisioningState" + Assertions.assertEquals(DevBoxProvisioningState.SUCCEEDED, firstItem.getProvisioningState()); + // verify property "location" + Assertions.assertEquals("centralus", firstItem.getLocation()); + // verify property "osType" + Assertions.assertEquals(DevBoxOsType.WINDOWS, firstItem.getOsType()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", firstItem.getUserId()); + // verify property "hardwareProfile" + DevBoxHardwareProfile firstItemHardwareProfile = firstItem.getHardwareProfile(); + Assertions.assertNotNull(firstItemHardwareProfile); + Assertions.assertEquals(8, firstItemHardwareProfile.getVCpus()); + Assertions.assertEquals(32, firstItemHardwareProfile.getMemoryInGb()); + // verify property "storageProfile" + DevBoxStorageProfile firstItemStorageProfile = firstItem.getStorageProfile(); + Assertions.assertNotNull(firstItemStorageProfile); + OsDisk firstItemStorageProfileOsDisk = firstItemStorageProfile.getOsDisk(); + Assertions.assertNotNull(firstItemStorageProfileOsDisk); + Assertions.assertEquals(1024, firstItemStorageProfileOsDisk.getDiskSizeInGb()); + // verify property "imageReference" + DevBoxImageReference firstItemImageReference = firstItem.getImageReference(); + Assertions.assertNotNull(firstItemImageReference); + Assertions.assertEquals("DevImage", firstItemImageReference.getName()); + Assertions.assertEquals("1.0.0", firstItemImageReference.getVersion()); + Assertions.assertNotNull(firstItemImageReference.getPublishedDate()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesThatTheCallerHasAccessToInTheDevCenterTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesThatTheCallerHasAccessToInTheDevCenterTests.java new file mode 100644 index 0000000000000..3e7557b32d45b --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsDevBoxesThatTheCallerHasAccessToInTheDevCenterTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevBox; +import com.azure.developer.devcenter.models.DevBoxHardwareProfile; +import com.azure.developer.devcenter.models.DevBoxImageReference; +import com.azure.developer.devcenter.models.DevBoxOsType; +import com.azure.developer.devcenter.models.DevBoxProvisioningState; +import com.azure.developer.devcenter.models.DevBoxStorageProfile; +import com.azure.developer.devcenter.models.HibernateSupport; +import com.azure.developer.devcenter.models.OsDisk; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsDevBoxesThatTheCallerHasAccessToInTheDevCenterTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsDevBoxesThatTheCallerHasAccessToInTheDevCenterTests() { + // method invocation + PagedIterable response = devBoxesClient.listAllDevBoxes(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevBox firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "name" + Assertions.assertEquals("MyDevBox", firstItem.getName()); + // verify property "projectName" + Assertions.assertEquals("ContosoProject", firstItem.getProjectName()); + // verify property "poolName" + Assertions.assertEquals("LargeDevWorkStationPool", firstItem.getPoolName()); + // verify property "hibernateSupport" + Assertions.assertEquals(HibernateSupport.ENABLED, firstItem.getHibernateSupport()); + // verify property "provisioningState" + Assertions.assertEquals(DevBoxProvisioningState.SUCCEEDED, firstItem.getProvisioningState()); + // verify property "location" + Assertions.assertEquals("centralus", firstItem.getLocation()); + // verify property "osType" + Assertions.assertEquals(DevBoxOsType.WINDOWS, firstItem.getOsType()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", firstItem.getUserId()); + // verify property "hardwareProfile" + DevBoxHardwareProfile firstItemHardwareProfile = firstItem.getHardwareProfile(); + Assertions.assertNotNull(firstItemHardwareProfile); + Assertions.assertEquals(8, firstItemHardwareProfile.getVCpus()); + Assertions.assertEquals(32, firstItemHardwareProfile.getMemoryInGb()); + // verify property "storageProfile" + DevBoxStorageProfile firstItemStorageProfile = firstItem.getStorageProfile(); + Assertions.assertNotNull(firstItemStorageProfile); + OsDisk firstItemStorageProfileOsDisk = firstItemStorageProfile.getOsDisk(); + Assertions.assertNotNull(firstItemStorageProfileOsDisk); + Assertions.assertEquals(1024, firstItemStorageProfileOsDisk.getDiskSizeInGb()); + // verify property "imageReference" + DevBoxImageReference firstItemImageReference = firstItem.getImageReference(); + Assertions.assertNotNull(firstItemImageReference); + Assertions.assertEquals("DevImage", firstItemImageReference.getName()); + Assertions.assertEquals("1.0.0", firstItemImageReference.getVersion()); + Assertions.assertNotNull(firstItemImageReference.getPublishedDate()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectAndUserTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectAndUserTests.java new file mode 100644 index 0000000000000..725608d3a068e --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectAndUserTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.developer.devcenter.models.EnvironmentProvisioningState; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsTheEnvironmentsForAProjectAndUserTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsTheEnvironmentsForAProjectAndUserTests() { + // method invocation + PagedIterable response = deploymentEnvironmentsClient.listEnvironments("myProject", "me"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevCenterEnvironment firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "parameters" + Assertions.assertNotNull(firstItem.getParameters()); + // verify property "name" + Assertions.assertEquals("mydevenv", firstItem.getName()); + // verify property "environmentTypeName" + Assertions.assertEquals("DevTest", firstItem.getEnvironmentTypeName()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", firstItem.getUserId()); + // verify property "provisioningState" + Assertions.assertEquals(EnvironmentProvisioningState.SUCCEEDED, firstItem.getProvisioningState()); + // verify property "resourceGroupId" + Assertions.assertEquals("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg028321", + firstItem.getResourceGroupId()); + // verify property "catalogName" + Assertions.assertEquals("main", firstItem.getCatalogName()); + // verify property "environmentDefinitionName" + Assertions.assertEquals("helloworld", firstItem.getEnvironmentDefinitionName()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectTests.java new file mode 100644 index 0000000000000..f7f952d2cefb2 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/ListsTheEnvironmentsForAProjectTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.developer.devcenter.models.DevCenterEnvironment; +import com.azure.developer.devcenter.models.EnvironmentProvisioningState; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListsTheEnvironmentsForAProjectTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testListsTheEnvironmentsForAProjectTests() { + // method invocation + PagedIterable response = deploymentEnvironmentsClient.listAllEnvironments("myProject"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DevCenterEnvironment firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "parameters" + Assertions.assertNotNull(firstItem.getParameters()); + // verify property "name" + Assertions.assertEquals("mydevenv", firstItem.getName()); + // verify property "environmentTypeName" + Assertions.assertEquals("DevTest", firstItem.getEnvironmentTypeName()); + // verify property "userId" + Assertions.assertEquals("b08e39b4-2ac6-4465-a35e-48322efb0f98", firstItem.getUserId()); + // verify property "provisioningState" + Assertions.assertEquals(EnvironmentProvisioningState.SUCCEEDED, firstItem.getProvisioningState()); + // verify property "resourceGroupId" + Assertions.assertEquals("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg028321", + firstItem.getResourceGroupId()); + // verify property "catalogName" + Assertions.assertEquals("main", firstItem.getCatalogName()); + // verify property "environmentDefinitionName" + Assertions.assertEquals("helloworld", firstItem.getEnvironmentDefinitionName()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/RestartsADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/RestartsADevBoxTests.java new file mode 100644 index 0000000000000..c4f531a442aac --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/RestartsADevBoxTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class RestartsADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testRestartsADevBoxTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(devBoxesClient.beginRestartDevBox("myProject", "me", "MyDevBox")); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/SkipsAnOccurrenceOfAnActionTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/SkipsAnOccurrenceOfAnActionTests.java new file mode 100644 index 0000000000000..b8528d1801751 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/SkipsAnOccurrenceOfAnActionTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class SkipsAnOccurrenceOfAnActionTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testSkipsAnOccurrenceOfAnActionTests() { + // method invocation + devBoxesClient.skipAction("myProject", "me", "myDevBox", "schedule-default"); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/StartsADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/StartsADevBoxTests.java new file mode 100644 index 0000000000000..1c9962348fab5 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/StartsADevBoxTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class StartsADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testStartsADevBoxTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(devBoxesClient.beginStartDevBox("myProject", "me", "MyDevBox")); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/StopsADevBoxTests.java b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/StopsADevBoxTests.java new file mode 100644 index 0000000000000..3cf5ca37a4399 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/test/java/com/azure/developer/devcenter/generated/StopsADevBoxTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.devcenter.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.developer.devcenter.models.DevCenterOperationDetails; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class StopsADevBoxTests extends DevCenterClientTestBase { + @Test + @Disabled + public void testStopsADevBoxTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(devBoxesClient.beginStopDevBox("myProject", "me", "MyDevBox", true)); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/tsp-location.yaml b/sdk/devcenter/azure-developer-devcenter/tsp-location.yaml index 4d29665351fdf..f64359d9f1cc7 100644 --- a/sdk/devcenter/azure-developer-devcenter/tsp-location.yaml +++ b/sdk/devcenter/azure-developer-devcenter/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/devcenter/DevCenter -commit: df3cd3e3d50eec1d1da593750e1ea3a4db3f541d +commit: 3b8c84178a83aee82427a53917bf7de4dcc79181 repo: Azure/azure-rest-api-specs -cleanup: true +additionalDirectories: