diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/LabServicesManager.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/LabServicesManager.java deleted file mode 100644 index 6af095b4b54d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/LabServicesManager.java +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.LabServicesClient; -import com.azure.resourcemanager.labservices.implementation.ImagesImpl; -import com.azure.resourcemanager.labservices.implementation.LabPlansImpl; -import com.azure.resourcemanager.labservices.implementation.LabServicesClientBuilder; -import com.azure.resourcemanager.labservices.implementation.LabsImpl; -import com.azure.resourcemanager.labservices.implementation.OperationResultsImpl; -import com.azure.resourcemanager.labservices.implementation.OperationsImpl; -import com.azure.resourcemanager.labservices.implementation.SchedulesImpl; -import com.azure.resourcemanager.labservices.implementation.SkusImpl; -import com.azure.resourcemanager.labservices.implementation.UsagesImpl; -import com.azure.resourcemanager.labservices.implementation.UsersImpl; -import com.azure.resourcemanager.labservices.implementation.VirtualMachinesImpl; -import com.azure.resourcemanager.labservices.models.Images; -import com.azure.resourcemanager.labservices.models.LabPlans; -import com.azure.resourcemanager.labservices.models.Labs; -import com.azure.resourcemanager.labservices.models.OperationResults; -import com.azure.resourcemanager.labservices.models.Operations; -import com.azure.resourcemanager.labservices.models.Schedules; -import com.azure.resourcemanager.labservices.models.Skus; -import com.azure.resourcemanager.labservices.models.Usages; -import com.azure.resourcemanager.labservices.models.Users; -import com.azure.resourcemanager.labservices.models.VirtualMachines; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -/** Entry point to LabServicesManager. REST API for managing Azure Lab Services images. */ -public final class LabServicesManager { - private Images images; - - private LabPlans labPlans; - - private Operations operations; - - private Labs labs; - - private OperationResults operationResults; - - private Schedules schedules; - - private Users users; - - private VirtualMachines virtualMachines; - - private Usages usages; - - private Skus skus; - - private final LabServicesClient clientObject; - - private LabServicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new LabServicesClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of LabServices service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the LabServices service API instance. - */ - public static LabServicesManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Gets a Configurable instance that can be used to create LabServicesManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new LabServicesManager.Configurable(); - } - - /** The Configurable allowing configurations to be set. */ - public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of LabServices service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the LabServices service API instance. - */ - public LabServicesManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.labservices") - .append("/") - .append("1.0.0-beta.2"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new LabServicesManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** @return Resource collection API of Images. */ - public Images images() { - if (this.images == null) { - this.images = new ImagesImpl(clientObject.getImages(), this); - } - return images; - } - - /** @return Resource collection API of LabPlans. */ - public LabPlans labPlans() { - if (this.labPlans == null) { - this.labPlans = new LabPlansImpl(clientObject.getLabPlans(), this); - } - return labPlans; - } - - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** @return Resource collection API of Labs. */ - public Labs labs() { - if (this.labs == null) { - this.labs = new LabsImpl(clientObject.getLabs(), this); - } - return labs; - } - - /** @return Resource collection API of OperationResults. */ - public OperationResults operationResults() { - if (this.operationResults == null) { - this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); - } - return operationResults; - } - - /** @return Resource collection API of Schedules. */ - public Schedules schedules() { - if (this.schedules == null) { - this.schedules = new SchedulesImpl(clientObject.getSchedules(), this); - } - return schedules; - } - - /** @return Resource collection API of Users. */ - public Users users() { - if (this.users == null) { - this.users = new UsersImpl(clientObject.getUsers(), this); - } - return users; - } - - /** @return Resource collection API of VirtualMachines. */ - public VirtualMachines virtualMachines() { - if (this.virtualMachines == null) { - this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); - } - return virtualMachines; - } - - /** @return Resource collection API of Usages. */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); - } - return usages; - } - - /** @return Resource collection API of Skus. */ - public Skus skus() { - if (this.skus == null) { - this.skus = new SkusImpl(clientObject.getSkus(), this); - } - return skus; - } - - /** - * @return Wrapped service client LabServicesClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - */ - public LabServicesClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.java deleted file mode 100644 index d1a0b69aefd0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.ImageInner; -import com.azure.resourcemanager.labservices.models.ImageUpdate; - -/** An instance of this class provides access to all the operations defined in ImagesClient. */ -public interface ImagesClient { - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLabPlan(String resourceGroupName, String labPlanName); - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLabPlan( - String resourceGroupName, String labPlanName, String filter, Context context); - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner get(String resourceGroupName, String labPlanName, String imageName); - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labPlanName, String imageName, Context context); - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner createOrUpdate(String resourceGroupName, String labPlanName, String imageName, ImageInner body); - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String labPlanName, String imageName, ImageInner body, Context context); - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner update(String resourceGroupName, String labPlanName, String imageName, ImageUpdate body); - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String labPlanName, String imageName, ImageUpdate body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java deleted file mode 100644 index 885d63019a2a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; -import com.azure.resourcemanager.labservices.models.LabPlanUpdate; -import com.azure.resourcemanager.labservices.models.SaveImageBody; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LabPlansClient. */ -public interface LabPlansClient { - /** - * Returns a list of all lab plans within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabPlanInner getByResourceGroup(String resourceGroupName, String labPlanName); - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String labPlanName, Context context); - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabPlanInner> beginCreateOrUpdate( - String resourceGroupName, String labPlanName, LabPlanInner body); - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabPlanInner> beginCreateOrUpdate( - String resourceGroupName, String labPlanName, LabPlanInner body, Context context); - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body); - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body, Context context); - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabPlanInner> beginUpdate( - String resourceGroupName, String labPlanName, LabPlanUpdate body); - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabPlanInner> beginUpdate( - String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context); - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body); - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labPlanName); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labPlanName, Context context); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labPlanName); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labPlanName, Context context); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSaveImage(String resourceGroupName, String labPlanName, SaveImageBody body); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSaveImage( - String resourceGroupName, String labPlanName, SaveImageBody body, Context context); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabServicesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabServicesClient.java deleted file mode 100644 index 2e975aa8468e..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabServicesClient.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for LabServicesClient class. */ -public interface LabServicesClient { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the ImagesClient object to access its operations. - * - * @return the ImagesClient object. - */ - ImagesClient getImages(); - - /** - * Gets the LabPlansClient object to access its operations. - * - * @return the LabPlansClient object. - */ - LabPlansClient getLabPlans(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the LabsClient object to access its operations. - * - * @return the LabsClient object. - */ - LabsClient getLabs(); - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - OperationResultsClient getOperationResults(); - - /** - * Gets the SchedulesClient object to access its operations. - * - * @return the SchedulesClient object. - */ - SchedulesClient getSchedules(); - - /** - * Gets the UsersClient object to access its operations. - * - * @return the UsersClient object. - */ - UsersClient getUsers(); - - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. - */ - VirtualMachinesClient getVirtualMachines(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the SkusClient object to access its operations. - * - * @return the SkusClient object. - */ - SkusClient getSkus(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java deleted file mode 100644 index d819fa36278f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.LabUpdate; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LabsClient. */ -public interface LabsClient { - /** - * Returns a list of all labs for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner getByResourceGroup(String resourceGroupName, String labName); - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String labName, Context context); - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabInner> beginCreateOrUpdate( - String resourceGroupName, String labName, LabInner body); - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabInner> beginCreateOrUpdate( - String resourceGroupName, String labName, LabInner body, Context context); - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body); - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body, Context context); - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabInner> beginUpdate(String resourceGroupName, String labName, LabUpdate body); - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LabInner> beginUpdate( - String resourceGroupName, String labName, LabUpdate body, Context context); - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner update(String resourceGroupName, String labName, LabUpdate body); - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner update(String resourceGroupName, String labName, LabUpdate body, Context context); - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName); - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, Context context); - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName); - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, Context context); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginPublish(String resourceGroupName, String labName); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginPublish(String resourceGroupName, String labName, Context context); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void publish(String resourceGroupName, String labName); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void publish(String resourceGroupName, String labName, Context context); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSyncGroup(String resourceGroupName, String labName); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSyncGroup(String resourceGroupName, String labName, Context context); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncGroup(String resourceGroupName, String labName); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void syncGroup(String resourceGroupName, String labName, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.java deleted file mode 100644 index 8d7dd8fdd892..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; - -/** An instance of this class provides access to all the operations defined in OperationResultsClient. */ -public interface OperationResultsClient { - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultInner get(String operationResultId); - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String operationResultId, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java deleted file mode 100644 index e37b1ec85596..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Returns a list of all operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns a list of all operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.java deleted file mode 100644 index bb82b2b3785e..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; -import com.azure.resourcemanager.labservices.models.ScheduleUpdate; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SchedulesClient. */ -public interface SchedulesClient { - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLab(String resourceGroupName, String labName); - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner get(String resourceGroupName, String labName, String scheduleName); - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labName, String scheduleName, Context context); - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner createOrUpdate(String resourceGroupName, String labName, String scheduleName, ScheduleInner body); - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String labName, String scheduleName, ScheduleInner body, Context context); - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner update(String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body); - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body, Context context); - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String scheduleName); - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String labName, String scheduleName, Context context); - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String scheduleName); - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String scheduleName, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SkusClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SkusClient.java deleted file mode 100644 index 4d9138c2d824..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SkusClient.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; - -/** An instance of this class provides access to all the operations defined in SkusClient. */ -public interface SkusClient { - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.java deleted file mode 100644 index ffd2c7787ebb..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.UsageInner; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public interface UsagesClient { - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location); - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLocation(String location, String filter, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java deleted file mode 100644 index dbcf10a7f46f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.InviteBody; -import com.azure.resourcemanager.labservices.models.UserUpdate; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsersClient. */ -public interface UsersClient { - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLab(String resourceGroupName, String labName); - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner get(String resourceGroupName, String labName, String username); - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String labName, String username, Context context); - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, UserInner> beginCreateOrUpdate( - String resourceGroupName, String labName, String username, UserInner body); - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, UserInner> beginCreateOrUpdate( - String resourceGroupName, String labName, String username, UserInner body, Context context); - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner createOrUpdate(String resourceGroupName, String labName, String username, UserInner body); - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner createOrUpdate( - String resourceGroupName, String labName, String username, UserInner body, Context context); - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, UserInner> beginUpdate( - String resourceGroupName, String labName, String username, UserUpdate body); - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, UserInner> beginUpdate( - String resourceGroupName, String labName, String username, UserUpdate body, Context context); - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner update(String resourceGroupName, String labName, String username, UserUpdate body); - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserInner update(String resourceGroupName, String labName, String username, UserUpdate body, Context context); - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username); - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String labName, String username, Context context); - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username); - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labName, String username, Context context); - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginInvite( - String resourceGroupName, String labName, String username, InviteBody body); - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginInvite( - String resourceGroupName, String labName, String username, InviteBody body, Context context); - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void invite(String resourceGroupName, String labName, String username, InviteBody body); - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.java deleted file mode 100644 index c3e04ca40cb8..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.java +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.labservices.models.ResetPasswordBody; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ -public interface VirtualMachinesClient { - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLab(String resourceGroupName, String labName); - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByLab( - String resourceGroupName, String labName, String filter, Context context); - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner get(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart( - String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop( - String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginReimage( - String resourceGroupName, String labName, String virtualMachineName); - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginReimage( - String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void reimage(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRedeploy( - String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginResetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body); - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginResetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context); - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetPassword(String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body); - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void resetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.java deleted file mode 100644 index 163cd14ea210..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.OsState; -import com.azure.resourcemanager.labservices.models.OsType; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Lab services virtual machine image. */ -@Fluent -public final class ImageInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageInner.class); - - /* - * Metadata pertaining to creation and last modification of the image. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Image resource properties - */ - @JsonProperty(value = "properties", required = true) - private ImageProperties innerProperties = new ImageProperties(); - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the image. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Image resource properties. - * - * @return the innerProperties value. - */ - private ImageProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Current provisioning state of the image. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the displayName property: The image display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the description property: A description of the image. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the iconUrl property: URL of the image icon. - * - * @return the iconUrl value. - */ - public String iconUrl() { - return this.innerProperties() == null ? null : this.innerProperties().iconUrl(); - } - - /** - * Get the author property: The image author. - * - * @return the author value. - */ - public String author() { - return this.innerProperties() == null ? null : this.innerProperties().author(); - } - - /** - * Get the osType property: The OS Type of the image. - * - * @return the osType value. - */ - public OsType osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Get the plan property: The ID of marketplace plan associated with the image (optional). - * - * @return the plan value. - */ - public String plan() { - return this.innerProperties() == null ? null : this.innerProperties().plan(); - } - - /** - * Get the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted). - * - * @return the termsStatus value. - */ - public EnableState termsStatus() { - return this.innerProperties() == null ? null : this.innerProperties().termsStatus(); - } - - /** - * Get the offer property: The ID of an offer associated with the image. - * - * @return the offer value. - */ - public String offer() { - return this.innerProperties() == null ? null : this.innerProperties().offer(); - } - - /** - * Get the publisher property: The ID of the publisher of the image. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Get the sku property: The image SKU. - * - * @return the sku value. - */ - public String sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Get the version property: The image version. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the sharedGalleryId property: The ID for the image in the shared gallery. - * - * @return the sharedGalleryId value. - */ - public String sharedGalleryId() { - return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId(); - } - - /** - * Get the availableRegions property: The available regions of the image in the shared gallery. - * - * @return the availableRegions value. - */ - public List availableRegions() { - return this.innerProperties() == null ? null : this.innerProperties().availableRegions(); - } - - /** - * Set the availableRegions property: The available regions of the image in the shared gallery. - * - * @param availableRegions the availableRegions value to set. - * @return the ImageInner object itself. - */ - public ImageInner withAvailableRegions(List availableRegions) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withAvailableRegions(availableRegions); - return this; - } - - /** - * Get the osState property: The OS State of the image. - * - * @return the osState value. - */ - public OsState osState() { - return this.innerProperties() == null ? null : this.innerProperties().osState(); - } - - /** - * Get the enabledState property: Is the image enabled. - * - * @return the enabledState value. - */ - public EnableState enabledState() { - return this.innerProperties() == null ? null : this.innerProperties().enabledState(); - } - - /** - * Set the enabledState property: Is the image enabled. - * - * @param enabledState the enabledState value to set. - * @return the ImageInner object itself. - */ - public ImageInner withEnabledState(EnableState enabledState) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withEnabledState(enabledState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ImageInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.java deleted file mode 100644 index b22b947568c4..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.java +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.OsState; -import com.azure.resourcemanager.labservices.models.OsType; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of an image resource. */ -@Fluent -public final class ImageProperties extends ImageUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageProperties.class); - - /* - * Current provisioning state of the image. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The image display name. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * A description of the image. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * URL of the image icon. - */ - @JsonProperty(value = "iconUrl", access = JsonProperty.Access.WRITE_ONLY) - private String iconUrl; - - /* - * The image author. - */ - @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY) - private String author; - - /* - * The OS Type of the image. - */ - @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) - private OsType osType; - - /* - * The ID of marketplace plan associated with the image (optional). - */ - @JsonProperty(value = "plan", access = JsonProperty.Access.WRITE_ONLY) - private String plan; - - /* - * The status of image terms of use (enabled = accepted, disabled = not - * accepted). - */ - @JsonProperty(value = "termsStatus", access = JsonProperty.Access.WRITE_ONLY) - private EnableState termsStatus; - - /* - * The ID of an offer associated with the image. - */ - @JsonProperty(value = "offer", access = JsonProperty.Access.WRITE_ONLY) - private String offer; - - /* - * The ID of the publisher of the image. - */ - @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * The image SKU. - */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) - private String sku; - - /* - * The image version. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * The ID for the image in the shared gallery. - */ - @JsonProperty(value = "sharedGalleryId", access = JsonProperty.Access.WRITE_ONLY) - private String sharedGalleryId; - - /* - * The available regions of the image in the shared gallery. - */ - @JsonProperty(value = "availableRegions") - private List availableRegions; - - /* - * The OS State of the image. - */ - @JsonProperty(value = "osState", access = JsonProperty.Access.WRITE_ONLY) - private OsState osState; - - /** - * Get the provisioningState property: Current provisioning state of the image. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the displayName property: The image display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: A description of the image. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the iconUrl property: URL of the image icon. - * - * @return the iconUrl value. - */ - public String iconUrl() { - return this.iconUrl; - } - - /** - * Get the author property: The image author. - * - * @return the author value. - */ - public String author() { - return this.author; - } - - /** - * Get the osType property: The OS Type of the image. - * - * @return the osType value. - */ - public OsType osType() { - return this.osType; - } - - /** - * Get the plan property: The ID of marketplace plan associated with the image (optional). - * - * @return the plan value. - */ - public String plan() { - return this.plan; - } - - /** - * Get the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted). - * - * @return the termsStatus value. - */ - public EnableState termsStatus() { - return this.termsStatus; - } - - /** - * Get the offer property: The ID of an offer associated with the image. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Get the publisher property: The ID of the publisher of the image. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Get the sku property: The image SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Get the version property: The image version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the sharedGalleryId property: The ID for the image in the shared gallery. - * - * @return the sharedGalleryId value. - */ - public String sharedGalleryId() { - return this.sharedGalleryId; - } - - /** - * Get the availableRegions property: The available regions of the image in the shared gallery. - * - * @return the availableRegions value. - */ - public List availableRegions() { - return this.availableRegions; - } - - /** - * Set the availableRegions property: The available regions of the image in the shared gallery. - * - * @param availableRegions the availableRegions value to set. - * @return the ImageProperties object itself. - */ - public ImageProperties withAvailableRegions(List availableRegions) { - this.availableRegions = availableRegions; - return this; - } - - /** - * Get the osState property: The OS State of the image. - * - * @return the osState value. - */ - public OsState osState() { - return this.osState; - } - - /** {@inheritDoc} */ - @Override - public ImageProperties withEnabledState(EnableState enabledState) { - super.withEnabledState(enabledState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java deleted file mode 100644 index 2abbb7c65a1b..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of an image resource update. */ -@Fluent -public class ImageUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdateProperties.class); - - /* - * Is the image enabled - */ - @JsonProperty(value = "enabledState") - private EnableState enabledState; - - /** - * Get the enabledState property: Is the image enabled. - * - * @return the enabledState value. - */ - public EnableState enabledState() { - return this.enabledState; - } - - /** - * Set the enabledState property: Is the image enabled. - * - * @param enabledState the enabledState value to set. - * @return the ImageUpdateProperties object itself. - */ - public ImageUpdateProperties withEnabledState(EnableState enabledState) { - this.enabledState = enabledState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java deleted file mode 100644 index 7a1883ad2563..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.LabNetworkProfile; -import com.azure.resourcemanager.labservices.models.LabState; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RosterProfile; -import com.azure.resourcemanager.labservices.models.SecurityProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The lab resource. */ -@Fluent -public final class LabInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabInner.class); - - /* - * Metadata pertaining to creation and last modification of the lab. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Lab resource properties - */ - @JsonProperty(value = "properties", required = true) - private LabProperties innerProperties = new LabProperties(); - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the lab. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Lab resource properties. - * - * @return the innerProperties value. - */ - private LabProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public LabInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: Current provisioning state of the lab. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile - * cannot be modified once a lab has been created. - * - * @return the networkProfile value. - */ - public LabNetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile - * cannot be modified once a lab has been created. - * - * @param networkProfile the networkProfile value to set. - * @return the LabInner object itself. - */ - public LabInner withNetworkProfile(LabNetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the state property: The lab state. - * - * @return the state value. - */ - public LabState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * - * @return the autoShutdownProfile value. - */ - public AutoShutdownProfile autoShutdownProfile() { - return this.innerProperties() == null ? null : this.innerProperties().autoShutdownProfile(); - } - - /** - * Set the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * - * @param autoShutdownProfile the autoShutdownProfile value to set. - * @return the LabInner object itself. - */ - public LabInner withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withAutoShutdownProfile(autoShutdownProfile); - return this; - } - - /** - * Get the connectionProfile property: The connection profile for the lab. This controls settings such as web access - * to lab resources or whether RDP or SSH ports are open. - * - * @return the connectionProfile value. - */ - public ConnectionProfile connectionProfile() { - return this.innerProperties() == null ? null : this.innerProperties().connectionProfile(); - } - - /** - * Set the connectionProfile property: The connection profile for the lab. This controls settings such as web access - * to lab resources or whether RDP or SSH ports are open. - * - * @param connectionProfile the connectionProfile value to set. - * @return the LabInner object itself. - */ - public LabInner withConnectionProfile(ConnectionProfile connectionProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withConnectionProfile(connectionProfile); - return this; - } - - /** - * Get the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineProfile virtualMachineProfile() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineProfile(); - } - - /** - * Set the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the LabInner object itself. - */ - public LabInner withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withVirtualMachineProfile(virtualMachineProfile); - return this; - } - - /** - * Get the securityProfile property: The lab security profile. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); - } - - /** - * Set the securityProfile property: The lab security profile. - * - * @param securityProfile the securityProfile value to set. - * @return the LabInner object itself. - */ - public LabInner withSecurityProfile(SecurityProfile securityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withSecurityProfile(securityProfile); - return this; - } - - /** - * Get the rosterProfile property: The lab user list management profile. - * - * @return the rosterProfile value. - */ - public RosterProfile rosterProfile() { - return this.innerProperties() == null ? null : this.innerProperties().rosterProfile(); - } - - /** - * Set the rosterProfile property: The lab user list management profile. - * - * @param rosterProfile the rosterProfile value to set. - * @return the LabInner object itself. - */ - public LabInner withRosterProfile(RosterProfile rosterProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withRosterProfile(rosterProfile); - return this; - } - - /** - * Get the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as - * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @return the labPlanId value. - */ - public String labPlanId() { - return this.innerProperties() == null ? null : this.innerProperties().labPlanId(); - } - - /** - * Set the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as - * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @param labPlanId the labPlanId value to set. - * @return the LabInner object itself. - */ - public LabInner withLabPlanId(String labPlanId) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withLabPlanId(labPlanId); - return this; - } - - /** - * Get the title property: The title of the lab. - * - * @return the title value. - */ - public String title() { - return this.innerProperties() == null ? null : this.innerProperties().title(); - } - - /** - * Set the title property: The title of the lab. - * - * @param title the title value to set. - * @return the LabInner object itself. - */ - public LabInner withTitle(String title) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withTitle(title); - return this; - } - - /** - * Get the description property: The description of the lab. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of the lab. - * - * @param description the description value to set. - * @return the LabInner object itself. - */ - public LabInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new LabProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model LabInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.java deleted file mode 100644 index d2173a69a536..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.SupportInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** - * Lab Plans act as a permission container for creating labs via labs.azure.com. Additionally, they can provide a set of - * default configurations that will apply at the time of creating a lab, but these defaults can still be overwritten. - */ -@Fluent -public final class LabPlanInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanInner.class); - - /* - * Metadata pertaining to creation and last modification of the lab plan. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Lab plan resource properties - */ - @JsonProperty(value = "properties", required = true) - private LabPlanProperties innerProperties = new LabPlanProperties(); - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the lab plan. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Lab plan resource properties. - * - * @return the innerProperties value. - */ - private LabPlanProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public LabPlanInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: Current provisioning state of the lab plan. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultConnectionProfile value. - */ - public ConnectionProfile defaultConnectionProfile() { - return this.innerProperties() == null ? null : this.innerProperties().defaultConnectionProfile(); - } - - /** - * Set the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @param defaultConnectionProfile the defaultConnectionProfile value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withDefaultConnectionProfile(defaultConnectionProfile); - return this; - } - - /** - * Get the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultAutoShutdownProfile value. - */ - public AutoShutdownProfile defaultAutoShutdownProfile() { - return this.innerProperties() == null ? null : this.innerProperties().defaultAutoShutdownProfile(); - } - - /** - * Set the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @param defaultAutoShutdownProfile the defaultAutoShutdownProfile value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); - return this; - } - - /** - * Get the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @return the defaultNetworkProfile value. - */ - public LabPlanNetworkProfile defaultNetworkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().defaultNetworkProfile(); - } - - /** - * Set the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @param defaultNetworkProfile the defaultNetworkProfile value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withDefaultNetworkProfile(defaultNetworkProfile); - return this; - } - - /** - * Get the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * - * @return the allowedRegions value. - */ - public List allowedRegions() { - return this.innerProperties() == null ? null : this.innerProperties().allowedRegions(); - } - - /** - * Set the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * - * @param allowedRegions the allowedRegions value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withAllowedRegions(List allowedRegions) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withAllowedRegions(allowedRegions); - return this; - } - - /** - * Get the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @return the sharedGalleryId value. - */ - public String sharedGalleryId() { - return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId(); - } - - /** - * Set the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @param sharedGalleryId the sharedGalleryId value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withSharedGalleryId(String sharedGalleryId) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withSharedGalleryId(sharedGalleryId); - return this; - } - - /** - * Get the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @return the supportInfo value. - */ - public SupportInfo supportInfo() { - return this.innerProperties() == null ? null : this.innerProperties().supportInfo(); - } - - /** - * Set the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @param supportInfo the supportInfo value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withSupportInfo(SupportInfo supportInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withSupportInfo(supportInfo); - return this; - } - - /** - * Get the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @return the linkedLmsInstance value. - */ - public String linkedLmsInstance() { - return this.innerProperties() == null ? null : this.innerProperties().linkedLmsInstance(); - } - - /** - * Set the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @param linkedLmsInstance the linkedLmsInstance value to set. - * @return the LabPlanInner object itself. - */ - public LabPlanInner withLinkedLmsInstance(String linkedLmsInstance) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanProperties(); - } - this.innerProperties().withLinkedLmsInstance(linkedLmsInstance); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model LabPlanInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java deleted file mode 100644 index 838570cc5465..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.SupportInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Lab plan resource properties. */ -@Fluent -public final class LabPlanProperties extends LabPlanUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanProperties.class); - - /* - * Current provisioning state of the lab plan. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the provisioningState property: Current provisioning state of the lab plan. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { - super.withDefaultConnectionProfile(defaultConnectionProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { - super.withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { - super.withDefaultNetworkProfile(defaultNetworkProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withAllowedRegions(List allowedRegions) { - super.withAllowedRegions(allowedRegions); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withSharedGalleryId(String sharedGalleryId) { - super.withSharedGalleryId(sharedGalleryId); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withSupportInfo(SupportInfo supportInfo) { - super.withSupportInfo(supportInfo); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabPlanProperties withLinkedLmsInstance(String linkedLmsInstance) { - super.withLinkedLmsInstance(linkedLmsInstance); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java deleted file mode 100644 index 1518ebb7c997..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; -import com.azure.resourcemanager.labservices.models.SupportInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Lab plan resource properties for updates. */ -@Fluent -public class LabPlanUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanUpdateProperties.class); - - /* - * The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - */ - @JsonProperty(value = "defaultConnectionProfile") - private ConnectionProfile defaultConnectionProfile; - - /* - * The default lab shutdown profile. This can be changed on a lab resource - * and only provides a default profile. - */ - @JsonProperty(value = "defaultAutoShutdownProfile") - private AutoShutdownProfile defaultAutoShutdownProfile; - - /* - * The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs - * associated with this lab plan. - */ - @JsonProperty(value = "defaultNetworkProfile") - private LabPlanNetworkProfile defaultNetworkProfile; - - /* - * The allowed regions for the lab creator to use when creating labs using - * this lab plan. - */ - @JsonProperty(value = "allowedRegions") - private List allowedRegions; - - /* - * Resource ID of the Shared Image Gallery attached to this lab plan. When - * saving a lab template virtual machine image it will be persisted in this - * gallery. Shared images from the gallery can be made available to use - * when creating new labs. - */ - @JsonProperty(value = "sharedGalleryId") - private String sharedGalleryId; - - /* - * Support contact information and instructions for users of the lab plan. - * This information is displayed to lab owners and virtual machine users - * for all labs in the lab plan. - */ - @JsonProperty(value = "supportInfo") - private SupportInfo supportInfo; - - /* - * Base Url of the lms instance this lab plan can link lab rosters against. - */ - @JsonProperty(value = "linkedLmsInstance") - private String linkedLmsInstance; - - /** - * Get the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultConnectionProfile value. - */ - public ConnectionProfile defaultConnectionProfile() { - return this.defaultConnectionProfile; - } - - /** - * Set the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @param defaultConnectionProfile the defaultConnectionProfile value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { - this.defaultConnectionProfile = defaultConnectionProfile; - return this; - } - - /** - * Get the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultAutoShutdownProfile value. - */ - public AutoShutdownProfile defaultAutoShutdownProfile() { - return this.defaultAutoShutdownProfile; - } - - /** - * Set the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @param defaultAutoShutdownProfile the defaultAutoShutdownProfile value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { - this.defaultAutoShutdownProfile = defaultAutoShutdownProfile; - return this; - } - - /** - * Get the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @return the defaultNetworkProfile value. - */ - public LabPlanNetworkProfile defaultNetworkProfile() { - return this.defaultNetworkProfile; - } - - /** - * Set the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @param defaultNetworkProfile the defaultNetworkProfile value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { - this.defaultNetworkProfile = defaultNetworkProfile; - return this; - } - - /** - * Get the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * - * @return the allowedRegions value. - */ - public List allowedRegions() { - return this.allowedRegions; - } - - /** - * Set the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * - * @param allowedRegions the allowedRegions value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withAllowedRegions(List allowedRegions) { - this.allowedRegions = allowedRegions; - return this; - } - - /** - * Get the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @return the sharedGalleryId value. - */ - public String sharedGalleryId() { - return this.sharedGalleryId; - } - - /** - * Set the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @param sharedGalleryId the sharedGalleryId value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withSharedGalleryId(String sharedGalleryId) { - this.sharedGalleryId = sharedGalleryId; - return this; - } - - /** - * Get the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @return the supportInfo value. - */ - public SupportInfo supportInfo() { - return this.supportInfo; - } - - /** - * Set the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @param supportInfo the supportInfo value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withSupportInfo(SupportInfo supportInfo) { - this.supportInfo = supportInfo; - return this; - } - - /** - * Get the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @return the linkedLmsInstance value. - */ - public String linkedLmsInstance() { - return this.linkedLmsInstance; - } - - /** - * Set the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @param linkedLmsInstance the linkedLmsInstance value to set. - * @return the LabPlanUpdateProperties object itself. - */ - public LabPlanUpdateProperties withLinkedLmsInstance(String linkedLmsInstance) { - this.linkedLmsInstance = linkedLmsInstance; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (defaultConnectionProfile() != null) { - defaultConnectionProfile().validate(); - } - if (defaultAutoShutdownProfile() != null) { - defaultAutoShutdownProfile().validate(); - } - if (defaultNetworkProfile() != null) { - defaultNetworkProfile().validate(); - } - if (supportInfo() != null) { - supportInfo().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.java deleted file mode 100644 index c081d888fb97..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.LabNetworkProfile; -import com.azure.resourcemanager.labservices.models.LabState; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RosterProfile; -import com.azure.resourcemanager.labservices.models.SecurityProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of a lab resource. */ -@Fluent -public final class LabProperties extends LabUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabProperties.class); - - /* - * Current provisioning state of the lab. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The network profile for the lab, typically applied via a lab plan. This - * profile cannot be modified once a lab has been created. - */ - @JsonProperty(value = "networkProfile") - private LabNetworkProfile networkProfile; - - /* - * The lab state. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private LabState state; - - /** - * Get the provisioningState property: Current provisioning state of the lab. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile - * cannot be modified once a lab has been created. - * - * @return the networkProfile value. - */ - public LabNetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile - * cannot be modified once a lab has been created. - * - * @param networkProfile the networkProfile value to set. - * @return the LabProperties object itself. - */ - public LabProperties withNetworkProfile(LabNetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the state property: The lab state. - * - * @return the state value. - */ - public LabState state() { - return this.state; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { - super.withAutoShutdownProfile(autoShutdownProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withConnectionProfile(ConnectionProfile connectionProfile) { - super.withConnectionProfile(connectionProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { - super.withVirtualMachineProfile(virtualMachineProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withSecurityProfile(SecurityProfile securityProfile) { - super.withSecurityProfile(securityProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withRosterProfile(RosterProfile rosterProfile) { - super.withRosterProfile(rosterProfile); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withLabPlanId(String labPlanId) { - super.withLabPlanId(labPlanId); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withTitle(String title) { - super.withTitle(title); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (networkProfile() != null) { - networkProfile().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.java deleted file mode 100644 index a3c61eb421f3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.LabServicesSkuCapabilities; -import com.azure.resourcemanager.labservices.models.LabServicesSkuCapacity; -import com.azure.resourcemanager.labservices.models.LabServicesSkuCost; -import com.azure.resourcemanager.labservices.models.LabServicesSkuRestrictions; -import com.azure.resourcemanager.labservices.models.LabServicesSkuTier; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Azure Lab Services resource SKUs. */ -@Fluent -public final class LabServicesSkuInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuInner.class); - - /* - * The lab services resource type. - */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) - private String resourceType; - - /* - * The name of the SKU. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The tier of the SKU. - */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) - private LabServicesSkuTier tier; - - /* - * The SKU size. - */ - @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) - private String size; - - /* - * The family of the SKU. - */ - @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) - private String family; - - /* - * The scale out/in options of the SKU. - */ - @JsonProperty(value = "capacity") - private LabServicesSkuCapacity capacity; - - /* - * The capabilities of the SKU. - */ - @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) - private List capabilities; - - /* - * List of locations that are available for a size. - */ - @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) - private List locations; - - /* - * Metadata for retrieving price info of a lab services SKUs. - */ - @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) - private List costs; - - /* - * Restrictions of a lab services SKUs. - */ - @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) - private List restrictions; - - /** - * Get the resourceType property: The lab services resource type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the name property: The name of the SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the tier property: The tier of the SKU. - * - * @return the tier value. - */ - public LabServicesSkuTier tier() { - return this.tier; - } - - /** - * Get the size property: The SKU size. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Get the family property: The family of the SKU. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Get the capacity property: The scale out/in options of the SKU. - * - * @return the capacity value. - */ - public LabServicesSkuCapacity capacity() { - return this.capacity; - } - - /** - * Set the capacity property: The scale out/in options of the SKU. - * - * @param capacity the capacity value to set. - * @return the LabServicesSkuInner object itself. - */ - public LabServicesSkuInner withCapacity(LabServicesSkuCapacity capacity) { - this.capacity = capacity; - return this; - } - - /** - * Get the capabilities property: The capabilities of the SKU. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Get the locations property: List of locations that are available for a size. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the costs property: Metadata for retrieving price info of a lab services SKUs. - * - * @return the costs value. - */ - public List costs() { - return this.costs; - } - - /** - * Get the restrictions property: Restrictions of a lab services SKUs. - * - * @return the restrictions value. - */ - public List restrictions() { - return this.restrictions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capacity() != null) { - capacity().validate(); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - if (costs() != null) { - costs().forEach(e -> e.validate()); - } - if (restrictions() != null) { - restrictions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.java deleted file mode 100644 index 57e9626b758a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.RosterProfile; -import com.azure.resourcemanager.labservices.models.SecurityProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of a lab resource used for updates. */ -@Fluent -public class LabUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabUpdateProperties.class); - - /* - * The resource auto shutdown configuration for the lab. This controls - * whether actions are taken on resources that are sitting idle. - */ - @JsonProperty(value = "autoShutdownProfile") - private AutoShutdownProfile autoShutdownProfile; - - /* - * The connection profile for the lab. This controls settings such as web - * access to lab resources or whether RDP or SSH ports are open. - */ - @JsonProperty(value = "connectionProfile") - private ConnectionProfile connectionProfile; - - /* - * The profile used for creating lab virtual machines. - */ - @JsonProperty(value = "virtualMachineProfile") - private VirtualMachineProfile virtualMachineProfile; - - /* - * The lab security profile. - */ - @JsonProperty(value = "securityProfile") - private SecurityProfile securityProfile; - - /* - * The lab user list management profile. - */ - @JsonProperty(value = "rosterProfile") - private RosterProfile rosterProfile; - - /* - * The ID of the lab plan. Used during resource creation to provide - * defaults and acts as a permission container when creating a lab via - * labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - */ - @JsonProperty(value = "labPlanId") - private String labPlanId; - - /* - * The title of the lab. - */ - @JsonProperty(value = "title") - private String title; - - /* - * The description of the lab. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * - * @return the autoShutdownProfile value. - */ - public AutoShutdownProfile autoShutdownProfile() { - return this.autoShutdownProfile; - } - - /** - * Set the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * - * @param autoShutdownProfile the autoShutdownProfile value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { - this.autoShutdownProfile = autoShutdownProfile; - return this; - } - - /** - * Get the connectionProfile property: The connection profile for the lab. This controls settings such as web access - * to lab resources or whether RDP or SSH ports are open. - * - * @return the connectionProfile value. - */ - public ConnectionProfile connectionProfile() { - return this.connectionProfile; - } - - /** - * Set the connectionProfile property: The connection profile for the lab. This controls settings such as web access - * to lab resources or whether RDP or SSH ports are open. - * - * @param connectionProfile the connectionProfile value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withConnectionProfile(ConnectionProfile connectionProfile) { - this.connectionProfile = connectionProfile; - return this; - } - - /** - * Get the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineProfile virtualMachineProfile() { - return this.virtualMachineProfile; - } - - /** - * Set the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { - this.virtualMachineProfile = virtualMachineProfile; - return this; - } - - /** - * Get the securityProfile property: The lab security profile. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.securityProfile; - } - - /** - * Set the securityProfile property: The lab security profile. - * - * @param securityProfile the securityProfile value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withSecurityProfile(SecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - - /** - * Get the rosterProfile property: The lab user list management profile. - * - * @return the rosterProfile value. - */ - public RosterProfile rosterProfile() { - return this.rosterProfile; - } - - /** - * Set the rosterProfile property: The lab user list management profile. - * - * @param rosterProfile the rosterProfile value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withRosterProfile(RosterProfile rosterProfile) { - this.rosterProfile = rosterProfile; - return this; - } - - /** - * Get the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as - * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @return the labPlanId value. - */ - public String labPlanId() { - return this.labPlanId; - } - - /** - * Set the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as - * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @param labPlanId the labPlanId value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withLabPlanId(String labPlanId) { - this.labPlanId = labPlanId; - return this; - } - - /** - * Get the title property: The title of the lab. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: The title of the lab. - * - * @param title the title value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the description property: The description of the lab. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the lab. - * - * @param description the description value to set. - * @return the LabUpdateProperties object itself. - */ - public LabUpdateProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (autoShutdownProfile() != null) { - autoShutdownProfile().validate(); - } - if (connectionProfile() != null) { - connectionProfile().validate(); - } - if (virtualMachineProfile() != null) { - virtualMachineProfile().validate(); - } - if (securityProfile() != null) { - securityProfile().validate(); - } - if (rosterProfile() != null) { - rosterProfile().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java deleted file mode 100644 index 6ed316ad2457..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.ActionType; -import com.azure.resourcemanager.labservices.models.OperationDisplay; -import com.azure.resourcemanager.labservices.models.Origin; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for - * data-plane operations and "false" for ARM/control-plane operations. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access - * Control (RBAC) and audit logs UX. Default value is "user,system" - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) - private ActionType actionType; - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java deleted file mode 100644 index f87735fbf465..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.OperationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A long running operation result. */ -@Fluent -public final class OperationResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInner.class); - - /* - * Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The name of the resource - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The operation status - */ - @JsonProperty(value = "status", required = true) - private OperationStatus status; - - /* - * Start time - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * End time - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * Percent completion - */ - @JsonProperty(value = "percentComplete") - private Float percentComplete; - - /* - * The error for a failure if the operation failed. - */ - @JsonProperty(value = "error") - private ManagementError error; - - /** - * Get the id property: Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the status property: The operation status. - * - * @return the status value. - */ - public OperationStatus status() { - return this.status; - } - - /** - * Set the status property: The operation status. - * - * @param status the status value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withStatus(OperationStatus status) { - this.status = status; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: Start time. - * - * @param startTime the startTime value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: End time. - * - * @param endTime the endTime value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the percentComplete property: Percent completion. - * - * @return the percentComplete value. - */ - public Float percentComplete() { - return this.percentComplete; - } - - /** - * Set the percentComplete property: Percent completion. - * - * @param percentComplete the percentComplete value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withPercentComplete(Float percentComplete) { - this.percentComplete = percentComplete; - return this; - } - - /** - * Get the error property: The error for a failure if the operation failed. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: The error for a failure if the operation failed. - * - * @param error the error value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property status in model OperationResultInner")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.java deleted file mode 100644 index 343df0cfd305..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RecurrencePattern; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Schedule for automatically turning virtual machines in a lab on and off at specified times. */ -@Fluent -public final class ScheduleInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleInner.class); - - /* - * Metadata pertaining to creation and last modification of the schedule. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Schedule resource properties - */ - @JsonProperty(value = "properties", required = true) - private ScheduleProperties innerProperties = new ScheduleProperties(); - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the schedule. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Schedule resource properties. - * - * @return the innerProperties value. - */ - private ScheduleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Current provisioning state of the schedule. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the startAt value. - */ - public OffsetDateTime startAt() { - return this.innerProperties() == null ? null : this.innerProperties().startAt(); - } - - /** - * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @param startAt the startAt value to set. - * @return the ScheduleInner object itself. - */ - public ScheduleInner withStartAt(OffsetDateTime startAt) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleProperties(); - } - this.innerProperties().withStartAt(startAt); - return this; - } - - /** - * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the stopAt value. - */ - public OffsetDateTime stopAt() { - return this.innerProperties() == null ? null : this.innerProperties().stopAt(); - } - - /** - * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @param stopAt the stopAt value to set. - * @return the ScheduleInner object itself. - */ - public ScheduleInner withStopAt(OffsetDateTime stopAt) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleProperties(); - } - this.innerProperties().withStopAt(stopAt); - return this; - } - - /** - * Get the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @return the recurrencePattern value. - */ - public RecurrencePattern recurrencePattern() { - return this.innerProperties() == null ? null : this.innerProperties().recurrencePattern(); - } - - /** - * Set the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @param recurrencePattern the recurrencePattern value to set. - * @return the ScheduleInner object itself. - */ - public ScheduleInner withRecurrencePattern(RecurrencePattern recurrencePattern) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleProperties(); - } - this.innerProperties().withRecurrencePattern(recurrencePattern); - return this; - } - - /** - * Get the timeZoneId property: The IANA timezone id for the schedule. - * - * @return the timeZoneId value. - */ - public String timeZoneId() { - return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); - } - - /** - * Set the timeZoneId property: The IANA timezone id for the schedule. - * - * @param timeZoneId the timeZoneId value to set. - * @return the ScheduleInner object itself. - */ - public ScheduleInner withTimeZoneId(String timeZoneId) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleProperties(); - } - this.innerProperties().withTimeZoneId(timeZoneId); - return this; - } - - /** - * Get the notes property: Notes for this schedule. - * - * @return the notes value. - */ - public String notes() { - return this.innerProperties() == null ? null : this.innerProperties().notes(); - } - - /** - * Set the notes property: Notes for this schedule. - * - * @param notes the notes value to set. - * @return the ScheduleInner object itself. - */ - public ScheduleInner withNotes(String notes) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleProperties(); - } - this.innerProperties().withNotes(notes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ScheduleInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java deleted file mode 100644 index 2768dd30887e..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RecurrencePattern; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Schedule resource properties. */ -@Fluent -public final class ScheduleProperties extends ScheduleUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleProperties.class); - - /* - * Current provisioning state of the schedule. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the provisioningState property: Current provisioning state of the schedule. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public ScheduleProperties withStartAt(OffsetDateTime startAt) { - super.withStartAt(startAt); - return this; - } - - /** {@inheritDoc} */ - @Override - public ScheduleProperties withStopAt(OffsetDateTime stopAt) { - super.withStopAt(stopAt); - return this; - } - - /** {@inheritDoc} */ - @Override - public ScheduleProperties withRecurrencePattern(RecurrencePattern recurrencePattern) { - super.withRecurrencePattern(recurrencePattern); - return this; - } - - /** {@inheritDoc} */ - @Override - public ScheduleProperties withTimeZoneId(String timeZoneId) { - super.withTimeZoneId(timeZoneId); - return this; - } - - /** {@inheritDoc} */ - @Override - public ScheduleProperties withNotes(String notes) { - super.withNotes(notes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java deleted file mode 100644 index a992a75361c8..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.RecurrencePattern; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Schedule resource properties used for updates. */ -@Fluent -public class ScheduleUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleUpdateProperties.class); - - /* - * When lab user virtual machines will be started. Timestamp offsets will - * be ignored and timeZoneId is used instead. - */ - @JsonProperty(value = "startAt") - private OffsetDateTime startAt; - - /* - * When lab user virtual machines will be stopped. Timestamp offsets will - * be ignored and timeZoneId is used instead. - */ - @JsonProperty(value = "stopAt") - private OffsetDateTime stopAt; - - /* - * The recurrence pattern of the scheduled actions. - */ - @JsonProperty(value = "recurrencePattern") - private RecurrencePattern recurrencePattern; - - /* - * The IANA timezone id for the schedule. - */ - @JsonProperty(value = "timeZoneId") - private String timeZoneId; - - /* - * Notes for this schedule. - */ - @JsonProperty(value = "notes") - private String notes; - - /** - * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the startAt value. - */ - public OffsetDateTime startAt() { - return this.startAt; - } - - /** - * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @param startAt the startAt value to set. - * @return the ScheduleUpdateProperties object itself. - */ - public ScheduleUpdateProperties withStartAt(OffsetDateTime startAt) { - this.startAt = startAt; - return this; - } - - /** - * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the stopAt value. - */ - public OffsetDateTime stopAt() { - return this.stopAt; - } - - /** - * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @param stopAt the stopAt value to set. - * @return the ScheduleUpdateProperties object itself. - */ - public ScheduleUpdateProperties withStopAt(OffsetDateTime stopAt) { - this.stopAt = stopAt; - return this; - } - - /** - * Get the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @return the recurrencePattern value. - */ - public RecurrencePattern recurrencePattern() { - return this.recurrencePattern; - } - - /** - * Set the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @param recurrencePattern the recurrencePattern value to set. - * @return the ScheduleUpdateProperties object itself. - */ - public ScheduleUpdateProperties withRecurrencePattern(RecurrencePattern recurrencePattern) { - this.recurrencePattern = recurrencePattern; - return this; - } - - /** - * Get the timeZoneId property: The IANA timezone id for the schedule. - * - * @return the timeZoneId value. - */ - public String timeZoneId() { - return this.timeZoneId; - } - - /** - * Set the timeZoneId property: The IANA timezone id for the schedule. - * - * @param timeZoneId the timeZoneId value to set. - * @return the ScheduleUpdateProperties object itself. - */ - public ScheduleUpdateProperties withTimeZoneId(String timeZoneId) { - this.timeZoneId = timeZoneId; - return this; - } - - /** - * Get the notes property: Notes for this schedule. - * - * @return the notes value. - */ - public String notes() { - return this.notes; - } - - /** - * Set the notes property: Notes for this schedule. - * - * @param notes the notes value to set. - * @return the ScheduleUpdateProperties object itself. - */ - public ScheduleUpdateProperties withNotes(String notes) { - this.notes = notes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recurrencePattern() != null) { - recurrencePattern().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java deleted file mode 100644 index e7894554ae57..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.UsageName; -import com.azure.resourcemanager.labservices.models.UsageUnit; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The core usage details. */ -@Fluent -public final class UsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); - - /* - * The current usage. - */ - @JsonProperty(value = "currentValue") - private Long currentValue; - - /* - * The limit integer. - */ - @JsonProperty(value = "limit") - private Long limit; - - /* - * The unit details. - */ - @JsonProperty(value = "unit") - private UsageUnit unit; - - /* - * The name. - */ - @JsonProperty(value = "name") - private UsageName name; - - /* - * The fully qualified arm resource id. - */ - @JsonProperty(value = "id") - private String id; - - /** - * Get the currentValue property: The current usage. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Set the currentValue property: The current usage. - * - * @param currentValue the currentValue value to set. - * @return the UsageInner object itself. - */ - public UsageInner withCurrentValue(Long currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the limit property: The limit integer. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: The limit integer. - * - * @param limit the limit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the unit property: The unit details. - * - * @return the unit value. - */ - public UsageUnit unit() { - return this.unit; - } - - /** - * Set the unit property: The unit details. - * - * @param unit the unit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withUnit(UsageUnit unit) { - this.unit = unit; - return this; - } - - /** - * Get the name property: The name. - * - * @return the name value. - */ - public UsageName name() { - return this.name; - } - - /** - * Set the name property: The name. - * - * @param name the name value to set. - * @return the UsageInner object itself. - */ - public UsageInner withName(UsageName name) { - this.name = name; - return this; - } - - /** - * Get the id property: The fully qualified arm resource id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The fully qualified arm resource id. - * - * @param id the id value to set. - * @return the UsageInner object itself. - */ - public UsageInner withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java deleted file mode 100644 index 9322e780b732..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.InvitationState; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RegistrationState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; - -/** User of a lab that can register for and use virtual machines within the lab. */ -@Fluent -public final class UserInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); - - /* - * Metadata pertaining to creation and last modification of the user - * resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * User resource properties - */ - @JsonProperty(value = "properties", required = true) - private UserProperties innerProperties = new UserProperties(); - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the user resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: User resource properties. - * - * @return the innerProperties value. - */ - private UserProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Current provisioning state of the user resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the displayName property: Display name of the user, for example user's full name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the email property: Email address of the user. - * - * @return the email value. - */ - public String email() { - return this.innerProperties() == null ? null : this.innerProperties().email(); - } - - /** - * Set the email property: Email address of the user. - * - * @param email the email value to set. - * @return the UserInner object itself. - */ - public UserInner withEmail(String email) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withEmail(email); - return this; - } - - /** - * Get the registrationState property: State of the user's registration within the lab. - * - * @return the registrationState value. - */ - public RegistrationState registrationState() { - return this.innerProperties() == null ? null : this.innerProperties().registrationState(); - } - - /** - * Get the invitationState property: State of the invitation message for the user. - * - * @return the invitationState value. - */ - public InvitationState invitationState() { - return this.innerProperties() == null ? null : this.innerProperties().invitationState(); - } - - /** - * Get the invitationSent property: Date and time when the invitation message was sent to the user. - * - * @return the invitationSent value. - */ - public OffsetDateTime invitationSent() { - return this.innerProperties() == null ? null : this.innerProperties().invitationSent(); - } - - /** - * Get the totalUsage property: How long the user has used their virtual machines in this lab. - * - * @return the totalUsage value. - */ - public Duration totalUsage() { - return this.innerProperties() == null ? null : this.innerProperties().totalUsage(); - } - - /** - * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @return the additionalUsageQuota value. - */ - public Duration additionalUsageQuota() { - return this.innerProperties() == null ? null : this.innerProperties().additionalUsageQuota(); - } - - /** - * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @param additionalUsageQuota the additionalUsageQuota value to set. - * @return the UserInner object itself. - */ - public UserInner withAdditionalUsageQuota(Duration additionalUsageQuota) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withAdditionalUsageQuota(additionalUsageQuota); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model UserInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java deleted file mode 100644 index 47c2601fe706..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.InvitationState; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RegistrationState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; - -/** User resource properties. */ -@Fluent -public final class UserProperties extends UserUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserProperties.class); - - /* - * Current provisioning state of the user resource. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Display name of the user, for example user's full name. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Email address of the user. - */ - @JsonProperty(value = "email", required = true) - private String email; - - /* - * State of the user's registration within the lab. - */ - @JsonProperty(value = "registrationState", access = JsonProperty.Access.WRITE_ONLY) - private RegistrationState registrationState; - - /* - * State of the invitation message for the user. - */ - @JsonProperty(value = "invitationState", access = JsonProperty.Access.WRITE_ONLY) - private InvitationState invitationState; - - /* - * Date and time when the invitation message was sent to the user. - */ - @JsonProperty(value = "invitationSent", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime invitationSent; - - /* - * How long the user has used their virtual machines in this lab. - */ - @JsonProperty(value = "totalUsage", access = JsonProperty.Access.WRITE_ONLY) - private Duration totalUsage; - - /** - * Get the provisioningState property: Current provisioning state of the user resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the displayName property: Display name of the user, for example user's full name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the email property: Email address of the user. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Set the email property: Email address of the user. - * - * @param email the email value to set. - * @return the UserProperties object itself. - */ - public UserProperties withEmail(String email) { - this.email = email; - return this; - } - - /** - * Get the registrationState property: State of the user's registration within the lab. - * - * @return the registrationState value. - */ - public RegistrationState registrationState() { - return this.registrationState; - } - - /** - * Get the invitationState property: State of the invitation message for the user. - * - * @return the invitationState value. - */ - public InvitationState invitationState() { - return this.invitationState; - } - - /** - * Get the invitationSent property: Date and time when the invitation message was sent to the user. - * - * @return the invitationSent value. - */ - public OffsetDateTime invitationSent() { - return this.invitationSent; - } - - /** - * Get the totalUsage property: How long the user has used their virtual machines in this lab. - * - * @return the totalUsage value. - */ - public Duration totalUsage() { - return this.totalUsage; - } - - /** {@inheritDoc} */ - @Override - public UserProperties withAdditionalUsageQuota(Duration additionalUsageQuota) { - super.withAdditionalUsageQuota(additionalUsageQuota); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (email() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property email in model UserProperties")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.java deleted file mode 100644 index e28da807e534..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** User resource properties used for updates. */ -@Fluent -public class UserUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdateProperties.class); - - /* - * The amount of usage quota time the user gets in addition to the lab - * usage quota. - */ - @JsonProperty(value = "additionalUsageQuota") - private Duration additionalUsageQuota; - - /** - * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @return the additionalUsageQuota value. - */ - public Duration additionalUsageQuota() { - return this.additionalUsageQuota; - } - - /** - * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @param additionalUsageQuota the additionalUsageQuota value to set. - * @return the UserUpdateProperties object itself. - */ - public UserUpdateProperties withAdditionalUsageQuota(Duration additionalUsageQuota) { - this.additionalUsageQuota = additionalUsageQuota; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java deleted file mode 100644 index 0ed584eb0d88..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineState; -import com.azure.resourcemanager.labservices.models.VirtualMachineType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A lab virtual machine resource. */ -@Fluent -public final class VirtualMachineInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInner.class); - - /* - * System data of the Lab virtual machine. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Virtual machine resource properties - */ - @JsonProperty(value = "properties", required = true) - private VirtualMachineProperties innerProperties = new VirtualMachineProperties(); - - /** - * Get the systemData property: System data of the Lab virtual machine. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Virtual machine resource properties. - * - * @return the innerProperties value. - */ - private VirtualMachineProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: Current provisioning state of the virtual machine. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the state property: The current state of the virtual machine. - * - * @return the state value. - */ - public VirtualMachineState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the connectionProfile property: Profile for information about connecting to the virtual machine. - * - * @return the connectionProfile value. - */ - public VirtualMachineConnectionProfile connectionProfile() { - return this.innerProperties() == null ? null : this.innerProperties().connectionProfile(); - } - - /** - * Get the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine. - * - * @return the claimedByUserId value. - */ - public String claimedByUserId() { - return this.innerProperties() == null ? null : this.innerProperties().claimedByUserId(); - } - - /** - * Get the vmType property: The type of this VM resource. - * - * @return the vmType value. - */ - public VirtualMachineType vmType() { - return this.innerProperties() == null ? null : this.innerProperties().vmType(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualMachineInner")); - } else { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.java deleted file mode 100644 index c932bf475361..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineState; -import com.azure.resourcemanager.labservices.models.VirtualMachineType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual machine resource properties. */ -@Immutable -public final class VirtualMachineProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineProperties.class); - - /* - * Current provisioning state of the virtual machine. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * The current state of the virtual machine - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineState state; - - /* - * Profile for information about connecting to the virtual machine. - */ - @JsonProperty(value = "connectionProfile", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineConnectionProfile connectionProfile; - - /* - * The lab user ID (not the PUID!) of who claimed the virtual machine. - */ - @JsonProperty(value = "claimedByUserId", access = JsonProperty.Access.WRITE_ONLY) - private String claimedByUserId; - - /* - * The type of this VM resource - */ - @JsonProperty(value = "vmType", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineType vmType; - - /** - * Get the provisioningState property: Current provisioning state of the virtual machine. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the state property: The current state of the virtual machine. - * - * @return the state value. - */ - public VirtualMachineState state() { - return this.state; - } - - /** - * Get the connectionProfile property: Profile for information about connecting to the virtual machine. - * - * @return the connectionProfile value. - */ - public VirtualMachineConnectionProfile connectionProfile() { - return this.connectionProfile; - } - - /** - * Get the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine. - * - * @return the claimedByUserId value. - */ - public String claimedByUserId() { - return this.claimedByUserId; - } - - /** - * Get the vmType property: The type of this VM resource. - * - * @return the vmType value. - */ - public VirtualMachineType vmType() { - return this.vmType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (connectionProfile() != null) { - connectionProfile().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java deleted file mode 100644 index 34a923c01f96..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for LabServicesClient. REST API for managing Azure Lab Services images. */ -package com.azure.resourcemanager.labservices.fluent.models; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java deleted file mode 100644 index 33339f2e16f1..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for LabServicesClient. REST API for managing Azure Lab Services images. */ -package com.azure.resourcemanager.labservices.fluent; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.java deleted file mode 100644 index c048acde3399..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.ImageInner; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.Image; -import com.azure.resourcemanager.labservices.models.ImageUpdate; -import com.azure.resourcemanager.labservices.models.OsState; -import com.azure.resourcemanager.labservices.models.OsType; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import java.util.Collections; -import java.util.List; - -public final class ImageImpl implements Image, Image.Definition, Image.Update { - private ImageInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String iconUrl() { - return this.innerModel().iconUrl(); - } - - public String author() { - return this.innerModel().author(); - } - - public OsType osType() { - return this.innerModel().osType(); - } - - public String plan() { - return this.innerModel().plan(); - } - - public EnableState termsStatus() { - return this.innerModel().termsStatus(); - } - - public String offer() { - return this.innerModel().offer(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String sku() { - return this.innerModel().sku(); - } - - public String version() { - return this.innerModel().version(); - } - - public String sharedGalleryId() { - return this.innerModel().sharedGalleryId(); - } - - public List availableRegions() { - List inner = this.innerModel().availableRegions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OsState osState() { - return this.innerModel().osState(); - } - - public EnableState enabledState() { - return this.innerModel().enabledState(); - } - - public ImageInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labPlanName; - - private String imageName; - - private ImageUpdate updateBody; - - public ImageImpl withExistingLabPlan(String resourceGroupName, String labPlanName) { - this.resourceGroupName = resourceGroupName; - this.labPlanName = labPlanName; - return this; - } - - public Image create() { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .createOrUpdateWithResponse(resourceGroupName, labPlanName, imageName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Image create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .createOrUpdateWithResponse(resourceGroupName, labPlanName, imageName, this.innerModel(), context) - .getValue(); - return this; - } - - ImageImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = new ImageInner(); - this.serviceManager = serviceManager; - this.imageName = name; - } - - public ImageImpl update() { - this.updateBody = new ImageUpdate(); - return this; - } - - public Image apply() { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .updateWithResponse(resourceGroupName, labPlanName, imageName, updateBody, Context.NONE) - .getValue(); - return this; - } - - public Image apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .updateWithResponse(resourceGroupName, labPlanName, imageName, updateBody, context) - .getValue(); - return this; - } - - ImageImpl(ImageInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labPlanName = Utils.getValueFromIdByName(innerObject.id(), "labPlans"); - this.imageName = Utils.getValueFromIdByName(innerObject.id(), "images"); - } - - public Image refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .getWithResponse(resourceGroupName, labPlanName, imageName, Context.NONE) - .getValue(); - return this; - } - - public Image refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .getWithResponse(resourceGroupName, labPlanName, imageName, context) - .getValue(); - return this; - } - - public ImageImpl withAvailableRegions(List availableRegions) { - this.innerModel().withAvailableRegions(availableRegions); - return this; - } - - public ImageImpl withEnabledState(EnableState enabledState) { - if (isInCreateMode()) { - this.innerModel().withEnabledState(enabledState); - return this; - } else { - this.updateBody.withEnabledState(enabledState); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java deleted file mode 100644 index e6c6c6426aa6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java +++ /dev/null @@ -1,966 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.ImagesClient; -import com.azure.resourcemanager.labservices.fluent.models.ImageInner; -import com.azure.resourcemanager.labservices.models.ImageUpdate; -import com.azure.resourcemanager.labservices.models.PagedImages; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ImagesClient. */ -public final class ImagesClientImpl implements ImagesClient { - private final ClientLogger logger = new ClientLogger(ImagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ImagesService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of ImagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ImagesClientImpl(LabServicesClientImpl client) { - this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientImages to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientIma") - private interface ImagesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}/images") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLabPlan( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}/images/{imageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @PathParam("imageName") String imageName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}/images/{imageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @PathParam("imageName") String imageName, - @BodyParam("application/json") ImageInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}/images/{imageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @PathParam("imageName") String imageName, - @BodyParam("application/json") ImageUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLabPlanNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabPlanSinglePageAsync( - String resourceGroupName, String labPlanName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLabPlan( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabPlanSinglePageAsync( - String resourceGroupName, String labPlanName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLabPlan( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabPlanAsync(String resourceGroupName, String labPlanName, String filter) { - return new PagedFlux<>( - () -> listByLabPlanSinglePageAsync(resourceGroupName, labPlanName, filter), - nextLink -> listByLabPlanNextSinglePageAsync(nextLink)); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabPlanAsync(String resourceGroupName, String labPlanName) { - final String filter = null; - return new PagedFlux<>( - () -> listByLabPlanSinglePageAsync(resourceGroupName, labPlanName, filter), - nextLink -> listByLabPlanNextSinglePageAsync(nextLink)); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabPlanAsync( - String resourceGroupName, String labPlanName, String filter, Context context) { - return new PagedFlux<>( - () -> listByLabPlanSinglePageAsync(resourceGroupName, labPlanName, filter, context), - nextLink -> listByLabPlanNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLabPlan(String resourceGroupName, String labPlanName) { - final String filter = null; - return new PagedIterable<>(listByLabPlanAsync(resourceGroupName, labPlanName, filter)); - } - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLabPlan( - String resourceGroupName, String labPlanName, String filter, Context context) { - return new PagedIterable<>(listByLabPlanAsync(resourceGroupName, labPlanName, filter, context)); - } - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labPlanName, String imageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - imageName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labPlanName, String imageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - imageName, - accept, - context); - } - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labPlanName, String imageName) { - return getWithResponseAsync(resourceGroupName, labPlanName, imageName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner get(String resourceGroupName, String labPlanName, String imageName) { - return getAsync(resourceGroupName, labPlanName, imageName).block(); - } - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labPlanName, String imageName, Context context) { - return getWithResponseAsync(resourceGroupName, labPlanName, imageName, context).block(); - } - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labPlanName, String imageName, ImageInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - imageName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labPlanName, String imageName, ImageInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - imageName, - body, - accept, - context); - } - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labPlanName, String imageName, ImageInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, imageName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner createOrUpdate(String resourceGroupName, String labPlanName, String imageName, ImageInner body) { - return createOrUpdateAsync(resourceGroupName, labPlanName, imageName, body).block(); - } - - /** - * Updates an image resource via PUT. Creating new resources via PUT will not function. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String labPlanName, String imageName, ImageInner body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, imageName, body, context).block(); - } - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labPlanName, String imageName, ImageUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - imageName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labPlanName, String imageName, ImageUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - imageName, - body, - accept, - context); - } - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String labPlanName, String imageName, ImageUpdate body) { - return updateWithResponseAsync(resourceGroupName, labPlanName, imageName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner update(String resourceGroupName, String labPlanName, String imageName, ImageUpdate body) { - return updateAsync(resourceGroupName, labPlanName, imageName, body).block(); - } - - /** - * Updates an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab services virtual machine image along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String labPlanName, String imageName, ImageUpdate body, Context context) { - return updateWithResponseAsync(resourceGroupName, labPlanName, imageName, body, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of Lab services virtual machine images along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabPlanNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLabPlanNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of Lab services virtual machine images along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabPlanNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLabPlanNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java deleted file mode 100644 index 8a5d05397e35..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.ImagesClient; -import com.azure.resourcemanager.labservices.fluent.models.ImageInner; -import com.azure.resourcemanager.labservices.models.Image; -import com.azure.resourcemanager.labservices.models.Images; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ImagesImpl implements Images { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImagesImpl.class); - - private final ImagesClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public ImagesImpl( - ImagesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByLabPlan(String resourceGroupName, String labPlanName) { - PagedIterable inner = this.serviceClient().listByLabPlan(resourceGroupName, labPlanName); - return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); - } - - public PagedIterable listByLabPlan( - String resourceGroupName, String labPlanName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByLabPlan(resourceGroupName, labPlanName, filter, context); - return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); - } - - public Image get(String resourceGroupName, String labPlanName, String imageName) { - ImageInner inner = this.serviceClient().get(resourceGroupName, labPlanName, imageName); - if (inner != null) { - return new ImageImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String labPlanName, String imageName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labPlanName, imageName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ImageImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Image getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labPlanName = Utils.getValueFromIdByName(id, "labPlans"); - if (labPlanName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); - } - String imageName = Utils.getValueFromIdByName(id, "images"); - if (imageName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); - } - return this.getWithResponse(resourceGroupName, labPlanName, imageName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labPlanName = Utils.getValueFromIdByName(id, "labPlans"); - if (labPlanName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); - } - String imageName = Utils.getValueFromIdByName(id, "images"); - if (imageName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); - } - return this.getWithResponse(resourceGroupName, labPlanName, imageName, context); - } - - private ImagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - public ImageImpl define(String name) { - return new ImageImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java deleted file mode 100644 index 42ff0d1f3c2d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.Lab; -import com.azure.resourcemanager.labservices.models.LabNetworkProfile; -import com.azure.resourcemanager.labservices.models.LabState; -import com.azure.resourcemanager.labservices.models.LabUpdate; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RosterProfile; -import com.azure.resourcemanager.labservices.models.SecurityProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class LabImpl implements Lab, Lab.Definition, Lab.Update { - private LabInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public LabNetworkProfile networkProfile() { - return this.innerModel().networkProfile(); - } - - public LabState state() { - return this.innerModel().state(); - } - - public AutoShutdownProfile autoShutdownProfile() { - return this.innerModel().autoShutdownProfile(); - } - - public ConnectionProfile connectionProfile() { - return this.innerModel().connectionProfile(); - } - - public VirtualMachineProfile virtualMachineProfile() { - return this.innerModel().virtualMachineProfile(); - } - - public SecurityProfile securityProfile() { - return this.innerModel().securityProfile(); - } - - public RosterProfile rosterProfile() { - return this.innerModel().rosterProfile(); - } - - public String labPlanId() { - return this.innerModel().labPlanId(); - } - - public String title() { - return this.innerModel().title(); - } - - public String description() { - return this.innerModel().description(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public LabInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labName; - - private LabUpdate updateBody; - - public LabImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Lab create() { - this.innerObject = - serviceManager - .serviceClient() - .getLabs() - .createOrUpdate(resourceGroupName, labName, this.innerModel(), Context.NONE); - return this; - } - - public Lab create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLabs() - .createOrUpdate(resourceGroupName, labName, this.innerModel(), context); - return this; - } - - LabImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = new LabInner(); - this.serviceManager = serviceManager; - this.labName = name; - } - - public LabImpl update() { - this.updateBody = new LabUpdate(); - return this; - } - - public Lab apply() { - this.innerObject = - serviceManager.serviceClient().getLabs().update(resourceGroupName, labName, updateBody, Context.NONE); - return this; - } - - public Lab apply(Context context) { - this.innerObject = - serviceManager.serviceClient().getLabs().update(resourceGroupName, labName, updateBody, context); - return this; - } - - LabImpl(LabInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); - } - - public Lab refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getLabs() - .getByResourceGroupWithResponse(resourceGroupName, labName, Context.NONE) - .getValue(); - return this; - } - - public Lab refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLabs() - .getByResourceGroupWithResponse(resourceGroupName, labName, context) - .getValue(); - return this; - } - - public void publish() { - serviceManager.labs().publish(resourceGroupName, labName); - } - - public void publish(Context context) { - serviceManager.labs().publish(resourceGroupName, labName, context); - } - - public void syncGroup() { - serviceManager.labs().syncGroup(resourceGroupName, labName); - } - - public void syncGroup(Context context) { - serviceManager.labs().syncGroup(resourceGroupName, labName, context); - } - - public LabImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public LabImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public LabImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public LabImpl withNetworkProfile(LabNetworkProfile networkProfile) { - this.innerModel().withNetworkProfile(networkProfile); - return this; - } - - public LabImpl withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { - if (isInCreateMode()) { - this.innerModel().withAutoShutdownProfile(autoShutdownProfile); - return this; - } else { - this.updateBody.withAutoShutdownProfile(autoShutdownProfile); - return this; - } - } - - public LabImpl withConnectionProfile(ConnectionProfile connectionProfile) { - if (isInCreateMode()) { - this.innerModel().withConnectionProfile(connectionProfile); - return this; - } else { - this.updateBody.withConnectionProfile(connectionProfile); - return this; - } - } - - public LabImpl withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { - if (isInCreateMode()) { - this.innerModel().withVirtualMachineProfile(virtualMachineProfile); - return this; - } else { - this.updateBody.withVirtualMachineProfile(virtualMachineProfile); - return this; - } - } - - public LabImpl withSecurityProfile(SecurityProfile securityProfile) { - if (isInCreateMode()) { - this.innerModel().withSecurityProfile(securityProfile); - return this; - } else { - this.updateBody.withSecurityProfile(securityProfile); - return this; - } - } - - public LabImpl withRosterProfile(RosterProfile rosterProfile) { - if (isInCreateMode()) { - this.innerModel().withRosterProfile(rosterProfile); - return this; - } else { - this.updateBody.withRosterProfile(rosterProfile); - return this; - } - } - - public LabImpl withLabPlanId(String labPlanId) { - if (isInCreateMode()) { - this.innerModel().withLabPlanId(labPlanId); - return this; - } else { - this.updateBody.withLabPlanId(labPlanId); - return this; - } - } - - public LabImpl withTitle(String title) { - if (isInCreateMode()) { - this.innerModel().withTitle(title); - return this; - } else { - this.updateBody.withTitle(title); - return this; - } - } - - public LabImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateBody.withDescription(description); - return this; - } - } - - public LabImpl withTags(List tags) { - this.updateBody.withTags(tags); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java deleted file mode 100644 index a4ef92ed0a05..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.LabPlan; -import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; -import com.azure.resourcemanager.labservices.models.LabPlanUpdate; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.SaveImageBody; -import com.azure.resourcemanager.labservices.models.SupportInfo; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class LabPlanImpl implements LabPlan, LabPlan.Definition, LabPlan.Update { - private LabPlanInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ConnectionProfile defaultConnectionProfile() { - return this.innerModel().defaultConnectionProfile(); - } - - public AutoShutdownProfile defaultAutoShutdownProfile() { - return this.innerModel().defaultAutoShutdownProfile(); - } - - public LabPlanNetworkProfile defaultNetworkProfile() { - return this.innerModel().defaultNetworkProfile(); - } - - public List allowedRegions() { - List inner = this.innerModel().allowedRegions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String sharedGalleryId() { - return this.innerModel().sharedGalleryId(); - } - - public SupportInfo supportInfo() { - return this.innerModel().supportInfo(); - } - - public String linkedLmsInstance() { - return this.innerModel().linkedLmsInstance(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public LabPlanInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labPlanName; - - private LabPlanUpdate updateBody; - - public LabPlanImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public LabPlan create() { - this.innerObject = - serviceManager - .serviceClient() - .getLabPlans() - .createOrUpdate(resourceGroupName, labPlanName, this.innerModel(), Context.NONE); - return this; - } - - public LabPlan create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLabPlans() - .createOrUpdate(resourceGroupName, labPlanName, this.innerModel(), context); - return this; - } - - LabPlanImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = new LabPlanInner(); - this.serviceManager = serviceManager; - this.labPlanName = name; - } - - public LabPlanImpl update() { - this.updateBody = new LabPlanUpdate(); - return this; - } - - public LabPlan apply() { - this.innerObject = - serviceManager - .serviceClient() - .getLabPlans() - .update(resourceGroupName, labPlanName, updateBody, Context.NONE); - return this; - } - - public LabPlan apply(Context context) { - this.innerObject = - serviceManager.serviceClient().getLabPlans().update(resourceGroupName, labPlanName, updateBody, context); - return this; - } - - LabPlanImpl(LabPlanInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labPlanName = Utils.getValueFromIdByName(innerObject.id(), "labPlans"); - } - - public LabPlan refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getLabPlans() - .getByResourceGroupWithResponse(resourceGroupName, labPlanName, Context.NONE) - .getValue(); - return this; - } - - public LabPlan refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLabPlans() - .getByResourceGroupWithResponse(resourceGroupName, labPlanName, context) - .getValue(); - return this; - } - - public void saveImage(SaveImageBody body) { - serviceManager.labPlans().saveImage(resourceGroupName, labPlanName, body); - } - - public void saveImage(SaveImageBody body, Context context) { - serviceManager.labPlans().saveImage(resourceGroupName, labPlanName, body, context); - } - - public LabPlanImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public LabPlanImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public LabPlanImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public LabPlanImpl withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { - if (isInCreateMode()) { - this.innerModel().withDefaultConnectionProfile(defaultConnectionProfile); - return this; - } else { - this.updateBody.withDefaultConnectionProfile(defaultConnectionProfile); - return this; - } - } - - public LabPlanImpl withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { - if (isInCreateMode()) { - this.innerModel().withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); - return this; - } else { - this.updateBody.withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); - return this; - } - } - - public LabPlanImpl withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { - if (isInCreateMode()) { - this.innerModel().withDefaultNetworkProfile(defaultNetworkProfile); - return this; - } else { - this.updateBody.withDefaultNetworkProfile(defaultNetworkProfile); - return this; - } - } - - public LabPlanImpl withAllowedRegions(List allowedRegions) { - if (isInCreateMode()) { - this.innerModel().withAllowedRegions(allowedRegions); - return this; - } else { - this.updateBody.withAllowedRegions(allowedRegions); - return this; - } - } - - public LabPlanImpl withSharedGalleryId(String sharedGalleryId) { - if (isInCreateMode()) { - this.innerModel().withSharedGalleryId(sharedGalleryId); - return this; - } else { - this.updateBody.withSharedGalleryId(sharedGalleryId); - return this; - } - } - - public LabPlanImpl withSupportInfo(SupportInfo supportInfo) { - if (isInCreateMode()) { - this.innerModel().withSupportInfo(supportInfo); - return this; - } else { - this.updateBody.withSupportInfo(supportInfo); - return this; - } - } - - public LabPlanImpl withLinkedLmsInstance(String linkedLmsInstance) { - if (isInCreateMode()) { - this.innerModel().withLinkedLmsInstance(linkedLmsInstance); - return this; - } else { - this.updateBody.withLinkedLmsInstance(linkedLmsInstance); - return this; - } - } - - public LabPlanImpl withTags(List tags) { - this.updateBody.withTags(tags); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansClientImpl.java deleted file mode 100644 index f46e03e89055..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansClientImpl.java +++ /dev/null @@ -1,1894 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.LabPlansClient; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; -import com.azure.resourcemanager.labservices.models.LabPlanUpdate; -import com.azure.resourcemanager.labservices.models.PagedLabPlans; -import com.azure.resourcemanager.labservices.models.SaveImageBody; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LabPlansClient. */ -public final class LabPlansClientImpl implements LabPlansClient { - private final ClientLogger logger = new ClientLogger(LabPlansClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LabPlansService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of LabPlansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LabPlansClientImpl(LabServicesClientImpl client) { - this.service = RestProxy.create(LabPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientLabPlans to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientLab") - private interface LabPlansService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labPlans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @BodyParam("application/json") LabPlanInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @BodyParam("application/json") LabPlanUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labPlans/{labPlanName}/saveImage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> saveImage( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labPlanName") String labPlanName, - @BodyParam("application/json") SaveImageBody body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String labPlanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String labPlanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - accept, - context); - } - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String labPlanName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, labPlanName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabPlanInner getByResourceGroup(String resourceGroupName, String labPlanName) { - return getByResourceGroupAsync(resourceGroupName, labPlanName).block(); - } - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String labPlanName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, labPlanName, context).block(); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String labPlanName, LabPlanInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - body, - accept, - context); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabPlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labPlanName, LabPlanInner body) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, this.client.getContext()); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabPlanInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, context); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabPlanInner> beginCreateOrUpdate( - String resourceGroupName, String labPlanName, LabPlanInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body).getSyncPoller(); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabPlanInner> beginCreateOrUpdate( - String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body, context).getSyncPoller(); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labPlanName, LabPlanInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body) { - return createOrUpdateAsync(resourceGroupName, labPlanName, body).block(); - } - - /** - * Operation to create or update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabPlanInner createOrUpdate( - String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, labPlanName, body, context).block(); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String labPlanName, LabPlanUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - body, - accept, - context); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabPlanInner> beginUpdateAsync( - String resourceGroupName, String labPlanName, LabPlanUpdate body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, labPlanName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, this.client.getContext()); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabPlanInner> beginUpdateAsync( - String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, labPlanName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, context); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabPlanInner> beginUpdate( - String resourceGroupName, String labPlanName, LabPlanUpdate body) { - return beginUpdateAsync(resourceGroupName, labPlanName, body).getSyncPoller(); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabPlanInner> beginUpdate( - String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, labPlanName, body, context).getSyncPoller(); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labPlanName, LabPlanUpdate body) { - return beginUpdateAsync(resourceGroupName, labPlanName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, labPlanName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body) { - return updateAsync(resourceGroupName, labPlanName, body).block(); - } - - /** - * Operation to update a Lab Plan resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { - return updateAsync(resourceGroupName, labPlanName, body, context).block(); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String labPlanName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labPlanName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - accept, - context); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labPlanName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labPlanName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labPlanName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labPlanName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labPlanName) { - return beginDeleteAsync(resourceGroupName, labPlanName).getSyncPoller(); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labPlanName, Context context) { - return beginDeleteAsync(resourceGroupName, labPlanName, context).getSyncPoller(); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labPlanName) { - return beginDeleteAsync(resourceGroupName, labPlanName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labPlanName, Context context) { - return beginDeleteAsync(resourceGroupName, labPlanName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labPlanName) { - deleteAsync(resourceGroupName, labPlanName).block(); - } - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labPlanName, Context context) { - deleteAsync(resourceGroupName, labPlanName, context).block(); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> saveImageWithResponseAsync( - String resourceGroupName, String labPlanName, SaveImageBody body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .saveImage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> saveImageWithResponseAsync( - String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labPlanName == null) { - return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .saveImage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labPlanName, - body, - accept, - context); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSaveImageAsync( - String resourceGroupName, String labPlanName, SaveImageBody body) { - Mono>> mono = saveImageWithResponseAsync(resourceGroupName, labPlanName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSaveImageAsync( - String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - saveImageWithResponseAsync(resourceGroupName, labPlanName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSaveImage( - String resourceGroupName, String labPlanName, SaveImageBody body) { - return beginSaveImageAsync(resourceGroupName, labPlanName, body).getSyncPoller(); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSaveImage( - String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { - return beginSaveImageAsync(resourceGroupName, labPlanName, body, context).getSyncPoller(); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono saveImageAsync(String resourceGroupName, String labPlanName, SaveImageBody body) { - return beginSaveImageAsync(resourceGroupName, labPlanName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono saveImageAsync( - String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { - return beginSaveImageAsync(resourceGroupName, labPlanName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body) { - saveImageAsync(resourceGroupName, labPlanName, body).block(); - } - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { - saveImageAsync(resourceGroupName, labPlanName, body, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java deleted file mode 100644 index ee6f8bd4a1d4..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.LabPlansClient; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; -import com.azure.resourcemanager.labservices.models.LabPlan; -import com.azure.resourcemanager.labservices.models.LabPlans; -import com.azure.resourcemanager.labservices.models.SaveImageBody; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class LabPlansImpl implements LabPlans { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlansImpl.class); - - private final LabPlansClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public LabPlansImpl( - LabPlansClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); - } - - public LabPlan getByResourceGroup(String resourceGroupName, String labPlanName) { - LabPlanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, labPlanName); - if (inner != null) { - return new LabPlanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String labPlanName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, labPlanName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new LabPlanImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String labPlanName) { - this.serviceClient().delete(resourceGroupName, labPlanName); - } - - public void delete(String resourceGroupName, String labPlanName, Context context) { - this.serviceClient().delete(resourceGroupName, labPlanName, context); - } - - public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body) { - this.serviceClient().saveImage(resourceGroupName, labPlanName, body); - } - - public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { - this.serviceClient().saveImage(resourceGroupName, labPlanName, body, context); - } - - public LabPlan getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labPlanName = Utils.getValueFromIdByName(id, "labPlans"); - if (labPlanName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, labPlanName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labPlanName = Utils.getValueFromIdByName(id, "labPlans"); - if (labPlanName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, labPlanName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labPlanName = Utils.getValueFromIdByName(id, "labPlans"); - if (labPlanName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); - } - this.delete(resourceGroupName, labPlanName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labPlanName = Utils.getValueFromIdByName(id, "labPlans"); - if (labPlanName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); - } - this.delete(resourceGroupName, labPlanName, context); - } - - private LabPlansClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - public LabPlanImpl define(String name) { - return new LabPlanImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientBuilder.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientBuilder.java deleted file mode 100644 index 6459a4b3ec06..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the LabServicesClientImpl type. */ -@ServiceClientBuilder(serviceClients = {LabServicesClientImpl.class}) -public final class LabServicesClientBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the LabServicesClientBuilder. - */ - public LabServicesClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the LabServicesClientBuilder. - */ - public LabServicesClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the LabServicesClientBuilder. - */ - public LabServicesClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the LabServicesClientBuilder. - */ - public LabServicesClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the LabServicesClientBuilder. - */ - public LabServicesClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the LabServicesClientBuilder. - */ - public LabServicesClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of LabServicesClientImpl with the provided parameters. - * - * @return an instance of LabServicesClientImpl. - */ - public LabServicesClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - LabServicesClientImpl client = - new LabServicesClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientImpl.java deleted file mode 100644 index fdfdc83df220..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientImpl.java +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.labservices.fluent.ImagesClient; -import com.azure.resourcemanager.labservices.fluent.LabPlansClient; -import com.azure.resourcemanager.labservices.fluent.LabServicesClient; -import com.azure.resourcemanager.labservices.fluent.LabsClient; -import com.azure.resourcemanager.labservices.fluent.OperationResultsClient; -import com.azure.resourcemanager.labservices.fluent.OperationsClient; -import com.azure.resourcemanager.labservices.fluent.SchedulesClient; -import com.azure.resourcemanager.labservices.fluent.SkusClient; -import com.azure.resourcemanager.labservices.fluent.UsagesClient; -import com.azure.resourcemanager.labservices.fluent.UsersClient; -import com.azure.resourcemanager.labservices.fluent.VirtualMachinesClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the LabServicesClientImpl type. */ -@ServiceClient(builder = LabServicesClientBuilder.class) -public final class LabServicesClientImpl implements LabServicesClient { - private final ClientLogger logger = new ClientLogger(LabServicesClientImpl.class); - - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The ImagesClient object to access its operations. */ - private final ImagesClient images; - - /** - * Gets the ImagesClient object to access its operations. - * - * @return the ImagesClient object. - */ - public ImagesClient getImages() { - return this.images; - } - - /** The LabPlansClient object to access its operations. */ - private final LabPlansClient labPlans; - - /** - * Gets the LabPlansClient object to access its operations. - * - * @return the LabPlansClient object. - */ - public LabPlansClient getLabPlans() { - return this.labPlans; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The LabsClient object to access its operations. */ - private final LabsClient labs; - - /** - * Gets the LabsClient object to access its operations. - * - * @return the LabsClient object. - */ - public LabsClient getLabs() { - return this.labs; - } - - /** The OperationResultsClient object to access its operations. */ - private final OperationResultsClient operationResults; - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - public OperationResultsClient getOperationResults() { - return this.operationResults; - } - - /** The SchedulesClient object to access its operations. */ - private final SchedulesClient schedules; - - /** - * Gets the SchedulesClient object to access its operations. - * - * @return the SchedulesClient object. - */ - public SchedulesClient getSchedules() { - return this.schedules; - } - - /** The UsersClient object to access its operations. */ - private final UsersClient users; - - /** - * Gets the UsersClient object to access its operations. - * - * @return the UsersClient object. - */ - public UsersClient getUsers() { - return this.users; - } - - /** The VirtualMachinesClient object to access its operations. */ - private final VirtualMachinesClient virtualMachines; - - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. - */ - public VirtualMachinesClient getVirtualMachines() { - return this.virtualMachines; - } - - /** The UsagesClient object to access its operations. */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** The SkusClient object to access its operations. */ - private final SkusClient skus; - - /** - * Gets the SkusClient object to access its operations. - * - * @return the SkusClient object. - */ - public SkusClient getSkus() { - return this.skus; - } - - /** - * Initializes an instance of LabServicesClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - LabServicesClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2021-11-15-preview"; - this.images = new ImagesClientImpl(this); - this.labPlans = new LabPlansClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.labs = new LabsClientImpl(this); - this.operationResults = new OperationResultsClientImpl(this); - this.schedules = new SchedulesClientImpl(this); - this.users = new UsersClientImpl(this); - this.virtualMachines = new VirtualMachinesClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.skus = new SkusClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java deleted file mode 100644 index 714b6f286c75..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; -import com.azure.resourcemanager.labservices.models.LabServicesSku; -import com.azure.resourcemanager.labservices.models.LabServicesSkuCapabilities; -import com.azure.resourcemanager.labservices.models.LabServicesSkuCapacity; -import com.azure.resourcemanager.labservices.models.LabServicesSkuCost; -import com.azure.resourcemanager.labservices.models.LabServicesSkuRestrictions; -import com.azure.resourcemanager.labservices.models.LabServicesSkuTier; -import java.util.Collections; -import java.util.List; - -public final class LabServicesSkuImpl implements LabServicesSku { - private LabServicesSkuInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - LabServicesSkuImpl( - LabServicesSkuInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String resourceType() { - return this.innerModel().resourceType(); - } - - public String name() { - return this.innerModel().name(); - } - - public LabServicesSkuTier tier() { - return this.innerModel().tier(); - } - - public String size() { - return this.innerModel().size(); - } - - public String family() { - return this.innerModel().family(); - } - - public LabServicesSkuCapacity capacity() { - return this.innerModel().capacity(); - } - - public List capabilities() { - List inner = this.innerModel().capabilities(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List locations() { - List inner = this.innerModel().locations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List costs() { - List inner = this.innerModel().costs(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List restrictions() { - List inner = this.innerModel().restrictions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public LabServicesSkuInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java deleted file mode 100644 index a2fefb18bc2d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java +++ /dev/null @@ -1,2077 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.LabsClient; -import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.LabUpdate; -import com.azure.resourcemanager.labservices.models.PagedLabs; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LabsClient. */ -public final class LabsClientImpl implements LabsClient { - private final ClientLogger logger = new ClientLogger(LabsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LabsService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of LabsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LabsClientImpl(LabServicesClientImpl client) { - this.service = RestProxy.create(LabsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientLabs to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientLab") - private interface LabsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @BodyParam("application/json") LabInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @BodyParam("application/json") LabUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/publish") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> publish( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/syncGroup") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> syncGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all labs for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all labs for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String labName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String labName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context); - } - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String labName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, labName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner getByResourceGroup(String resourceGroupName, String labName) { - return getByResourceGroupAsync(resourceGroupName, labName).block(); - } - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String labName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, labName, context).block(); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String labName, LabInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String labName, LabInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - body, - accept, - context); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, LabInner body) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, this.client.getContext()); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, LabInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, labName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, context); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabInner> beginCreateOrUpdate( - String resourceGroupName, String labName, LabInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, body).getSyncPoller(); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabInner> beginCreateOrUpdate( - String resourceGroupName, String labName, LabInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, body, context).getSyncPoller(); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String labName, LabInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labName, LabInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body) { - return createOrUpdateAsync(resourceGroupName, labName, body).block(); - } - - /** - * Operation to create or update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, body, context).block(); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String labName, LabUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String labName, LabUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - body, - accept, - context); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabInner> beginUpdateAsync( - String resourceGroupName, String labName, LabUpdate body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, labName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, this.client.getContext()); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LabInner> beginUpdateAsync( - String resourceGroupName, String labName, LabUpdate body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, labName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, context); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabInner> beginUpdate( - String resourceGroupName, String labName, LabUpdate body) { - return beginUpdateAsync(resourceGroupName, labName, body).getSyncPoller(); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LabInner> beginUpdate( - String resourceGroupName, String labName, LabUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, labName, body, context).getSyncPoller(); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, LabUpdate body) { - return beginUpdateAsync(resourceGroupName, labName, body).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, LabUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, labName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner update(String resourceGroupName, String labName, LabUpdate body) { - return updateAsync(resourceGroupName, labName, body).block(); - } - - /** - * Operation to update a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner update(String resourceGroupName, String labName, LabUpdate body, Context context) { - return updateAsync(resourceGroupName, labName, body, context).block(); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName) { - return beginDeleteAsync(resourceGroupName, labName).getSyncPoller(); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, Context context) { - return beginDeleteAsync(resourceGroupName, labName, context).getSyncPoller(); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName) { - return beginDeleteAsync(resourceGroupName, labName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, Context context) { - return beginDeleteAsync(resourceGroupName, labName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName) { - deleteAsync(resourceGroupName, labName).block(); - } - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, Context context) { - deleteAsync(resourceGroupName, labName, context).block(); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> publishWithResponseAsync(String resourceGroupName, String labName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .publish( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> publishWithResponseAsync( - String resourceGroupName, String labName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .publish( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String labName) { - Mono>> mono = publishWithResponseAsync(resourceGroupName, labName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginPublishAsync( - String resourceGroupName, String labName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = publishWithResponseAsync(resourceGroupName, labName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginPublish(String resourceGroupName, String labName) { - return beginPublishAsync(resourceGroupName, labName).getSyncPoller(); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginPublish(String resourceGroupName, String labName, Context context) { - return beginPublishAsync(resourceGroupName, labName, context).getSyncPoller(); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono publishAsync(String resourceGroupName, String labName) { - return beginPublishAsync(resourceGroupName, labName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono publishAsync(String resourceGroupName, String labName, Context context) { - return beginPublishAsync(resourceGroupName, labName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void publish(String resourceGroupName, String labName) { - publishAsync(resourceGroupName, labName).block(); - } - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void publish(String resourceGroupName, String labName, Context context) { - publishAsync(resourceGroupName, labName, context).block(); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> syncGroupWithResponseAsync(String resourceGroupName, String labName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .syncGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> syncGroupWithResponseAsync( - String resourceGroupName, String labName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .syncGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - accept, - context); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSyncGroupAsync(String resourceGroupName, String labName) { - Mono>> mono = syncGroupWithResponseAsync(resourceGroupName, labName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSyncGroupAsync( - String resourceGroupName, String labName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = syncGroupWithResponseAsync(resourceGroupName, labName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSyncGroup(String resourceGroupName, String labName) { - return beginSyncGroupAsync(resourceGroupName, labName).getSyncPoller(); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSyncGroup( - String resourceGroupName, String labName, Context context) { - return beginSyncGroupAsync(resourceGroupName, labName, context).getSyncPoller(); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono syncGroupAsync(String resourceGroupName, String labName) { - return beginSyncGroupAsync(resourceGroupName, labName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono syncGroupAsync(String resourceGroupName, String labName, Context context) { - return beginSyncGroupAsync(resourceGroupName, labName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncGroup(String resourceGroupName, String labName) { - syncGroupAsync(resourceGroupName, labName).block(); - } - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void syncGroup(String resourceGroupName, String labName, Context context) { - syncGroupAsync(resourceGroupName, labName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java deleted file mode 100644 index a84ab0c3d071..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.LabsClient; -import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.Lab; -import com.azure.resourcemanager.labservices.models.Labs; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class LabsImpl implements Labs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabsImpl.class); - - private final LabsClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public LabsImpl(LabsClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); - } - - public Lab getByResourceGroup(String resourceGroupName, String labName) { - LabInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, labName); - if (inner != null) { - return new LabImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String labName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, labName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new LabImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String labName) { - this.serviceClient().delete(resourceGroupName, labName); - } - - public void delete(String resourceGroupName, String labName, Context context) { - this.serviceClient().delete(resourceGroupName, labName, context); - } - - public void publish(String resourceGroupName, String labName) { - this.serviceClient().publish(resourceGroupName, labName); - } - - public void publish(String resourceGroupName, String labName, Context context) { - this.serviceClient().publish(resourceGroupName, labName, context); - } - - public void syncGroup(String resourceGroupName, String labName) { - this.serviceClient().syncGroup(resourceGroupName, labName); - } - - public void syncGroup(String resourceGroupName, String labName, Context context) { - this.serviceClient().syncGroup(resourceGroupName, labName, context); - } - - public Lab getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, labName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, labName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - this.delete(resourceGroupName, labName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - this.delete(resourceGroupName, labName, context); - } - - private LabsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - public LabImpl define(String name) { - return new LabImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.java deleted file mode 100644 index a92d06733a31..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.OperationInner; -import com.azure.resourcemanager.labservices.models.ActionType; -import com.azure.resourcemanager.labservices.models.Operation; -import com.azure.resourcemanager.labservices.models.OperationDisplay; -import com.azure.resourcemanager.labservices.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java deleted file mode 100644 index 81bab961368f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; -import com.azure.resourcemanager.labservices.models.OperationResult; -import com.azure.resourcemanager.labservices.models.OperationStatus; -import java.time.OffsetDateTime; - -public final class OperationResultImpl implements OperationResult { - private OperationResultInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - OperationResultImpl( - OperationResultInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public OperationStatus status() { - return this.innerModel().status(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public Float percentComplete() { - return this.innerModel().percentComplete(); - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public OperationResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.java deleted file mode 100644 index 3146f009721d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.OperationResultsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationResultsClient. */ -public final class OperationResultsClientImpl implements OperationResultsClient { - private final ClientLogger logger = new ClientLogger(OperationResultsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationResultsService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of OperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationResultsClientImpl(LabServicesClientImpl client) { - this.service = - RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientOperationResults to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientOpe") - private interface OperationResultsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/operationResults/{operationResultId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("operationResultId") String operationResultId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String operationResultId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (operationResultId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - operationResultId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String operationResultId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (operationResultId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - operationResultId, - accept, - context); - } - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String operationResultId) { - return getWithResponseAsync(operationResultId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultInner get(String operationResultId) { - return getAsync(operationResultId).block(); - } - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String operationResultId, Context context) { - return getWithResponseAsync(operationResultId, context).block(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java deleted file mode 100644 index 3139788681d7..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.OperationResultsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; -import com.azure.resourcemanager.labservices.models.OperationResult; -import com.azure.resourcemanager.labservices.models.OperationResults; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class OperationResultsImpl implements OperationResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultsImpl.class); - - private final OperationResultsClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public OperationResultsImpl( - OperationResultsClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public OperationResult get(String operationResultId) { - OperationResultInner inner = this.serviceClient().get(operationResultId); - if (inner != null) { - return new OperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String operationResultId, Context context) { - Response inner = this.serviceClient().getWithResponse(operationResultId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private OperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java deleted file mode 100644 index d81328e66bc0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.OperationsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationInner; -import com.azure.resourcemanager.labservices.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(LabServicesClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientOpe") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.LabServices/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Returns a list of all operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java deleted file mode 100644 index 3c411f711f87..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.OperationsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationInner; -import com.azure.resourcemanager.labservices.models.Operation; -import com.azure.resourcemanager.labservices.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java deleted file mode 100644 index e1d8c87be63f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RecurrencePattern; -import com.azure.resourcemanager.labservices.models.Schedule; -import com.azure.resourcemanager.labservices.models.ScheduleUpdate; -import java.time.OffsetDateTime; - -public final class ScheduleImpl implements Schedule, Schedule.Definition, Schedule.Update { - private ScheduleInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public OffsetDateTime startAt() { - return this.innerModel().startAt(); - } - - public OffsetDateTime stopAt() { - return this.innerModel().stopAt(); - } - - public RecurrencePattern recurrencePattern() { - return this.innerModel().recurrencePattern(); - } - - public String timeZoneId() { - return this.innerModel().timeZoneId(); - } - - public String notes() { - return this.innerModel().notes(); - } - - public ScheduleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labName; - - private String scheduleName; - - private ScheduleUpdate updateBody; - - public ScheduleImpl withExistingLab(String resourceGroupName, String labName) { - this.resourceGroupName = resourceGroupName; - this.labName = labName; - return this; - } - - public Schedule create() { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .createOrUpdateWithResponse(resourceGroupName, labName, scheduleName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Schedule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .createOrUpdateWithResponse(resourceGroupName, labName, scheduleName, this.innerModel(), context) - .getValue(); - return this; - } - - ScheduleImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = new ScheduleInner(); - this.serviceManager = serviceManager; - this.scheduleName = name; - } - - public ScheduleImpl update() { - this.updateBody = new ScheduleUpdate(); - return this; - } - - public Schedule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .updateWithResponse(resourceGroupName, labName, scheduleName, updateBody, Context.NONE) - .getValue(); - return this; - } - - public Schedule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .updateWithResponse(resourceGroupName, labName, scheduleName, updateBody, context) - .getValue(); - return this; - } - - ScheduleImpl(ScheduleInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); - this.scheduleName = Utils.getValueFromIdByName(innerObject.id(), "schedules"); - } - - public Schedule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .getWithResponse(resourceGroupName, labName, scheduleName, Context.NONE) - .getValue(); - return this; - } - - public Schedule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .getWithResponse(resourceGroupName, labName, scheduleName, context) - .getValue(); - return this; - } - - public ScheduleImpl withStartAt(OffsetDateTime startAt) { - if (isInCreateMode()) { - this.innerModel().withStartAt(startAt); - return this; - } else { - this.updateBody.withStartAt(startAt); - return this; - } - } - - public ScheduleImpl withStopAt(OffsetDateTime stopAt) { - if (isInCreateMode()) { - this.innerModel().withStopAt(stopAt); - return this; - } else { - this.updateBody.withStopAt(stopAt); - return this; - } - } - - public ScheduleImpl withRecurrencePattern(RecurrencePattern recurrencePattern) { - if (isInCreateMode()) { - this.innerModel().withRecurrencePattern(recurrencePattern); - return this; - } else { - this.updateBody.withRecurrencePattern(recurrencePattern); - return this; - } - } - - public ScheduleImpl withTimeZoneId(String timeZoneId) { - if (isInCreateMode()) { - this.innerModel().withTimeZoneId(timeZoneId); - return this; - } else { - this.updateBody.withTimeZoneId(timeZoneId); - return this; - } - } - - public ScheduleImpl withNotes(String notes) { - if (isInCreateMode()) { - this.innerModel().withNotes(notes); - return this; - } else { - this.updateBody.withNotes(notes); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesClientImpl.java deleted file mode 100644 index e9ef6db0f15e..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesClientImpl.java +++ /dev/null @@ -1,1284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.SchedulesClient; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; -import com.azure.resourcemanager.labservices.models.PagedSchedules; -import com.azure.resourcemanager.labservices.models.ScheduleUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SchedulesClient. */ -public final class SchedulesClientImpl implements SchedulesClient { - private final ClientLogger logger = new ClientLogger(SchedulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SchedulesService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of SchedulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SchedulesClientImpl(LabServicesClientImpl client) { - this.service = - RestProxy.create(SchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientSchedules to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientSch") - private interface SchedulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/schedules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLab( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/schedules/{scheduleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("scheduleName") String scheduleName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/schedules/{scheduleName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("scheduleName") String scheduleName, - @BodyParam("application/json") ScheduleInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/schedules/{scheduleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("scheduleName") String scheduleName, - @BodyParam("application/json") ScheduleUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/schedules/{scheduleName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("scheduleName") String scheduleName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLabNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabSinglePageAsync( - String resourceGroupName, String labName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLab( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabSinglePageAsync( - String resourceGroupName, String labName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLab( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync(String resourceGroupName, String labName, String filter) { - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), - nextLink -> listByLabNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync(String resourceGroupName, String labName) { - final String filter = null; - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), - nextLink -> listByLabNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync( - String resourceGroupName, String labName, String filter, Context context) { - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter, context), - nextLink -> listByLabNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLab(String resourceGroupName, String labName) { - final String filter = null; - return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter)); - } - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLab( - String resourceGroupName, String labName, String filter, Context context) { - return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter, context)); - } - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String scheduleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String scheduleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - accept, - context); - } - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String scheduleName) { - return getWithResponseAsync(resourceGroupName, labName, scheduleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner get(String resourceGroupName, String labName, String scheduleName) { - return getAsync(resourceGroupName, labName, scheduleName).block(); - } - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labName, String scheduleName, Context context) { - return getWithResponseAsync(resourceGroupName, labName, scheduleName, context).block(); - } - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labName, String scheduleName, ScheduleInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labName, String scheduleName, ScheduleInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - body, - accept, - context); - } - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labName, String scheduleName, ScheduleInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, scheduleName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner createOrUpdate( - String resourceGroupName, String labName, String scheduleName, ScheduleInner body) { - return createOrUpdateAsync(resourceGroupName, labName, scheduleName, body).block(); - } - - /** - * Operation to create or update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String labName, String scheduleName, ScheduleInner body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, scheduleName, body, context).block(); - } - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - body, - accept, - context); - } - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body) { - return updateWithResponseAsync(resourceGroupName, labName, scheduleName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner update(String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body) { - return updateAsync(resourceGroupName, labName, scheduleName, body).block(); - } - - /** - * Operation to update a lab schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body, Context context) { - return updateWithResponseAsync(resourceGroupName, labName, scheduleName, body, context).block(); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labName, String scheduleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labName, String scheduleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (scheduleName == null) { - return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - scheduleName, - accept, - context); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labName, String scheduleName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, scheduleName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labName, String scheduleName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, labName, scheduleName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labName, String scheduleName) { - return beginDeleteAsync(resourceGroupName, labName, scheduleName).getSyncPoller(); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labName, String scheduleName, Context context) { - return beginDeleteAsync(resourceGroupName, labName, scheduleName, context).getSyncPoller(); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String scheduleName) { - return beginDeleteAsync(resourceGroupName, labName, scheduleName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String scheduleName, Context context) { - return beginDeleteAsync(resourceGroupName, labName, scheduleName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String scheduleName) { - deleteAsync(resourceGroupName, labName, scheduleName).block(); - } - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String scheduleName, Context context) { - deleteAsync(resourceGroupName, labName, scheduleName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLabNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLabNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.java deleted file mode 100644 index 3651bc5894a3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.SchedulesClient; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; -import com.azure.resourcemanager.labservices.models.Schedule; -import com.azure.resourcemanager.labservices.models.Schedules; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class SchedulesImpl implements Schedules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SchedulesImpl.class); - - private final SchedulesClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public SchedulesImpl( - SchedulesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByLab(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName); - return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByLab(resourceGroupName, labName, filter, context); - return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); - } - - public Schedule get(String resourceGroupName, String labName, String scheduleName) { - ScheduleInner inner = this.serviceClient().get(resourceGroupName, labName, scheduleName); - if (inner != null) { - return new ScheduleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String labName, String scheduleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, scheduleName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ScheduleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String labName, String scheduleName) { - this.serviceClient().delete(resourceGroupName, labName, scheduleName); - } - - public void delete(String resourceGroupName, String labName, String scheduleName, Context context) { - this.serviceClient().delete(resourceGroupName, labName, scheduleName, context); - } - - public Schedule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String scheduleName = Utils.getValueFromIdByName(id, "schedules"); - if (scheduleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); - } - return this.getWithResponse(resourceGroupName, labName, scheduleName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String scheduleName = Utils.getValueFromIdByName(id, "schedules"); - if (scheduleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); - } - return this.getWithResponse(resourceGroupName, labName, scheduleName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String scheduleName = Utils.getValueFromIdByName(id, "schedules"); - if (scheduleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); - } - this.delete(resourceGroupName, labName, scheduleName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String scheduleName = Utils.getValueFromIdByName(id, "schedules"); - if (scheduleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); - } - this.delete(resourceGroupName, labName, scheduleName, context); - } - - private SchedulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - public ScheduleImpl define(String name) { - return new ScheduleImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusClientImpl.java deleted file mode 100644 index 50df92c21d18..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusClientImpl.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.SkusClient; -import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; -import com.azure.resourcemanager.labservices.models.PagedLabServicesSkus; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SkusClient. */ -public final class SkusClientImpl implements SkusClient { - private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SkusService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of SkusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SkusClientImpl(LabServicesClientImpl client) { - this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientSkus to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientSku") - private interface SkusService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.java deleted file mode 100644 index 531502d393fc..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.SkusClient; -import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; -import com.azure.resourcemanager.labservices.models.LabServicesSku; -import com.azure.resourcemanager.labservices.models.Skus; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class SkusImpl implements Skus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkusImpl.class); - - private final SkusClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new LabServicesSkuImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new LabServicesSkuImpl(inner1, this.manager())); - } - - private SkusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.java deleted file mode 100644 index 971f9f44d1ee..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.UsageInner; -import com.azure.resourcemanager.labservices.models.Usage; -import com.azure.resourcemanager.labservices.models.UsageName; -import com.azure.resourcemanager.labservices.models.UsageUnit; - -public final class UsageImpl implements Usage { - private UsageInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - UsageImpl(UsageInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Long currentValue() { - return this.innerModel().currentValue(); - } - - public Long limit() { - return this.innerModel().limit(); - } - - public UsageUnit unit() { - return this.innerModel().unit(); - } - - public UsageName name() { - return this.innerModel().name(); - } - - public String id() { - return this.innerModel().id(); - } - - public UsageInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java deleted file mode 100644 index 7d1275df6803..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.UsagesClient; -import com.azure.resourcemanager.labservices.fluent.models.UsageInner; -import com.azure.resourcemanager.labservices.models.ListUsagesResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsagesClient. */ -public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final UsagesService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of UsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsagesClientImpl(LabServicesClientImpl client) { - this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientUsages to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientUsa") - private interface UsagesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{location}/usages") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocation( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocationNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync(String location, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLocation( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationSinglePageAsync( - String location, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocation( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLocationAsync(String location, String filter) { - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location, filter), - nextLink -> listByLocationNextSinglePageAsync(nextLink)); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLocationAsync(String location) { - final String filter = null; - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location, filter), - nextLink -> listByLocationNextSinglePageAsync(nextLink)); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLocationAsync(String location, String filter, Context context) { - return new PagedFlux<>( - () -> listByLocationSinglePageAsync(location, filter, context), - nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location) { - final String filter = null; - return new PagedIterable<>(listByLocationAsync(location, filter)); - } - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLocation(String location, String filter, Context context) { - return new PagedIterable<>(listByLocationAsync(location, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLocationNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLocationNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java deleted file mode 100644 index 945f799f6a08..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.UsagesClient; -import com.azure.resourcemanager.labservices.fluent.models.UsageInner; -import com.azure.resourcemanager.labservices.models.Usage; -import com.azure.resourcemanager.labservices.models.Usages; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class UsagesImpl implements Usages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); - - private final UsagesClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public UsagesImpl( - UsagesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByLocation(String location) { - PagedIterable inner = this.serviceClient().listByLocation(location); - return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); - } - - public PagedIterable listByLocation(String location, String filter, Context context) { - PagedIterable inner = this.serviceClient().listByLocation(location, filter, context); - return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); - } - - private UsagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java deleted file mode 100644 index 1c64223673fe..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.InvitationState; -import com.azure.resourcemanager.labservices.models.InviteBody; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.RegistrationState; -import com.azure.resourcemanager.labservices.models.User; -import com.azure.resourcemanager.labservices.models.UserUpdate; -import java.time.Duration; -import java.time.OffsetDateTime; - -public final class UserImpl implements User, User.Definition, User.Update { - private UserInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String email() { - return this.innerModel().email(); - } - - public RegistrationState registrationState() { - return this.innerModel().registrationState(); - } - - public InvitationState invitationState() { - return this.innerModel().invitationState(); - } - - public OffsetDateTime invitationSent() { - return this.innerModel().invitationSent(); - } - - public Duration totalUsage() { - return this.innerModel().totalUsage(); - } - - public Duration additionalUsageQuota() { - return this.innerModel().additionalUsageQuota(); - } - - public UserInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labName; - - private String username; - - private UserUpdate updateBody; - - public UserImpl withExistingLab(String resourceGroupName, String labName) { - this.resourceGroupName = resourceGroupName; - this.labName = labName; - return this; - } - - public User create() { - this.innerObject = - serviceManager - .serviceClient() - .getUsers() - .createOrUpdate(resourceGroupName, labName, username, this.innerModel(), Context.NONE); - return this; - } - - public User create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getUsers() - .createOrUpdate(resourceGroupName, labName, username, this.innerModel(), context); - return this; - } - - UserImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = new UserInner(); - this.serviceManager = serviceManager; - this.username = name; - } - - public UserImpl update() { - this.updateBody = new UserUpdate(); - return this; - } - - public User apply() { - this.innerObject = - serviceManager - .serviceClient() - .getUsers() - .update(resourceGroupName, labName, username, updateBody, Context.NONE); - return this; - } - - public User apply(Context context) { - this.innerObject = - serviceManager.serviceClient().getUsers().update(resourceGroupName, labName, username, updateBody, context); - return this; - } - - UserImpl(UserInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); - this.username = Utils.getValueFromIdByName(innerObject.id(), "users"); - } - - public User refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getUsers() - .getWithResponse(resourceGroupName, labName, username, Context.NONE) - .getValue(); - return this; - } - - public User refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getUsers() - .getWithResponse(resourceGroupName, labName, username, context) - .getValue(); - return this; - } - - public void invite(InviteBody body) { - serviceManager.users().invite(resourceGroupName, labName, username, body); - } - - public void invite(InviteBody body, Context context) { - serviceManager.users().invite(resourceGroupName, labName, username, body, context); - } - - public UserImpl withEmail(String email) { - this.innerModel().withEmail(email); - return this; - } - - public UserImpl withAdditionalUsageQuota(Duration additionalUsageQuota) { - if (isInCreateMode()) { - this.innerModel().withAdditionalUsageQuota(additionalUsageQuota); - return this; - } else { - this.updateBody.withAdditionalUsageQuota(additionalUsageQuota); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java deleted file mode 100644 index b373ac30f49c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java +++ /dev/null @@ -1,1772 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.UsersClient; -import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.InviteBody; -import com.azure.resourcemanager.labservices.models.PagedUsers; -import com.azure.resourcemanager.labservices.models.UserUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in UsersClient. */ -public final class UsersClientImpl implements UsersClient { - private final ClientLogger logger = new ClientLogger(UsersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final UsersService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of UsersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsersClientImpl(LabServicesClientImpl client) { - this.service = RestProxy.create(UsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientUsers to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientUse") - private interface UsersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/users") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLab( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/users/{userName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("userName") String username, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/users/{userName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("userName") String username, - @BodyParam("application/json") UserInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/users/{userName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("userName") String username, - @BodyParam("application/json") UserUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/users/{userName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("userName") String username, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/users/{userName}/invite") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> invite( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("userName") String username, - @BodyParam("application/json") InviteBody body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLabNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabSinglePageAsync( - String resourceGroupName, String labName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLab( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabSinglePageAsync( - String resourceGroupName, String labName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLab( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync(String resourceGroupName, String labName, String filter) { - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), - nextLink -> listByLabNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync(String resourceGroupName, String labName) { - final String filter = null; - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), - nextLink -> listByLabNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync( - String resourceGroupName, String labName, String filter, Context context) { - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter, context), - nextLink -> listByLabNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLab(String resourceGroupName, String labName) { - final String filter = null; - return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter)); - } - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLab( - String resourceGroupName, String labName, String filter, Context context) { - return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter, context)); - } - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String labName, String username) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - accept, - context); - } - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String username) { - return getWithResponseAsync(resourceGroupName, labName, username) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner get(String resourceGroupName, String labName, String username) { - return getAsync(resourceGroupName, labName, username).block(); - } - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labName, String username, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, context).block(); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String labName, String username, UserInner body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String labName, String username, UserInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - body, - accept, - context); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String username, UserInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, labName, username, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginCreateOrUpdateAsync( - String resourceGroupName, String labName, String username, UserInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, labName, username, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, UserInner> beginCreateOrUpdate( - String resourceGroupName, String labName, String username, UserInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body).getSyncPoller(); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, UserInner> beginCreateOrUpdate( - String resourceGroupName, String labName, String username, UserInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body, context).getSyncPoller(); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labName, String username, UserInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labName, String username, UserInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate(String resourceGroupName, String labName, String username, UserInner body) { - return createOrUpdateAsync(resourceGroupName, labName, username, body).block(); - } - - /** - * Operation to create or update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate( - String resourceGroupName, String labName, String username, UserInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, labName, username, body, context).block(); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String labName, String username, UserUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String labName, String username, UserUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - body, - accept, - context); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginUpdateAsync( - String resourceGroupName, String labName, String username, UserUpdate body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, labName, username, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginUpdateAsync( - String resourceGroupName, String labName, String username, UserUpdate body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, labName, username, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, UserInner> beginUpdate( - String resourceGroupName, String labName, String username, UserUpdate body) { - return beginUpdateAsync(resourceGroupName, labName, username, body).getSyncPoller(); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, UserInner> beginUpdate( - String resourceGroupName, String labName, String username, UserUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, labName, username, body, context).getSyncPoller(); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String labName, String username, UserUpdate body) { - return beginUpdateAsync(resourceGroupName, labName, username, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String labName, String username, UserUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, labName, username, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner update(String resourceGroupName, String labName, String username, UserUpdate body) { - return updateAsync(resourceGroupName, labName, username, body).block(); - } - - /** - * Operation to update a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner update( - String resourceGroupName, String labName, String username, UserUpdate body, Context context) { - return updateAsync(resourceGroupName, labName, username, body, context).block(); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labName, String username) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labName, String username, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - accept, - context); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labName, String username) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labName, String username, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username) { - return beginDeleteAsync(resourceGroupName, labName, username).getSyncPoller(); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labName, String username, Context context) { - return beginDeleteAsync(resourceGroupName, labName, username, context).getSyncPoller(); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username) { - return beginDeleteAsync(resourceGroupName, labName, username) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labName, String username, Context context) { - return beginDeleteAsync(resourceGroupName, labName, username, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String username) { - deleteAsync(resourceGroupName, labName, username).block(); - } - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labName, String username, Context context) { - deleteAsync(resourceGroupName, labName, username, context).block(); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> inviteWithResponseAsync( - String resourceGroupName, String labName, String username, InviteBody body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .invite( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> inviteWithResponseAsync( - String resourceGroupName, String labName, String username, InviteBody body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .invite( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - username, - body, - accept, - context); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginInviteAsync( - String resourceGroupName, String labName, String username, InviteBody body) { - Mono>> mono = inviteWithResponseAsync(resourceGroupName, labName, username, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginInviteAsync( - String resourceGroupName, String labName, String username, InviteBody body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - inviteWithResponseAsync(resourceGroupName, labName, username, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginInvite( - String resourceGroupName, String labName, String username, InviteBody body) { - return beginInviteAsync(resourceGroupName, labName, username, body).getSyncPoller(); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginInvite( - String resourceGroupName, String labName, String username, InviteBody body, Context context) { - return beginInviteAsync(resourceGroupName, labName, username, body, context).getSyncPoller(); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono inviteAsync(String resourceGroupName, String labName, String username, InviteBody body) { - return beginInviteAsync(resourceGroupName, labName, username, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono inviteAsync( - String resourceGroupName, String labName, String username, InviteBody body, Context context) { - return beginInviteAsync(resourceGroupName, labName, username, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void invite(String resourceGroupName, String labName, String username, InviteBody body) { - inviteAsync(resourceGroupName, labName, username, body).block(); - } - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context) { - inviteAsync(resourceGroupName, labName, username, body, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLabNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLabNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java deleted file mode 100644 index 1e5b8ca7555a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.UsersClient; -import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.InviteBody; -import com.azure.resourcemanager.labservices.models.User; -import com.azure.resourcemanager.labservices.models.Users; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class UsersImpl implements Users { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersImpl.class); - - private final UsersClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public UsersImpl(UsersClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByLab(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName); - return Utils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); - } - - public PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context) { - PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName, filter, context); - return Utils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); - } - - public User get(String resourceGroupName, String labName, String username) { - UserInner inner = this.serviceClient().get(resourceGroupName, labName, username); - if (inner != null) { - return new UserImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String resourceGroupName, String labName, String username, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, username, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new UserImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String labName, String username) { - this.serviceClient().delete(resourceGroupName, labName, username); - } - - public void delete(String resourceGroupName, String labName, String username, Context context) { - this.serviceClient().delete(resourceGroupName, labName, username, context); - } - - public void invite(String resourceGroupName, String labName, String username, InviteBody body) { - this.serviceClient().invite(resourceGroupName, labName, username, body); - } - - public void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context) { - this.serviceClient().invite(resourceGroupName, labName, username, body, context); - } - - public User getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String username = Utils.getValueFromIdByName(id, "users"); - if (username == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); - } - return this.getWithResponse(resourceGroupName, labName, username, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String username = Utils.getValueFromIdByName(id, "users"); - if (username == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); - } - return this.getWithResponse(resourceGroupName, labName, username, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String username = Utils.getValueFromIdByName(id, "users"); - if (username == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); - } - this.delete(resourceGroupName, labName, username, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labName = Utils.getValueFromIdByName(id, "labs"); - if (labName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); - } - String username = Utils.getValueFromIdByName(id, "users"); - if (username == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); - } - this.delete(resourceGroupName, labName, username, context); - } - - private UsersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } - - public UserImpl define(String name) { - return new UserImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/Utils.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/Utils.java deleted file mode 100644 index 29894877dfa2..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/Utils.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java deleted file mode 100644 index c97ab7308f22..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.labservices.models.ProvisioningState; -import com.azure.resourcemanager.labservices.models.VirtualMachine; -import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile; -import com.azure.resourcemanager.labservices.models.VirtualMachineState; -import com.azure.resourcemanager.labservices.models.VirtualMachineType; - -public final class VirtualMachineImpl implements VirtualMachine { - private VirtualMachineInner innerObject; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - VirtualMachineImpl( - VirtualMachineInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public VirtualMachineState state() { - return this.innerModel().state(); - } - - public VirtualMachineConnectionProfile connectionProfile() { - return this.innerModel().connectionProfile(); - } - - public String claimedByUserId() { - return this.innerModel().claimedByUserId(); - } - - public VirtualMachineType vmType() { - return this.innerModel().vmType(); - } - - public VirtualMachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java deleted file mode 100644 index 76cf2340485f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java +++ /dev/null @@ -1,2062 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.labservices.models.PagedVirtualMachines; -import com.azure.resourcemanager.labservices.models.ResetPasswordBody; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ -public final class VirtualMachinesClientImpl implements VirtualMachinesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachinesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualMachinesService service; - - /** The service client containing this operation class. */ - private final LabServicesClientImpl client; - - /** - * Initializes an instance of VirtualMachinesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachinesClientImpl(LabServicesClientImpl client) { - this.service = - RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LabServicesClientVirtualMachines to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LabServicesClientVir") - private interface VirtualMachinesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLab( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines/{virtualMachineName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines/{virtualMachineName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines/{virtualMachineName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines/{virtualMachineName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" - + "/{labName}/virtualMachines/{virtualMachineName}/resetPassword") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetPassword( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labName") String labName, - @PathParam("virtualMachineName") String virtualMachineName, - @BodyParam("application/json") ResetPasswordBody body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLabNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabSinglePageAsync( - String resourceGroupName, String labName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByLab( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabSinglePageAsync( - String resourceGroupName, String labName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLab( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync(String resourceGroupName, String labName, String filter) { - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), - nextLink -> listByLabNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync(String resourceGroupName, String labName) { - final String filter = null; - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), - nextLink -> listByLabNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByLabAsync( - String resourceGroupName, String labName, String filter, Context context) { - return new PagedFlux<>( - () -> listByLabSinglePageAsync(resourceGroupName, labName, filter, context), - nextLink -> listByLabNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLab(String resourceGroupName, String labName) { - final String filter = null; - return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter)); - } - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByLab( - String resourceGroupName, String labName, String filter, Context context) { - return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter, context)); - } - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context); - } - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String virtualMachineName) { - return getWithResponseAsync(resourceGroupName, labName, virtualMachineName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner get(String resourceGroupName, String labName, String virtualMachineName) { - return getAsync(resourceGroupName, labName, virtualMachineName).block(); - } - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, context).block(); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String labName, String virtualMachineName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, labName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String resourceGroupName, String labName, String virtualMachineName) { - return beginStartAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginStartAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String labName, String virtualMachineName) { - return beginStartAsync(resourceGroupName, labName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginStartAsync(resourceGroupName, labName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String labName, String virtualMachineName) { - startAsync(resourceGroupName, labName, virtualMachineName).block(); - } - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String labName, String virtualMachineName, Context context) { - startAsync(resourceGroupName, labName, virtualMachineName, context).block(); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String labName, String virtualMachineName) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String resourceGroupName, String labName, String virtualMachineName) { - return beginStopAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginStopAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String labName, String virtualMachineName) { - return beginStopAsync(resourceGroupName, labName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginStopAsync(resourceGroupName, labName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String labName, String virtualMachineName) { - stopAsync(resourceGroupName, labName, virtualMachineName).block(); - } - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String labName, String virtualMachineName, Context context) { - stopAsync(resourceGroupName, labName, virtualMachineName, context).block(); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .reimage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reimageWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .reimage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginReimageAsync( - String resourceGroupName, String labName, String virtualMachineName) { - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, labName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginReimageAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginReimage( - String resourceGroupName, String labName, String virtualMachineName) { - return beginReimageAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginReimage( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginReimageAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAsync(String resourceGroupName, String labName, String virtualMachineName) { - return beginReimageAsync(resourceGroupName, labName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reimageAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginReimageAsync(resourceGroupName, labName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String labName, String virtualMachineName) { - reimageAsync(resourceGroupName, labName, virtualMachineName).block(); - } - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String labName, String virtualMachineName, Context context) { - reimageAsync(resourceGroupName, labName, virtualMachineName, context).block(); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .redeploy( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> redeployWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .redeploy( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - accept, - context); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String labName, String virtualMachineName) { - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, labName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRedeployAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, String labName, String virtualMachineName) { - return beginRedeployAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRedeploy( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginRedeployAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync(String resourceGroupName, String labName, String virtualMachineName) { - return beginRedeployAsync(resourceGroupName, labName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono redeployAsync( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - return beginRedeployAsync(resourceGroupName, labName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String labName, String virtualMachineName) { - redeployAsync(resourceGroupName, labName, virtualMachineName).block(); - } - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context) { - redeployAsync(resourceGroupName, labName, virtualMachineName, context).block(); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetPasswordWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .resetPassword( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetPasswordWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resetPassword( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - labName, - virtualMachineName, - body, - accept, - context); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResetPasswordAsync( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { - Mono>> mono = - resetPasswordWithResponseAsync(resourceGroupName, labName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResetPasswordAsync( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetPasswordWithResponseAsync(resourceGroupName, labName, virtualMachineName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { - return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { - return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetPasswordAsync( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { - return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetPasswordAsync( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { - return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { - resetPasswordAsync(resourceGroupName, labName, virtualMachineName, body).block(); - } - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { - resetPasswordAsync(resourceGroupName, labName, virtualMachineName, body, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByLabNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByLabNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByLabNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.java deleted file mode 100644 index b6998cfb5ec5..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.labservices.models.ResetPasswordBody; -import com.azure.resourcemanager.labservices.models.VirtualMachine; -import com.azure.resourcemanager.labservices.models.VirtualMachines; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class VirtualMachinesImpl implements VirtualMachines { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinesImpl.class); - - private final VirtualMachinesClient innerClient; - - private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - - public VirtualMachinesImpl( - VirtualMachinesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByLab(String resourceGroupName, String labName) { - PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); - } - - public PagedIterable listByLab( - String resourceGroupName, String labName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByLab(resourceGroupName, labName, filter, context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); - } - - public VirtualMachine get(String resourceGroupName, String labName, String virtualMachineName) { - VirtualMachineInner inner = this.serviceClient().get(resourceGroupName, labName, virtualMachineName); - if (inner != null) { - return new VirtualMachineImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String labName, String virtualMachineName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, virtualMachineName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void start(String resourceGroupName, String labName, String virtualMachineName) { - this.serviceClient().start(resourceGroupName, labName, virtualMachineName); - } - - public void start(String resourceGroupName, String labName, String virtualMachineName, Context context) { - this.serviceClient().start(resourceGroupName, labName, virtualMachineName, context); - } - - public void stop(String resourceGroupName, String labName, String virtualMachineName) { - this.serviceClient().stop(resourceGroupName, labName, virtualMachineName); - } - - public void stop(String resourceGroupName, String labName, String virtualMachineName, Context context) { - this.serviceClient().stop(resourceGroupName, labName, virtualMachineName, context); - } - - public void reimage(String resourceGroupName, String labName, String virtualMachineName) { - this.serviceClient().reimage(resourceGroupName, labName, virtualMachineName); - } - - public void reimage(String resourceGroupName, String labName, String virtualMachineName, Context context) { - this.serviceClient().reimage(resourceGroupName, labName, virtualMachineName, context); - } - - public void redeploy(String resourceGroupName, String labName, String virtualMachineName) { - this.serviceClient().redeploy(resourceGroupName, labName, virtualMachineName); - } - - public void redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context) { - this.serviceClient().redeploy(resourceGroupName, labName, virtualMachineName, context); - } - - public void resetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { - this.serviceClient().resetPassword(resourceGroupName, labName, virtualMachineName, body); - } - - public void resetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { - this.serviceClient().resetPassword(resourceGroupName, labName, virtualMachineName, body, context); - } - - private VirtualMachinesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.LabServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java deleted file mode 100644 index 9f41a464c19a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the implementations for LabServicesClient. REST API for managing Azure Lab Services images. */ -package com.azure.resourcemanager.labservices.implementation; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java deleted file mode 100644 index 5b64ac876510..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ActionType. */ -public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - @JsonCreator - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** @return known ActionType values. */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java deleted file mode 100644 index 4ed699bbaf4a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** Profile for how to handle shutting down virtual machines. */ -@Fluent -public final class AutoShutdownProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoShutdownProfile.class); - - /* - * Whether shutdown on disconnect is enabled - */ - @JsonProperty(value = "shutdownOnDisconnect") - private EnableState shutdownOnDisconnect; - - /* - * Whether a VM will get shutdown when it hasn't been connected to after a - * period of time. - */ - @JsonProperty(value = "shutdownWhenNotConnected") - private EnableState shutdownWhenNotConnected; - - /* - * Whether a VM will get shutdown when it has idled for a period of time. - */ - @JsonProperty(value = "shutdownOnIdle") - private ShutdownOnIdleMode shutdownOnIdle; - - /* - * The amount of time a VM will stay running after a user disconnects if - * this behavior is enabled. - */ - @JsonProperty(value = "disconnectDelay") - private Duration disconnectDelay; - - /* - * The amount of time a VM will stay running before it is shutdown if no - * connection is made and this behavior is enabled. - */ - @JsonProperty(value = "noConnectDelay") - private Duration noConnectDelay; - - /* - * The amount of time a VM will idle before it is shutdown if this behavior - * is enabled. - */ - @JsonProperty(value = "idleDelay") - private Duration idleDelay; - - /** - * Get the shutdownOnDisconnect property: Whether shutdown on disconnect is enabled. - * - * @return the shutdownOnDisconnect value. - */ - public EnableState shutdownOnDisconnect() { - return this.shutdownOnDisconnect; - } - - /** - * Set the shutdownOnDisconnect property: Whether shutdown on disconnect is enabled. - * - * @param shutdownOnDisconnect the shutdownOnDisconnect value to set. - * @return the AutoShutdownProfile object itself. - */ - public AutoShutdownProfile withShutdownOnDisconnect(EnableState shutdownOnDisconnect) { - this.shutdownOnDisconnect = shutdownOnDisconnect; - return this; - } - - /** - * Get the shutdownWhenNotConnected property: Whether a VM will get shutdown when it hasn't been connected to after - * a period of time. - * - * @return the shutdownWhenNotConnected value. - */ - public EnableState shutdownWhenNotConnected() { - return this.shutdownWhenNotConnected; - } - - /** - * Set the shutdownWhenNotConnected property: Whether a VM will get shutdown when it hasn't been connected to after - * a period of time. - * - * @param shutdownWhenNotConnected the shutdownWhenNotConnected value to set. - * @return the AutoShutdownProfile object itself. - */ - public AutoShutdownProfile withShutdownWhenNotConnected(EnableState shutdownWhenNotConnected) { - this.shutdownWhenNotConnected = shutdownWhenNotConnected; - return this; - } - - /** - * Get the shutdownOnIdle property: Whether a VM will get shutdown when it has idled for a period of time. - * - * @return the shutdownOnIdle value. - */ - public ShutdownOnIdleMode shutdownOnIdle() { - return this.shutdownOnIdle; - } - - /** - * Set the shutdownOnIdle property: Whether a VM will get shutdown when it has idled for a period of time. - * - * @param shutdownOnIdle the shutdownOnIdle value to set. - * @return the AutoShutdownProfile object itself. - */ - public AutoShutdownProfile withShutdownOnIdle(ShutdownOnIdleMode shutdownOnIdle) { - this.shutdownOnIdle = shutdownOnIdle; - return this; - } - - /** - * Get the disconnectDelay property: The amount of time a VM will stay running after a user disconnects if this - * behavior is enabled. - * - * @return the disconnectDelay value. - */ - public Duration disconnectDelay() { - return this.disconnectDelay; - } - - /** - * Set the disconnectDelay property: The amount of time a VM will stay running after a user disconnects if this - * behavior is enabled. - * - * @param disconnectDelay the disconnectDelay value to set. - * @return the AutoShutdownProfile object itself. - */ - public AutoShutdownProfile withDisconnectDelay(Duration disconnectDelay) { - this.disconnectDelay = disconnectDelay; - return this; - } - - /** - * Get the noConnectDelay property: The amount of time a VM will stay running before it is shutdown if no connection - * is made and this behavior is enabled. - * - * @return the noConnectDelay value. - */ - public Duration noConnectDelay() { - return this.noConnectDelay; - } - - /** - * Set the noConnectDelay property: The amount of time a VM will stay running before it is shutdown if no connection - * is made and this behavior is enabled. - * - * @param noConnectDelay the noConnectDelay value to set. - * @return the AutoShutdownProfile object itself. - */ - public AutoShutdownProfile withNoConnectDelay(Duration noConnectDelay) { - this.noConnectDelay = noConnectDelay; - return this; - } - - /** - * Get the idleDelay property: The amount of time a VM will idle before it is shutdown if this behavior is enabled. - * - * @return the idleDelay value. - */ - public Duration idleDelay() { - return this.idleDelay; - } - - /** - * Set the idleDelay property: The amount of time a VM will idle before it is shutdown if this behavior is enabled. - * - * @param idleDelay the idleDelay value to set. - * @return the AutoShutdownProfile object itself. - */ - public AutoShutdownProfile withIdleDelay(Duration idleDelay) { - this.idleDelay = idleDelay; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java deleted file mode 100644 index a6d2ae482a95..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Connection profile for how users connect to lab virtual machines. */ -@Fluent -public final class ConnectionProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionProfile.class); - - /* - * The enabled access level for Web Access over SSH. - */ - @JsonProperty(value = "webSshAccess") - private ConnectionType webSshAccess; - - /* - * The enabled access level for Web Access over RDP. - */ - @JsonProperty(value = "webRdpAccess") - private ConnectionType webRdpAccess; - - /* - * The enabled access level for Client Access over SSH. - */ - @JsonProperty(value = "clientSshAccess") - private ConnectionType clientSshAccess; - - /* - * The enabled access level for Client Access over RDP. - */ - @JsonProperty(value = "clientRdpAccess") - private ConnectionType clientRdpAccess; - - /** - * Get the webSshAccess property: The enabled access level for Web Access over SSH. - * - * @return the webSshAccess value. - */ - public ConnectionType webSshAccess() { - return this.webSshAccess; - } - - /** - * Set the webSshAccess property: The enabled access level for Web Access over SSH. - * - * @param webSshAccess the webSshAccess value to set. - * @return the ConnectionProfile object itself. - */ - public ConnectionProfile withWebSshAccess(ConnectionType webSshAccess) { - this.webSshAccess = webSshAccess; - return this; - } - - /** - * Get the webRdpAccess property: The enabled access level for Web Access over RDP. - * - * @return the webRdpAccess value. - */ - public ConnectionType webRdpAccess() { - return this.webRdpAccess; - } - - /** - * Set the webRdpAccess property: The enabled access level for Web Access over RDP. - * - * @param webRdpAccess the webRdpAccess value to set. - * @return the ConnectionProfile object itself. - */ - public ConnectionProfile withWebRdpAccess(ConnectionType webRdpAccess) { - this.webRdpAccess = webRdpAccess; - return this; - } - - /** - * Get the clientSshAccess property: The enabled access level for Client Access over SSH. - * - * @return the clientSshAccess value. - */ - public ConnectionType clientSshAccess() { - return this.clientSshAccess; - } - - /** - * Set the clientSshAccess property: The enabled access level for Client Access over SSH. - * - * @param clientSshAccess the clientSshAccess value to set. - * @return the ConnectionProfile object itself. - */ - public ConnectionProfile withClientSshAccess(ConnectionType clientSshAccess) { - this.clientSshAccess = clientSshAccess; - return this; - } - - /** - * Get the clientRdpAccess property: The enabled access level for Client Access over RDP. - * - * @return the clientRdpAccess value. - */ - public ConnectionType clientRdpAccess() { - return this.clientRdpAccess; - } - - /** - * Set the clientRdpAccess property: The enabled access level for Client Access over RDP. - * - * @param clientRdpAccess the clientRdpAccess value to set. - * @return the ConnectionProfile object itself. - */ - public ConnectionProfile withClientRdpAccess(ConnectionType clientRdpAccess) { - this.clientRdpAccess = clientRdpAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.java deleted file mode 100644 index 2398502e21d3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ConnectionType. */ -public enum ConnectionType { - /** Enum value Public. */ - PUBLIC("Public"), - - /** Enum value Private. */ - PRIVATE("Private"), - - /** Enum value None. */ - NONE("None"); - - /** The actual serialized value for a ConnectionType instance. */ - private final String value; - - ConnectionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ConnectionType instance. - * - * @param value the serialized value to parse. - * @return the parsed ConnectionType object, or null if unable to parse. - */ - @JsonCreator - public static ConnectionType fromString(String value) { - ConnectionType[] items = ConnectionType.values(); - for (ConnectionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.java deleted file mode 100644 index b71b324c9c6e..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for CreateOption. */ -public enum CreateOption { - /** Enum value Image. */ - IMAGE("Image"), - - /** Enum value TemplateVM. */ - TEMPLATE_VM("TemplateVM"); - - /** The actual serialized value for a CreateOption instance. */ - private final String value; - - CreateOption(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a CreateOption instance. - * - * @param value the serialized value to parse. - * @return the parsed CreateOption object, or null if unable to parse. - */ - @JsonCreator - public static CreateOption fromString(String value) { - CreateOption[] items = CreateOption.values(); - for (CreateOption item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Credentials.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Credentials.java deleted file mode 100644 index f771f84b95d8..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Credentials.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Credentials for a user on a lab VM. */ -@Fluent -public final class Credentials { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Credentials.class); - - /* - * The username to use when signing in to lab VMs. - */ - @JsonProperty(value = "username", required = true) - private String username; - - /* - * The password for the user. This is required for the TemplateVM - * createOption. - */ - @JsonProperty(value = "password") - private String password; - - /** - * Get the username property: The username to use when signing in to lab VMs. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The username to use when signing in to lab VMs. - * - * @param username the username value to set. - * @return the Credentials object itself. - */ - public Credentials withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the password property: The password for the user. This is required for the TemplateVM createOption. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password for the user. This is required for the TemplateVM createOption. - * - * @param password the password value to set. - * @return the Credentials object itself. - */ - public Credentials withPassword(String password) { - this.password = password; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (username() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property username in model Credentials")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.java deleted file mode 100644 index 4c0aae95c00c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for EnableState. */ -public enum EnableState { - /** Enum value Enabled. */ - ENABLED("Enabled"), - - /** Enum value Disabled. */ - DISABLED("Disabled"); - - /** The actual serialized value for a EnableState instance. */ - private final String value; - - EnableState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EnableState instance. - * - * @param value the serialized value to parse. - * @return the parsed EnableState object, or null if unable to parse. - */ - @JsonCreator - public static EnableState fromString(String value) { - EnableState[] items = EnableState.values(); - for (EnableState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java deleted file mode 100644 index b90c5af8656a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.ImageInner; -import java.util.List; - -/** An immutable client-side representation of Image. */ -public interface Image { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the image. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Current provisioning state of the image. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the displayName property: The image display name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: A description of the image. - * - * @return the description value. - */ - String description(); - - /** - * Gets the iconUrl property: URL of the image icon. - * - * @return the iconUrl value. - */ - String iconUrl(); - - /** - * Gets the author property: The image author. - * - * @return the author value. - */ - String author(); - - /** - * Gets the osType property: The OS Type of the image. - * - * @return the osType value. - */ - OsType osType(); - - /** - * Gets the plan property: The ID of marketplace plan associated with the image (optional). - * - * @return the plan value. - */ - String plan(); - - /** - * Gets the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted). - * - * @return the termsStatus value. - */ - EnableState termsStatus(); - - /** - * Gets the offer property: The ID of an offer associated with the image. - * - * @return the offer value. - */ - String offer(); - - /** - * Gets the publisher property: The ID of the publisher of the image. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the sku property: The image SKU. - * - * @return the sku value. - */ - String sku(); - - /** - * Gets the version property: The image version. - * - * @return the version value. - */ - String version(); - - /** - * Gets the sharedGalleryId property: The ID for the image in the shared gallery. - * - * @return the sharedGalleryId value. - */ - String sharedGalleryId(); - - /** - * Gets the availableRegions property: The available regions of the image in the shared gallery. - * - * @return the availableRegions value. - */ - List availableRegions(); - - /** - * Gets the osState property: The OS State of the image. - * - * @return the osState value. - */ - OsState osState(); - - /** - * Gets the enabledState property: Is the image enabled. - * - * @return the enabledState value. - */ - EnableState enabledState(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.ImageInner object. - * - * @return the inner object. - */ - ImageInner innerModel(); - - /** The entirety of the Image definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The Image definition stages. */ - interface DefinitionStages { - /** The first stage of the Image definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the Image definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, labPlanName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. - * Used in resource URIs and in UI. - * @return the next definition stage. - */ - WithCreate withExistingLabPlan(String resourceGroupName, String labPlanName); - } - /** - * The stage of the Image definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithAvailableRegions, DefinitionStages.WithEnabledState { - /** - * Executes the create request. - * - * @return the created resource. - */ - Image create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Image create(Context context); - } - /** The stage of the Image definition allowing to specify availableRegions. */ - interface WithAvailableRegions { - /** - * Specifies the availableRegions property: The available regions of the image in the shared gallery.. - * - * @param availableRegions The available regions of the image in the shared gallery. - * @return the next definition stage. - */ - WithCreate withAvailableRegions(List availableRegions); - } - /** The stage of the Image definition allowing to specify enabledState. */ - interface WithEnabledState { - /** - * Specifies the enabledState property: Is the image enabled. - * - * @param enabledState Is the image enabled. - * @return the next definition stage. - */ - WithCreate withEnabledState(EnableState enabledState); - } - } - /** - * Begins update for the Image resource. - * - * @return the stage of resource update. - */ - Image.Update update(); - - /** The template for Image update. */ - interface Update extends UpdateStages.WithEnabledState { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Image apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Image apply(Context context); - } - /** The Image update stages. */ - interface UpdateStages { - /** The stage of the Image update allowing to specify enabledState. */ - interface WithEnabledState { - /** - * Specifies the enabledState property: Is the image enabled. - * - * @param enabledState Is the image enabled. - * @return the next definition stage. - */ - Update withEnabledState(EnableState enabledState); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Image refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Image refresh(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageReference.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageReference.java deleted file mode 100644 index 1af0ae7578b2..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageReference.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Image reference information. Used in the virtual machine profile. */ -@Fluent -public final class ImageReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageReference.class); - - /* - * Image resource ID - */ - @JsonProperty(value = "id") - private String id; - - /* - * The image offer if applicable. - */ - @JsonProperty(value = "offer") - private String offer; - - /* - * The image publisher - */ - @JsonProperty(value = "publisher") - private String publisher; - - /* - * The image SKU - */ - @JsonProperty(value = "sku") - private String sku; - - /* - * The image version specified on creation. - */ - @JsonProperty(value = "version") - private String version; - - /* - * The actual version of the image after use. - */ - @JsonProperty(value = "exactVersion", access = JsonProperty.Access.WRITE_ONLY) - private String exactVersion; - - /** - * Get the id property: Image resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Image resource ID. - * - * @param id the id value to set. - * @return the ImageReference object itself. - */ - public ImageReference withId(String id) { - this.id = id; - return this; - } - - /** - * Get the offer property: The image offer if applicable. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Set the offer property: The image offer if applicable. - * - * @param offer the offer value to set. - * @return the ImageReference object itself. - */ - public ImageReference withOffer(String offer) { - this.offer = offer; - return this; - } - - /** - * Get the publisher property: The image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The image publisher. - * - * @param publisher the publisher value to set. - * @return the ImageReference object itself. - */ - public ImageReference withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the sku property: The image SKU. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: The image SKU. - * - * @param sku the sku value to set. - * @return the ImageReference object itself. - */ - public ImageReference withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the version property: The image version specified on creation. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The image version specified on creation. - * - * @param version the version value to set. - * @return the ImageReference object itself. - */ - public ImageReference withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the exactVersion property: The actual version of the image after use. - * - * @return the exactVersion value. - */ - public String exactVersion() { - return this.exactVersion; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java deleted file mode 100644 index bc2c12d2b645..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.ImageUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Lab services virtual machine image for updates. */ -@Fluent -public final class ImageUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdate.class); - - /* - * Image resource properties - */ - @JsonProperty(value = "properties") - private ImageUpdateProperties innerProperties; - - /** - * Get the innerProperties property: Image resource properties. - * - * @return the innerProperties value. - */ - private ImageUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the enabledState property: Is the image enabled. - * - * @return the enabledState value. - */ - public EnableState enabledState() { - return this.innerProperties() == null ? null : this.innerProperties().enabledState(); - } - - /** - * Set the enabledState property: Is the image enabled. - * - * @param enabledState the enabledState value to set. - * @return the ImageUpdate object itself. - */ - public ImageUpdate withEnabledState(EnableState enabledState) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageUpdateProperties(); - } - this.innerProperties().withEnabledState(enabledState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java deleted file mode 100644 index 4bf6d4b5e604..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Images. */ -public interface Images { - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - PagedIterable listByLabPlan(String resourceGroupName, String labPlanName); - - /** - * Gets all images from galleries attached to a lab plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all images from galleries attached to a lab plan. - */ - PagedIterable listByLabPlan(String resourceGroupName, String labPlanName, String filter, Context context); - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource. - */ - Image get(String resourceGroupName, String labPlanName, String imageName); - - /** - * Gets an image resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param imageName The image name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String labPlanName, String imageName, Context context); - - /** - * Gets an image resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response}. - */ - Image getById(String id); - - /** - * Gets an image resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an image resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Image resource. - * - * @param name resource name. - * @return the first stage of the new Image definition. - */ - Image.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.java deleted file mode 100644 index ae6383ad0eaa..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for InvitationState. */ -public enum InvitationState { - /** Enum value NotSent. */ - NOT_SENT("NotSent"), - - /** Enum value Sending. */ - SENDING("Sending"), - - /** Enum value Sent. */ - SENT("Sent"), - - /** Enum value Failed. */ - FAILED("Failed"); - - /** The actual serialized value for a InvitationState instance. */ - private final String value; - - InvitationState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InvitationState instance. - * - * @param value the serialized value to parse. - * @return the parsed InvitationState object, or null if unable to parse. - */ - @JsonCreator - public static InvitationState fromString(String value) { - InvitationState[] items = InvitationState.values(); - for (InvitationState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InviteBody.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InviteBody.java deleted file mode 100644 index 0e7f4aac474f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InviteBody.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Body for a user invite request. */ -@Fluent -public final class InviteBody { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InviteBody.class); - - /* - * Custom text for the invite email. - */ - @JsonProperty(value = "text") - private String text; - - /** - * Get the text property: Custom text for the invite email. - * - * @return the text value. - */ - public String text() { - return this.text; - } - - /** - * Set the text property: Custom text for the invite email. - * - * @param text the text value to set. - * @return the InviteBody object itself. - */ - public InviteBody withText(String text) { - this.text = text; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java deleted file mode 100644 index abfde36b0d2d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of Lab. */ -public interface Lab { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the lab. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Current provisioning state of the lab. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile - * cannot be modified once a lab has been created. - * - * @return the networkProfile value. - */ - LabNetworkProfile networkProfile(); - - /** - * Gets the state property: The lab state. - * - * @return the state value. - */ - LabState state(); - - /** - * Gets the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls - * whether actions are taken on resources that are sitting idle. - * - * @return the autoShutdownProfile value. - */ - AutoShutdownProfile autoShutdownProfile(); - - /** - * Gets the connectionProfile property: The connection profile for the lab. This controls settings such as web - * access to lab resources or whether RDP or SSH ports are open. - * - * @return the connectionProfile value. - */ - ConnectionProfile connectionProfile(); - - /** - * Gets the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @return the virtualMachineProfile value. - */ - VirtualMachineProfile virtualMachineProfile(); - - /** - * Gets the securityProfile property: The lab security profile. - * - * @return the securityProfile value. - */ - SecurityProfile securityProfile(); - - /** - * Gets the rosterProfile property: The lab user list management profile. - * - * @return the rosterProfile value. - */ - RosterProfile rosterProfile(); - - /** - * Gets the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts - * as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @return the labPlanId value. - */ - String labPlanId(); - - /** - * Gets the title property: The title of the lab. - * - * @return the title value. - */ - String title(); - - /** - * Gets the description property: The description of the lab. - * - * @return the description value. - */ - String description(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.LabInner object. - * - * @return the inner object. - */ - LabInner innerModel(); - - /** The entirety of the Lab definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The Lab definition stages. */ - interface DefinitionStages { - /** The first stage of the Lab definition. */ - interface Blank extends WithLocation { - } - /** The stage of the Lab definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the Lab definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the Lab definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithNetworkProfile, - DefinitionStages.WithAutoShutdownProfile, - DefinitionStages.WithConnectionProfile, - DefinitionStages.WithVirtualMachineProfile, - DefinitionStages.WithSecurityProfile, - DefinitionStages.WithRosterProfile, - DefinitionStages.WithLabPlanId, - DefinitionStages.WithTitle, - DefinitionStages.WithDescription { - /** - * Executes the create request. - * - * @return the created resource. - */ - Lab create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Lab create(Context context); - } - /** The stage of the Lab definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the Lab definition allowing to specify networkProfile. */ - interface WithNetworkProfile { - /** - * Specifies the networkProfile property: The network profile for the lab, typically applied via a lab plan. - * This profile cannot be modified once a lab has been created.. - * - * @param networkProfile The network profile for the lab, typically applied via a lab plan. This profile - * cannot be modified once a lab has been created. - * @return the next definition stage. - */ - WithCreate withNetworkProfile(LabNetworkProfile networkProfile); - } - /** The stage of the Lab definition allowing to specify autoShutdownProfile. */ - interface WithAutoShutdownProfile { - /** - * Specifies the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This - * controls whether actions are taken on resources that are sitting idle.. - * - * @param autoShutdownProfile The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * @return the next definition stage. - */ - WithCreate withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile); - } - /** The stage of the Lab definition allowing to specify connectionProfile. */ - interface WithConnectionProfile { - /** - * Specifies the connectionProfile property: The connection profile for the lab. This controls settings such - * as web access to lab resources or whether RDP or SSH ports are open.. - * - * @param connectionProfile The connection profile for the lab. This controls settings such as web access to - * lab resources or whether RDP or SSH ports are open. - * @return the next definition stage. - */ - WithCreate withConnectionProfile(ConnectionProfile connectionProfile); - } - /** The stage of the Lab definition allowing to specify virtualMachineProfile. */ - interface WithVirtualMachineProfile { - /** - * Specifies the virtualMachineProfile property: The profile used for creating lab virtual machines.. - * - * @param virtualMachineProfile The profile used for creating lab virtual machines. - * @return the next definition stage. - */ - WithCreate withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile); - } - /** The stage of the Lab definition allowing to specify securityProfile. */ - interface WithSecurityProfile { - /** - * Specifies the securityProfile property: The lab security profile.. - * - * @param securityProfile The lab security profile. - * @return the next definition stage. - */ - WithCreate withSecurityProfile(SecurityProfile securityProfile); - } - /** The stage of the Lab definition allowing to specify rosterProfile. */ - interface WithRosterProfile { - /** - * Specifies the rosterProfile property: The lab user list management profile.. - * - * @param rosterProfile The lab user list management profile. - * @return the next definition stage. - */ - WithCreate withRosterProfile(RosterProfile rosterProfile); - } - /** The stage of the Lab definition allowing to specify labPlanId. */ - interface WithLabPlanId { - /** - * Specifies the labPlanId property: The ID of the lab plan. Used during resource creation to provide - * defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId - * on an existing lab provides organization... - * - * @param labPlanId The ID of the lab plan. Used during resource creation to provide defaults and acts as a - * permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab - * provides organization.. - * @return the next definition stage. - */ - WithCreate withLabPlanId(String labPlanId); - } - /** The stage of the Lab definition allowing to specify title. */ - interface WithTitle { - /** - * Specifies the title property: The title of the lab.. - * - * @param title The title of the lab. - * @return the next definition stage. - */ - WithCreate withTitle(String title); - } - /** The stage of the Lab definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: The description of the lab.. - * - * @param description The description of the lab. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - } - /** - * Begins update for the Lab resource. - * - * @return the stage of resource update. - */ - Lab.Update update(); - - /** The template for Lab update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithAutoShutdownProfile, - UpdateStages.WithConnectionProfile, - UpdateStages.WithVirtualMachineProfile, - UpdateStages.WithSecurityProfile, - UpdateStages.WithRosterProfile, - UpdateStages.WithLabPlanId, - UpdateStages.WithTitle, - UpdateStages.WithDescription { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Lab apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Lab apply(Context context); - } - /** The Lab update stages. */ - interface UpdateStages { - /** The stage of the Lab update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(List tags); - } - /** The stage of the Lab update allowing to specify autoShutdownProfile. */ - interface WithAutoShutdownProfile { - /** - * Specifies the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This - * controls whether actions are taken on resources that are sitting idle.. - * - * @param autoShutdownProfile The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * @return the next definition stage. - */ - Update withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile); - } - /** The stage of the Lab update allowing to specify connectionProfile. */ - interface WithConnectionProfile { - /** - * Specifies the connectionProfile property: The connection profile for the lab. This controls settings such - * as web access to lab resources or whether RDP or SSH ports are open.. - * - * @param connectionProfile The connection profile for the lab. This controls settings such as web access to - * lab resources or whether RDP or SSH ports are open. - * @return the next definition stage. - */ - Update withConnectionProfile(ConnectionProfile connectionProfile); - } - /** The stage of the Lab update allowing to specify virtualMachineProfile. */ - interface WithVirtualMachineProfile { - /** - * Specifies the virtualMachineProfile property: The profile used for creating lab virtual machines.. - * - * @param virtualMachineProfile The profile used for creating lab virtual machines. - * @return the next definition stage. - */ - Update withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile); - } - /** The stage of the Lab update allowing to specify securityProfile. */ - interface WithSecurityProfile { - /** - * Specifies the securityProfile property: The lab security profile.. - * - * @param securityProfile The lab security profile. - * @return the next definition stage. - */ - Update withSecurityProfile(SecurityProfile securityProfile); - } - /** The stage of the Lab update allowing to specify rosterProfile. */ - interface WithRosterProfile { - /** - * Specifies the rosterProfile property: The lab user list management profile.. - * - * @param rosterProfile The lab user list management profile. - * @return the next definition stage. - */ - Update withRosterProfile(RosterProfile rosterProfile); - } - /** The stage of the Lab update allowing to specify labPlanId. */ - interface WithLabPlanId { - /** - * Specifies the labPlanId property: The ID of the lab plan. Used during resource creation to provide - * defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId - * on an existing lab provides organization... - * - * @param labPlanId The ID of the lab plan. Used during resource creation to provide defaults and acts as a - * permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab - * provides organization.. - * @return the next definition stage. - */ - Update withLabPlanId(String labPlanId); - } - /** The stage of the Lab update allowing to specify title. */ - interface WithTitle { - /** - * Specifies the title property: The title of the lab.. - * - * @param title The title of the lab. - * @return the next definition stage. - */ - Update withTitle(String title); - } - /** The stage of the Lab update allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: The description of the lab.. - * - * @param description The description of the lab. - * @return the next definition stage. - */ - Update withDescription(String description); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Lab refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Lab refresh(Context context); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void publish(); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void publish(Context context); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void syncGroup(); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void syncGroup(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java deleted file mode 100644 index 59ac85fe3d45..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for how to handle networking for Labs. */ -@Fluent -public final class LabNetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabNetworkProfile.class); - - /* - * The external subnet resource id - */ - @JsonProperty(value = "subnetId") - private String subnetId; - - /* - * The external load balancer resource id - */ - @JsonProperty(value = "loadBalancerId") - private String loadBalancerId; - - /* - * The external public IP resource id - */ - @JsonProperty(value = "publicIpId") - private String publicIpId; - - /** - * Get the subnetId property: The external subnet resource id. - * - * @return the subnetId value. - */ - public String subnetId() { - return this.subnetId; - } - - /** - * Set the subnetId property: The external subnet resource id. - * - * @param subnetId the subnetId value to set. - * @return the LabNetworkProfile object itself. - */ - public LabNetworkProfile withSubnetId(String subnetId) { - this.subnetId = subnetId; - return this; - } - - /** - * Get the loadBalancerId property: The external load balancer resource id. - * - * @return the loadBalancerId value. - */ - public String loadBalancerId() { - return this.loadBalancerId; - } - - /** - * Set the loadBalancerId property: The external load balancer resource id. - * - * @param loadBalancerId the loadBalancerId value to set. - * @return the LabNetworkProfile object itself. - */ - public LabNetworkProfile withLoadBalancerId(String loadBalancerId) { - this.loadBalancerId = loadBalancerId; - return this; - } - - /** - * Get the publicIpId property: The external public IP resource id. - * - * @return the publicIpId value. - */ - public String publicIpId() { - return this.publicIpId; - } - - /** - * Set the publicIpId property: The external public IP resource id. - * - * @param publicIpId the publicIpId value to set. - * @return the LabNetworkProfile object itself. - */ - public LabNetworkProfile withPublicIpId(String publicIpId) { - this.publicIpId = publicIpId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java deleted file mode 100644 index a86ddfeb3a41..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of LabPlan. */ -public interface LabPlan { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the lab plan. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Current provisioning state of the lab plan. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultConnectionProfile value. - */ - ConnectionProfile defaultConnectionProfile(); - - /** - * Gets the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultAutoShutdownProfile value. - */ - AutoShutdownProfile defaultAutoShutdownProfile(); - - /** - * Gets the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @return the defaultNetworkProfile value. - */ - LabPlanNetworkProfile defaultNetworkProfile(); - - /** - * Gets the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this - * lab plan. - * - * @return the allowedRegions value. - */ - List allowedRegions(); - - /** - * Gets the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @return the sharedGalleryId value. - */ - String sharedGalleryId(); - - /** - * Gets the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @return the supportInfo value. - */ - SupportInfo supportInfo(); - - /** - * Gets the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @return the linkedLmsInstance value. - */ - String linkedLmsInstance(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.LabPlanInner object. - * - * @return the inner object. - */ - LabPlanInner innerModel(); - - /** The entirety of the LabPlan definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The LabPlan definition stages. */ - interface DefinitionStages { - /** The first stage of the LabPlan definition. */ - interface Blank extends WithLocation { - } - /** The stage of the LabPlan definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the LabPlan definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the LabPlan definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithDefaultConnectionProfile, - DefinitionStages.WithDefaultAutoShutdownProfile, - DefinitionStages.WithDefaultNetworkProfile, - DefinitionStages.WithAllowedRegions, - DefinitionStages.WithSharedGalleryId, - DefinitionStages.WithSupportInfo, - DefinitionStages.WithLinkedLmsInstance { - /** - * Executes the create request. - * - * @return the created resource. - */ - LabPlan create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - LabPlan create(Context context); - } - /** The stage of the LabPlan definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the LabPlan definition allowing to specify defaultConnectionProfile. */ - interface WithDefaultConnectionProfile { - /** - * Specifies the defaultConnectionProfile property: The default lab connection profile. This can be changed - * on a lab resource and only provides a default profile.. - * - * @param defaultConnectionProfile The default lab connection profile. This can be changed on a lab resource - * and only provides a default profile. - * @return the next definition stage. - */ - WithCreate withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile); - } - /** The stage of the LabPlan definition allowing to specify defaultAutoShutdownProfile. */ - interface WithDefaultAutoShutdownProfile { - /** - * Specifies the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed - * on a lab resource and only provides a default profile.. - * - * @param defaultAutoShutdownProfile The default lab shutdown profile. This can be changed on a lab resource - * and only provides a default profile. - * @return the next definition stage. - */ - WithCreate withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile); - } - /** The stage of the LabPlan definition allowing to specify defaultNetworkProfile. */ - interface WithDefaultNetworkProfile { - /** - * Specifies the defaultNetworkProfile property: The lab plan network profile. To enforce lab network - * policies they must be defined here and cannot be changed when there are existing labs associated with - * this lab plan.. - * - * @param defaultNetworkProfile The lab plan network profile. To enforce lab network policies they must be - * defined here and cannot be changed when there are existing labs associated with this lab plan. - * @return the next definition stage. - */ - WithCreate withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile); - } - /** The stage of the LabPlan definition allowing to specify allowedRegions. */ - interface WithAllowedRegions { - /** - * Specifies the allowedRegions property: The allowed regions for the lab creator to use when creating labs - * using this lab plan.. - * - * @param allowedRegions The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * @return the next definition stage. - */ - WithCreate withAllowedRegions(List allowedRegions); - } - /** The stage of the LabPlan definition allowing to specify sharedGalleryId. */ - interface WithSharedGalleryId { - /** - * Specifies the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab - * plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared - * images from the gallery can be made available to use when creating new labs.. - * - * @param sharedGalleryId Resource ID of the Shared Image Gallery attached to this lab plan. When saving a - * lab template virtual machine image it will be persisted in this gallery. Shared images from the - * gallery can be made available to use when creating new labs. - * @return the next definition stage. - */ - WithCreate withSharedGalleryId(String sharedGalleryId); - } - /** The stage of the LabPlan definition allowing to specify supportInfo. */ - interface WithSupportInfo { - /** - * Specifies the supportInfo property: Support contact information and instructions for users of the lab - * plan. This information is displayed to lab owners and virtual machine users for all labs in the lab - * plan.. - * - * @param supportInfo Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * @return the next definition stage. - */ - WithCreate withSupportInfo(SupportInfo supportInfo); - } - /** The stage of the LabPlan definition allowing to specify linkedLmsInstance. */ - interface WithLinkedLmsInstance { - /** - * Specifies the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters - * against.. - * - * @param linkedLmsInstance Base Url of the lms instance this lab plan can link lab rosters against. - * @return the next definition stage. - */ - WithCreate withLinkedLmsInstance(String linkedLmsInstance); - } - } - /** - * Begins update for the LabPlan resource. - * - * @return the stage of resource update. - */ - LabPlan.Update update(); - - /** The template for LabPlan update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithDefaultConnectionProfile, - UpdateStages.WithDefaultAutoShutdownProfile, - UpdateStages.WithDefaultNetworkProfile, - UpdateStages.WithAllowedRegions, - UpdateStages.WithSharedGalleryId, - UpdateStages.WithSupportInfo, - UpdateStages.WithLinkedLmsInstance { - /** - * Executes the update request. - * - * @return the updated resource. - */ - LabPlan apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - LabPlan apply(Context context); - } - /** The LabPlan update stages. */ - interface UpdateStages { - /** The stage of the LabPlan update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(List tags); - } - /** The stage of the LabPlan update allowing to specify defaultConnectionProfile. */ - interface WithDefaultConnectionProfile { - /** - * Specifies the defaultConnectionProfile property: The default lab connection profile. This can be changed - * on a lab resource and only provides a default profile.. - * - * @param defaultConnectionProfile The default lab connection profile. This can be changed on a lab resource - * and only provides a default profile. - * @return the next definition stage. - */ - Update withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile); - } - /** The stage of the LabPlan update allowing to specify defaultAutoShutdownProfile. */ - interface WithDefaultAutoShutdownProfile { - /** - * Specifies the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed - * on a lab resource and only provides a default profile.. - * - * @param defaultAutoShutdownProfile The default lab shutdown profile. This can be changed on a lab resource - * and only provides a default profile. - * @return the next definition stage. - */ - Update withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile); - } - /** The stage of the LabPlan update allowing to specify defaultNetworkProfile. */ - interface WithDefaultNetworkProfile { - /** - * Specifies the defaultNetworkProfile property: The lab plan network profile. To enforce lab network - * policies they must be defined here and cannot be changed when there are existing labs associated with - * this lab plan.. - * - * @param defaultNetworkProfile The lab plan network profile. To enforce lab network policies they must be - * defined here and cannot be changed when there are existing labs associated with this lab plan. - * @return the next definition stage. - */ - Update withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile); - } - /** The stage of the LabPlan update allowing to specify allowedRegions. */ - interface WithAllowedRegions { - /** - * Specifies the allowedRegions property: The allowed regions for the lab creator to use when creating labs - * using this lab plan.. - * - * @param allowedRegions The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * @return the next definition stage. - */ - Update withAllowedRegions(List allowedRegions); - } - /** The stage of the LabPlan update allowing to specify sharedGalleryId. */ - interface WithSharedGalleryId { - /** - * Specifies the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab - * plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared - * images from the gallery can be made available to use when creating new labs.. - * - * @param sharedGalleryId Resource ID of the Shared Image Gallery attached to this lab plan. When saving a - * lab template virtual machine image it will be persisted in this gallery. Shared images from the - * gallery can be made available to use when creating new labs. - * @return the next definition stage. - */ - Update withSharedGalleryId(String sharedGalleryId); - } - /** The stage of the LabPlan update allowing to specify supportInfo. */ - interface WithSupportInfo { - /** - * Specifies the supportInfo property: Support contact information and instructions for users of the lab - * plan. This information is displayed to lab owners and virtual machine users for all labs in the lab - * plan.. - * - * @param supportInfo Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * @return the next definition stage. - */ - Update withSupportInfo(SupportInfo supportInfo); - } - /** The stage of the LabPlan update allowing to specify linkedLmsInstance. */ - interface WithLinkedLmsInstance { - /** - * Specifies the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters - * against.. - * - * @param linkedLmsInstance Base Url of the lms instance this lab plan can link lab rosters against. - * @return the next definition stage. - */ - Update withLinkedLmsInstance(String linkedLmsInstance); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - LabPlan refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - LabPlan refresh(Context context); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void saveImage(SaveImageBody body); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void saveImage(SaveImageBody body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.java deleted file mode 100644 index 7be20f641234..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Profile for how to handle networking for Lab Plans. */ -@Fluent -public final class LabPlanNetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanNetworkProfile.class); - - /* - * The external subnet resource id - */ - @JsonProperty(value = "subnetId") - private String subnetId; - - /** - * Get the subnetId property: The external subnet resource id. - * - * @return the subnetId value. - */ - public String subnetId() { - return this.subnetId; - } - - /** - * Set the subnetId property: The external subnet resource id. - * - * @param subnetId the subnetId value to set. - * @return the LabPlanNetworkProfile object itself. - */ - public LabPlanNetworkProfile withSubnetId(String subnetId) { - this.subnetId = subnetId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.java deleted file mode 100644 index 070376a9c3fa..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Contains lab configuration and default settings. This variant is used for PATCH. */ -@Fluent -public final class LabPlanUpdate extends TrackedResourceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanUpdate.class); - - /* - * Lab plan resource update properties - */ - @JsonProperty(value = "properties") - private LabPlanUpdateProperties innerProperties; - - /** - * Get the innerProperties property: Lab plan resource update properties. - * - * @return the innerProperties value. - */ - private LabPlanUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public LabPlanUpdate withTags(List tags) { - super.withTags(tags); - return this; - } - - /** - * Get the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultConnectionProfile value. - */ - public ConnectionProfile defaultConnectionProfile() { - return this.innerProperties() == null ? null : this.innerProperties().defaultConnectionProfile(); - } - - /** - * Set the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @param defaultConnectionProfile the defaultConnectionProfile value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withDefaultConnectionProfile(defaultConnectionProfile); - return this; - } - - /** - * Get the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @return the defaultAutoShutdownProfile value. - */ - public AutoShutdownProfile defaultAutoShutdownProfile() { - return this.innerProperties() == null ? null : this.innerProperties().defaultAutoShutdownProfile(); - } - - /** - * Set the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab - * resource and only provides a default profile. - * - * @param defaultAutoShutdownProfile the defaultAutoShutdownProfile value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); - return this; - } - - /** - * Get the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @return the defaultNetworkProfile value. - */ - public LabPlanNetworkProfile defaultNetworkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().defaultNetworkProfile(); - } - - /** - * Set the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must - * be defined here and cannot be changed when there are existing labs associated with this lab plan. - * - * @param defaultNetworkProfile the defaultNetworkProfile value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withDefaultNetworkProfile(defaultNetworkProfile); - return this; - } - - /** - * Get the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * - * @return the allowedRegions value. - */ - public List allowedRegions() { - return this.innerProperties() == null ? null : this.innerProperties().allowedRegions(); - } - - /** - * Set the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab - * plan. - * - * @param allowedRegions the allowedRegions value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withAllowedRegions(List allowedRegions) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withAllowedRegions(allowedRegions); - return this; - } - - /** - * Get the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @return the sharedGalleryId value. - */ - public String sharedGalleryId() { - return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId(); - } - - /** - * Set the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving - * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be - * made available to use when creating new labs. - * - * @param sharedGalleryId the sharedGalleryId value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withSharedGalleryId(String sharedGalleryId) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withSharedGalleryId(sharedGalleryId); - return this; - } - - /** - * Get the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @return the supportInfo value. - */ - public SupportInfo supportInfo() { - return this.innerProperties() == null ? null : this.innerProperties().supportInfo(); - } - - /** - * Set the supportInfo property: Support contact information and instructions for users of the lab plan. This - * information is displayed to lab owners and virtual machine users for all labs in the lab plan. - * - * @param supportInfo the supportInfo value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withSupportInfo(SupportInfo supportInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withSupportInfo(supportInfo); - return this; - } - - /** - * Get the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @return the linkedLmsInstance value. - */ - public String linkedLmsInstance() { - return this.innerProperties() == null ? null : this.innerProperties().linkedLmsInstance(); - } - - /** - * Set the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. - * - * @param linkedLmsInstance the linkedLmsInstance value to set. - * @return the LabPlanUpdate object itself. - */ - public LabPlanUpdate withLinkedLmsInstance(String linkedLmsInstance) { - if (this.innerProperties() == null) { - this.innerProperties = new LabPlanUpdateProperties(); - } - this.innerProperties().withLinkedLmsInstance(linkedLmsInstance); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java deleted file mode 100644 index 3688f6fbd16d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of LabPlans. */ -public interface LabPlans { - /** - * Returns a list of all lab plans within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - PagedIterable list(); - - /** - * Returns a list of all lab plans within a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - PagedIterable list(String filter, Context context); - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns a list of all lab plans for a subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab plans. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com. - */ - LabPlan getByResourceGroup(String resourceGroupName, String labPlanName); - - /** - * Retrieves the properties of a Lab Plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String labPlanName, Context context); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String labPlanName); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String labPlanName, Context context); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body); - - /** - * Saves an image from a lab VM to the attached shared image gallery. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in - * resource URIs and in UI. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context); - - /** - * Retrieves the properties of a Lab Plan. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. - */ - LabPlan getById(String id); - - /** - * Retrieves the properties of a Lab Plan. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor - * does it delete shared images added to a gallery via the lab plan permission container. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new LabPlan resource. - * - * @param name resource name. - * @return the first stage of the new LabPlan definition. - */ - LabPlan.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.java deleted file mode 100644 index 0abe55de7dad..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; -import java.util.List; - -/** An immutable client-side representation of LabServicesSku. */ -public interface LabServicesSku { - /** - * Gets the resourceType property: The lab services resource type. - * - * @return the resourceType value. - */ - String resourceType(); - - /** - * Gets the name property: The name of the SKU. - * - * @return the name value. - */ - String name(); - - /** - * Gets the tier property: The tier of the SKU. - * - * @return the tier value. - */ - LabServicesSkuTier tier(); - - /** - * Gets the size property: The SKU size. - * - * @return the size value. - */ - String size(); - - /** - * Gets the family property: The family of the SKU. - * - * @return the family value. - */ - String family(); - - /** - * Gets the capacity property: The scale out/in options of the SKU. - * - * @return the capacity value. - */ - LabServicesSkuCapacity capacity(); - - /** - * Gets the capabilities property: The capabilities of the SKU. - * - * @return the capabilities value. - */ - List capabilities(); - - /** - * Gets the locations property: List of locations that are available for a size. - * - * @return the locations value. - */ - List locations(); - - /** - * Gets the costs property: Metadata for retrieving price info of a lab services SKUs. - * - * @return the costs value. - */ - List costs(); - - /** - * Gets the restrictions property: Restrictions of a lab services SKUs. - * - * @return the restrictions value. - */ - List restrictions(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner object. - * - * @return the inner object. - */ - LabServicesSkuInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.java deleted file mode 100644 index 9b656fee01f2..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The array of capabilities of a lab services SKU. */ -@Immutable -public final class LabServicesSkuCapabilities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuCapabilities.class); - - /* - * The name of the capability for a SKU. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The value of the capability for a SKU. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /** - * Get the name property: The name of the capability for a SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: The value of the capability for a SKU. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.java deleted file mode 100644 index 3cc4caf9c7d2..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The scale out/in options of the SKU. */ -@Immutable -public final class LabServicesSkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuCapacity.class); - - /* - * The default capacity for this resource. - */ - @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) - private Long defaultProperty; - - /* - * The lowest permitted capacity for this resource. - */ - @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) - private Long minimum; - - /* - * The highest permitted capacity for this resource. - */ - @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) - private Long maximum; - - /* - * The localized name of the resource. - */ - @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) - private ScaleType scaleType; - - /** - * Get the defaultProperty property: The default capacity for this resource. - * - * @return the defaultProperty value. - */ - public Long defaultProperty() { - return this.defaultProperty; - } - - /** - * Get the minimum property: The lowest permitted capacity for this resource. - * - * @return the minimum value. - */ - public Long minimum() { - return this.minimum; - } - - /** - * Get the maximum property: The highest permitted capacity for this resource. - * - * @return the maximum value. - */ - public Long maximum() { - return this.maximum; - } - - /** - * Get the scaleType property: The localized name of the resource. - * - * @return the scaleType value. - */ - public ScaleType scaleType() { - return this.scaleType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java deleted file mode 100644 index 5c23ce7e9319..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The array of costs of a lab services SKU. */ -@Immutable -public final class LabServicesSkuCost { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuCost.class); - - /* - * The meter id. - */ - @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) - private String meterId; - - /* - * The quantity of units charged. - */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Float quantity; - - /* - * The extended unit. - */ - @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) - private String extendedUnit; - - /** - * Get the meterId property: The meter id. - * - * @return the meterId value. - */ - public String meterId() { - return this.meterId; - } - - /** - * Get the quantity property: The quantity of units charged. - * - * @return the quantity value. - */ - public Float quantity() { - return this.quantity; - } - - /** - * Get the extendedUnit property: The extended unit. - * - * @return the extendedUnit value. - */ - public String extendedUnit() { - return this.extendedUnit; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.java deleted file mode 100644 index ca093c400699..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The restriction details. */ -@Immutable -public final class LabServicesSkuRestrictions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuRestrictions.class); - - /* - * The type of restriction. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private RestrictionType type; - - /* - * The values of the restriction. - */ - @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) - private List values; - - /* - * The reason for the restriction. - */ - @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) - private RestrictionReasonCode reasonCode; - - /** - * Get the type property: The type of restriction. - * - * @return the type value. - */ - public RestrictionType type() { - return this.type; - } - - /** - * Get the values property: The values of the restriction. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Get the reasonCode property: The reason for the restriction. - * - * @return the reasonCode value. - */ - public RestrictionReasonCode reasonCode() { - return this.reasonCode; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.java deleted file mode 100644 index 67713ad39d90..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LabServicesSkuTier. */ -public final class LabServicesSkuTier extends ExpandableStringEnum { - /** Static value Standard for LabServicesSkuTier. */ - public static final LabServicesSkuTier STANDARD = fromString("Standard"); - - /** Static value Premium for LabServicesSkuTier. */ - public static final LabServicesSkuTier PREMIUM = fromString("Premium"); - - /** - * Creates or finds a LabServicesSkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding LabServicesSkuTier. - */ - @JsonCreator - public static LabServicesSkuTier fromString(String name) { - return fromString(name, LabServicesSkuTier.class); - } - - /** @return known LabServicesSkuTier values. */ - public static Collection values() { - return values(LabServicesSkuTier.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java deleted file mode 100644 index 6001826eee8c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for LabState. */ -public enum LabState { - /** Enum value Draft. */ - DRAFT("Draft"), - - /** Enum value Publishing. */ - PUBLISHING("Publishing"), - - /** Enum value Scaling. */ - SCALING("Scaling"), - - /** Enum value Syncing. */ - SYNCING("Syncing"), - - /** Enum value Published. */ - PUBLISHED("Published"); - - /** The actual serialized value for a LabState instance. */ - private final String value; - - LabState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a LabState instance. - * - * @param value the serialized value to parse. - * @return the parsed LabState object, or null if unable to parse. - */ - @JsonCreator - public static LabState fromString(String value) { - LabState[] items = LabState.values(); - for (LabState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.java deleted file mode 100644 index 5096140824f6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.LabUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The lab resource for updates. */ -@Fluent -public final class LabUpdate extends TrackedResourceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabUpdate.class); - - /* - * Lab resource properties - */ - @JsonProperty(value = "properties") - private LabUpdateProperties innerProperties; - - /** - * Get the innerProperties property: Lab resource properties. - * - * @return the innerProperties value. - */ - private LabUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public LabUpdate withTags(List tags) { - super.withTags(tags); - return this; - } - - /** - * Get the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * - * @return the autoShutdownProfile value. - */ - public AutoShutdownProfile autoShutdownProfile() { - return this.innerProperties() == null ? null : this.innerProperties().autoShutdownProfile(); - } - - /** - * Set the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether - * actions are taken on resources that are sitting idle. - * - * @param autoShutdownProfile the autoShutdownProfile value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withAutoShutdownProfile(autoShutdownProfile); - return this; - } - - /** - * Get the connectionProfile property: The connection profile for the lab. This controls settings such as web access - * to lab resources or whether RDP or SSH ports are open. - * - * @return the connectionProfile value. - */ - public ConnectionProfile connectionProfile() { - return this.innerProperties() == null ? null : this.innerProperties().connectionProfile(); - } - - /** - * Set the connectionProfile property: The connection profile for the lab. This controls settings such as web access - * to lab resources or whether RDP or SSH ports are open. - * - * @param connectionProfile the connectionProfile value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withConnectionProfile(ConnectionProfile connectionProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withConnectionProfile(connectionProfile); - return this; - } - - /** - * Get the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @return the virtualMachineProfile value. - */ - public VirtualMachineProfile virtualMachineProfile() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachineProfile(); - } - - /** - * Set the virtualMachineProfile property: The profile used for creating lab virtual machines. - * - * @param virtualMachineProfile the virtualMachineProfile value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withVirtualMachineProfile(virtualMachineProfile); - return this; - } - - /** - * Get the securityProfile property: The lab security profile. - * - * @return the securityProfile value. - */ - public SecurityProfile securityProfile() { - return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); - } - - /** - * Set the securityProfile property: The lab security profile. - * - * @param securityProfile the securityProfile value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withSecurityProfile(SecurityProfile securityProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withSecurityProfile(securityProfile); - return this; - } - - /** - * Get the rosterProfile property: The lab user list management profile. - * - * @return the rosterProfile value. - */ - public RosterProfile rosterProfile() { - return this.innerProperties() == null ? null : this.innerProperties().rosterProfile(); - } - - /** - * Set the rosterProfile property: The lab user list management profile. - * - * @param rosterProfile the rosterProfile value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withRosterProfile(RosterProfile rosterProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withRosterProfile(rosterProfile); - return this; - } - - /** - * Get the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as - * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @return the labPlanId value. - */ - public String labPlanId() { - return this.innerProperties() == null ? null : this.innerProperties().labPlanId(); - } - - /** - * Set the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as - * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides - * organization.. - * - * @param labPlanId the labPlanId value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withLabPlanId(String labPlanId) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withLabPlanId(labPlanId); - return this; - } - - /** - * Get the title property: The title of the lab. - * - * @return the title value. - */ - public String title() { - return this.innerProperties() == null ? null : this.innerProperties().title(); - } - - /** - * Set the title property: The title of the lab. - * - * @param title the title value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withTitle(String title) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withTitle(title); - return this; - } - - /** - * Get the description property: The description of the lab. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description of the lab. - * - * @param description the description value to set. - * @return the LabUpdate object itself. - */ - public LabUpdate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new LabUpdateProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java deleted file mode 100644 index 125099f450ff..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Labs. */ -public interface Labs { - /** - * Returns a list of all labs for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - PagedIterable list(); - - /** - * Returns a list of all labs for a subscription. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - PagedIterable list(String filter, Context context); - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns a list of all labs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of labs. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource. - */ - Lab getByResourceGroup(String resourceGroupName, String labName); - - /** - * Returns the properties of a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String labName, Context context); - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String labName); - - /** - * Operation to delete a lab resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String labName, Context context); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void publish(String resourceGroupName, String labName); - - /** - * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void publish(String resourceGroupName, String labName, Context context); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void syncGroup(String resourceGroupName, String labName); - - /** - * Action used to manually kick off an AAD group sync job. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void syncGroup(String resourceGroupName, String labName, Context context); - - /** - * Returns the properties of a lab resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response}. - */ - Lab getById(String id); - - /** - * Returns the properties of a lab resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the lab resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Operation to delete a lab resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Operation to delete a lab resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Lab resource. - * - * @param name resource name. - * @return the first stage of the new Lab definition. - */ - Lab.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java deleted file mode 100644 index b53f3bea911d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Core Usages. */ -@Immutable -public final class ListUsagesResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListUsagesResult.class); - - /* - * The array page of Usages. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of Usage result. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of Usages. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of Usage result. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java deleted file mode 100644 index fed22e24e7f4..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.OperationInner; - -/** An immutable client-side representation of Operation. */ -public interface Operation { - /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - Origin origin(); - - /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - ActionType actionType(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java deleted file mode 100644 index 9246e790087b..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Localized display information for this particular operation. */ -@Immutable -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * The localized friendly form of the resource provider name, e.g. - * "Microsoft Monitoring Insights" or "Microsoft Compute". - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * The localized friendly name of the resource type related to this - * operation. E.g. "Virtual Machines" or "Job Schedule Collections". - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for - * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual - * Machine". - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for - * tool tips and detailed views. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationListResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationListResult.java deleted file mode 100644 index 6634c72e53e4..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationListResult.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * List of operations supported by the resource provider - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java deleted file mode 100644 index ee23d9b04862..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of OperationResult. */ -public interface OperationResult { - /** - * Gets the id property: Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: The operation status. - * - * @return the status value. - */ - OperationStatus status(); - - /** - * Gets the startTime property: Start time. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: End time. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the percentComplete property: Percent completion. - * - * @return the percentComplete value. - */ - Float percentComplete(); - - /** - * Gets the error property: The error for a failure if the operation failed. - * - * @return the error value. - */ - ManagementError error(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationResultInner object. - * - * @return the inner object. - */ - OperationResultInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.java deleted file mode 100644 index 81dff83403cf..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of OperationResults. */ -public interface OperationResults { - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result. - */ - OperationResult get(String operationResultId); - - /** - * Returns an azure operation result. - * - * @param operationResultId The operation result ID / name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a long running operation result along with {@link Response}. - */ - Response getWithResponse(String operationResultId, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java deleted file mode 100644 index ff8f0c11dbf0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OperationStatus. */ -public enum OperationStatus { - /** Enum value NotStarted. */ - NOT_STARTED("NotStarted"), - - /** Enum value InProgress. */ - IN_PROGRESS("InProgress"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Canceled. */ - CANCELED("Canceled"); - - /** The actual serialized value for a OperationStatus instance. */ - private final String value; - - OperationStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OperationStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed OperationStatus object, or null if unable to parse. - */ - @JsonCreator - public static OperationStatus fromString(String value) { - OperationStatus[] items = OperationStatus.values(); - for (OperationStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java deleted file mode 100644 index 0e615a408143..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * Returns a list of all operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - PagedIterable list(); - - /** - * Returns a list of all operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. - */ - PagedIterable list(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java deleted file mode 100644 index ce93018c75af..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Origin. */ -public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ - public static final Origin USER = fromString("user"); - - /** Static value system for Origin. */ - public static final Origin SYSTEM = fromString("system"); - - /** Static value user,system for Origin. */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - @JsonCreator - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** @return known Origin values. */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.java deleted file mode 100644 index 22663c648632..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OsState. */ -public enum OsState { - /** Enum value Generalized. */ - GENERALIZED("Generalized"), - - /** Enum value Specialized. */ - SPECIALIZED("Specialized"); - - /** The actual serialized value for a OsState instance. */ - private final String value; - - OsState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OsState instance. - * - * @param value the serialized value to parse. - * @return the parsed OsState object, or null if unable to parse. - */ - @JsonCreator - public static OsState fromString(String value) { - OsState[] items = OsState.values(); - for (OsState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.java deleted file mode 100644 index 812e86cde56b..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for OsType. */ -public enum OsType { - /** Enum value Windows. */ - WINDOWS("Windows"), - - /** Enum value Linux. */ - LINUX("Linux"); - - /** The actual serialized value for a OsType instance. */ - private final String value; - - OsType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a OsType instance. - * - * @param value the serialized value to parse. - * @return the parsed OsType object, or null if unable to parse. - */ - @JsonCreator - public static OsType fromString(String value) { - OsType[] items = OsType.values(); - for (OsType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java deleted file mode 100644 index e432ba3f3cd5..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.ImageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of Lab services virtual machine images. */ -@Immutable -public final class PagedImages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedImages.class); - - /* - * The array page of virtual machine images. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of image results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of virtual machine images. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of image results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java deleted file mode 100644 index dcff034630b7..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of lab plans. */ -@Immutable -public final class PagedLabPlans { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedLabPlans.class); - - /* - * The array page of lab plans. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of lab plan results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of lab plans. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of lab plan results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java deleted file mode 100644 index 4242b873b0f8..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of lab services skus. */ -@Immutable -public final class PagedLabServicesSkus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedLabServicesSkus.class); - - /* - * The array page of sku results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of sku results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of sku results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of sku results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabs.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabs.java deleted file mode 100644 index 55c7f15e3c7b..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabs.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of labs. */ -@Immutable -public final class PagedLabs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedLabs.class); - - /* - * The array page of lab results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of image results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of lab results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of image results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java deleted file mode 100644 index 06530cb89b91..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of schedules. */ -@Immutable -public final class PagedSchedules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedSchedules.class); - - /* - * The array page of schedule results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of schedule results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of schedule results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of schedule results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedUsers.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedUsers.java deleted file mode 100644 index 5fa61d0f1a93..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedUsers.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of users. */ -@Immutable -public final class PagedUsers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedUsers.class); - - /* - * The array page of user results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of image results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of user results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of image results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java deleted file mode 100644 index 9f6a4cd97ddc..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Paged list of lab services virtual machines. */ -@Immutable -public final class PagedVirtualMachines { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedVirtualMachines.class); - - /* - * The array page of virtual machine results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link to get the next page of virtual machine results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The array page of virtual machine results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to get the next page of virtual machine results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java deleted file mode 100644 index 556aafaacdaa..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ProvisioningState. */ -public enum ProvisioningState { - /** Enum value Creating. */ - CREATING("Creating"), - - /** Enum value Updating. */ - UPDATING("Updating"), - - /** Enum value Deleting. */ - DELETING("Deleting"), - - /** Enum value Succeeded. */ - SUCCEEDED("Succeeded"), - - /** Enum value Failed. */ - FAILED("Failed"), - - /** Enum value Locked. */ - LOCKED("Locked"); - - /** The actual serialized value for a ProvisioningState instance. */ - private final String value; - - ProvisioningState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProvisioningState instance. - * - * @param value the serialized value to parse. - * @return the parsed ProvisioningState object, or null if unable to parse. - */ - @JsonCreator - public static ProvisioningState fromString(String value) { - ProvisioningState[] items = ProvisioningState.values(); - for (ProvisioningState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.java deleted file mode 100644 index 44991f1d49e2..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RecurrenceFrequency. */ -public enum RecurrenceFrequency { - /** Enum value Daily. */ - DAILY("Daily"), - - /** Enum value Weekly. */ - WEEKLY("Weekly"); - - /** The actual serialized value for a RecurrenceFrequency instance. */ - private final String value; - - RecurrenceFrequency(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RecurrenceFrequency instance. - * - * @param value the serialized value to parse. - * @return the parsed RecurrenceFrequency object, or null if unable to parse. - */ - @JsonCreator - public static RecurrenceFrequency fromString(String value) { - RecurrenceFrequency[] items = RecurrenceFrequency.values(); - for (RecurrenceFrequency item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.java deleted file mode 100644 index e9359d6b1e66..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** Recurrence pattern of a lab schedule. */ -@Fluent -public final class RecurrencePattern { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecurrencePattern.class); - - /* - * The frequency of the recurrence. - */ - @JsonProperty(value = "frequency", required = true) - private RecurrenceFrequency frequency; - - /* - * The week days the schedule runs. Used for when the Frequency is set to - * Weekly. - */ - @JsonProperty(value = "weekDays") - private List weekDays; - - /* - * The interval to invoke the schedule on. For example, interval = 2 and - * RecurrenceFrequency.Daily will run every 2 days. When no interval is - * supplied, an interval of 1 is used. - */ - @JsonProperty(value = "interval") - private Integer interval; - - /* - * When the recurrence will expire. This date is inclusive. - */ - @JsonProperty(value = "expirationDate", required = true) - private LocalDate expirationDate; - - /** - * Get the frequency property: The frequency of the recurrence. - * - * @return the frequency value. - */ - public RecurrenceFrequency frequency() { - return this.frequency; - } - - /** - * Set the frequency property: The frequency of the recurrence. - * - * @param frequency the frequency value to set. - * @return the RecurrencePattern object itself. - */ - public RecurrencePattern withFrequency(RecurrenceFrequency frequency) { - this.frequency = frequency; - return this; - } - - /** - * Get the weekDays property: The week days the schedule runs. Used for when the Frequency is set to Weekly. - * - * @return the weekDays value. - */ - public List weekDays() { - return this.weekDays; - } - - /** - * Set the weekDays property: The week days the schedule runs. Used for when the Frequency is set to Weekly. - * - * @param weekDays the weekDays value to set. - * @return the RecurrencePattern object itself. - */ - public RecurrencePattern withWeekDays(List weekDays) { - this.weekDays = weekDays; - return this; - } - - /** - * Get the interval property: The interval to invoke the schedule on. For example, interval = 2 and - * RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. - * - * @return the interval value. - */ - public Integer interval() { - return this.interval; - } - - /** - * Set the interval property: The interval to invoke the schedule on. For example, interval = 2 and - * RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. - * - * @param interval the interval value to set. - * @return the RecurrencePattern object itself. - */ - public RecurrencePattern withInterval(Integer interval) { - this.interval = interval; - return this; - } - - /** - * Get the expirationDate property: When the recurrence will expire. This date is inclusive. - * - * @return the expirationDate value. - */ - public LocalDate expirationDate() { - return this.expirationDate; - } - - /** - * Set the expirationDate property: When the recurrence will expire. This date is inclusive. - * - * @param expirationDate the expirationDate value to set. - * @return the RecurrencePattern object itself. - */ - public RecurrencePattern withExpirationDate(LocalDate expirationDate) { - this.expirationDate = expirationDate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (frequency() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property frequency in model RecurrencePattern")); - } - if (expirationDate() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property expirationDate in model RecurrencePattern")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.java deleted file mode 100644 index d1fa193e37a6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for RegistrationState. */ -public enum RegistrationState { - /** Enum value Registered. */ - REGISTERED("Registered"), - - /** Enum value NotRegistered. */ - NOT_REGISTERED("NotRegistered"); - - /** The actual serialized value for a RegistrationState instance. */ - private final String value; - - RegistrationState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RegistrationState instance. - * - * @param value the serialized value to parse. - * @return the parsed RegistrationState object, or null if unable to parse. - */ - @JsonCreator - public static RegistrationState fromString(String value) { - RegistrationState[] items = RegistrationState.values(); - for (RegistrationState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordBody.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordBody.java deleted file mode 100644 index b7cb2ec1e4f5..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordBody.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Body of a reset password request. */ -@Fluent -public final class ResetPasswordBody { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResetPasswordBody.class); - - /* - * The user whose password is being reset - */ - @JsonProperty(value = "username", required = true) - private String username; - - /* - * The password - */ - @JsonProperty(value = "password", required = true) - private String password; - - /** - * Get the username property: The user whose password is being reset. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The user whose password is being reset. - * - * @param username the username value to set. - * @return the ResetPasswordBody object itself. - */ - public ResetPasswordBody withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the password property: The password. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password. - * - * @param password the password value to set. - * @return the ResetPasswordBody object itself. - */ - public ResetPasswordBody withPassword(String password) { - this.password = password; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (username() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property username in model ResetPasswordBody")); - } - if (password() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property password in model ResetPasswordBody")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.java deleted file mode 100644 index 6a170889a862..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RestrictionReasonCode. */ -public final class RestrictionReasonCode extends ExpandableStringEnum { - /** Static value QuotaId for RestrictionReasonCode. */ - public static final RestrictionReasonCode QUOTA_ID = fromString("QuotaId"); - - /** Static value NotAvailableForSubscription for RestrictionReasonCode. */ - public static final RestrictionReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = - fromString("NotAvailableForSubscription"); - - /** - * Creates or finds a RestrictionReasonCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding RestrictionReasonCode. - */ - @JsonCreator - public static RestrictionReasonCode fromString(String name) { - return fromString(name, RestrictionReasonCode.class); - } - - /** @return known RestrictionReasonCode values. */ - public static Collection values() { - return values(RestrictionReasonCode.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.java deleted file mode 100644 index e3a864be3a6e..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for RestrictionType. */ -public final class RestrictionType extends ExpandableStringEnum { - /** Static value Location for RestrictionType. */ - public static final RestrictionType LOCATION = fromString("Location"); - - /** - * Creates or finds a RestrictionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RestrictionType. - */ - @JsonCreator - public static RestrictionType fromString(String name) { - return fromString(name, RestrictionType.class); - } - - /** @return known RestrictionType values. */ - public static Collection values() { - return values(RestrictionType.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java deleted file mode 100644 index df5ea07c05d5..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The lab user list management profile. */ -@Fluent -public final class RosterProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RosterProfile.class); - - /* - * The AAD group ID which this lab roster is populated from. Having this - * set enables AAD sync mode. - */ - @JsonProperty(value = "activeDirectoryGroupId") - private String activeDirectoryGroupId; - - /* - * The unique context identifier for the lab in the lms. - */ - @JsonProperty(value = "ltiContextId") - private String ltiContextId; - - /* - * The base URI identifying the lms instance. - */ - @JsonProperty(value = "lmsInstance") - private String lmsInstance; - - /* - * The unique id of the azure lab services tool in the lms. - */ - @JsonProperty(value = "ltiClientId") - private String ltiClientId; - - /* - * The uri of the names and roles service endpoint on the lms for the class - * attached to this lab. - */ - @JsonProperty(value = "ltiRosterEndpoint") - private String ltiRosterEndpoint; - - /** - * Get the activeDirectoryGroupId property: The AAD group ID which this lab roster is populated from. Having this - * set enables AAD sync mode. - * - * @return the activeDirectoryGroupId value. - */ - public String activeDirectoryGroupId() { - return this.activeDirectoryGroupId; - } - - /** - * Set the activeDirectoryGroupId property: The AAD group ID which this lab roster is populated from. Having this - * set enables AAD sync mode. - * - * @param activeDirectoryGroupId the activeDirectoryGroupId value to set. - * @return the RosterProfile object itself. - */ - public RosterProfile withActiveDirectoryGroupId(String activeDirectoryGroupId) { - this.activeDirectoryGroupId = activeDirectoryGroupId; - return this; - } - - /** - * Get the ltiContextId property: The unique context identifier for the lab in the lms. - * - * @return the ltiContextId value. - */ - public String ltiContextId() { - return this.ltiContextId; - } - - /** - * Set the ltiContextId property: The unique context identifier for the lab in the lms. - * - * @param ltiContextId the ltiContextId value to set. - * @return the RosterProfile object itself. - */ - public RosterProfile withLtiContextId(String ltiContextId) { - this.ltiContextId = ltiContextId; - return this; - } - - /** - * Get the lmsInstance property: The base URI identifying the lms instance. - * - * @return the lmsInstance value. - */ - public String lmsInstance() { - return this.lmsInstance; - } - - /** - * Set the lmsInstance property: The base URI identifying the lms instance. - * - * @param lmsInstance the lmsInstance value to set. - * @return the RosterProfile object itself. - */ - public RosterProfile withLmsInstance(String lmsInstance) { - this.lmsInstance = lmsInstance; - return this; - } - - /** - * Get the ltiClientId property: The unique id of the azure lab services tool in the lms. - * - * @return the ltiClientId value. - */ - public String ltiClientId() { - return this.ltiClientId; - } - - /** - * Set the ltiClientId property: The unique id of the azure lab services tool in the lms. - * - * @param ltiClientId the ltiClientId value to set. - * @return the RosterProfile object itself. - */ - public RosterProfile withLtiClientId(String ltiClientId) { - this.ltiClientId = ltiClientId; - return this; - } - - /** - * Get the ltiRosterEndpoint property: The uri of the names and roles service endpoint on the lms for the class - * attached to this lab. - * - * @return the ltiRosterEndpoint value. - */ - public String ltiRosterEndpoint() { - return this.ltiRosterEndpoint; - } - - /** - * Set the ltiRosterEndpoint property: The uri of the names and roles service endpoint on the lms for the class - * attached to this lab. - * - * @param ltiRosterEndpoint the ltiRosterEndpoint value to set. - * @return the RosterProfile object itself. - */ - public RosterProfile withLtiRosterEndpoint(String ltiRosterEndpoint) { - this.ltiRosterEndpoint = ltiRosterEndpoint; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java deleted file mode 100644 index 9899a62a729c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Body for the save image POST. */ -@Fluent -public final class SaveImageBody { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SaveImageBody.class); - - /* - * The name for the image we create. - */ - @JsonProperty(value = "name") - private String name; - - /* - * The ID of the lab virtual machine you want to save an image from. - */ - @JsonProperty(value = "labVirtualMachineId") - private String labVirtualMachineId; - - /** - * Get the name property: The name for the image we create. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name for the image we create. - * - * @param name the name value to set. - * @return the SaveImageBody object itself. - */ - public SaveImageBody withName(String name) { - this.name = name; - return this; - } - - /** - * Get the labVirtualMachineId property: The ID of the lab virtual machine you want to save an image from. - * - * @return the labVirtualMachineId value. - */ - public String labVirtualMachineId() { - return this.labVirtualMachineId; - } - - /** - * Set the labVirtualMachineId property: The ID of the lab virtual machine you want to save an image from. - * - * @param labVirtualMachineId the labVirtualMachineId value to set. - * @return the SaveImageBody object itself. - */ - public SaveImageBody withLabVirtualMachineId(String labVirtualMachineId) { - this.labVirtualMachineId = labVirtualMachineId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.java deleted file mode 100644 index 36ae545e6eb3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ScaleType. */ -public final class ScaleType extends ExpandableStringEnum { - /** Static value None for ScaleType. */ - public static final ScaleType NONE = fromString("None"); - - /** Static value Manual for ScaleType. */ - public static final ScaleType MANUAL = fromString("Manual"); - - /** Static value Automatic for ScaleType. */ - public static final ScaleType AUTOMATIC = fromString("Automatic"); - - /** - * Creates or finds a ScaleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScaleType. - */ - @JsonCreator - public static ScaleType fromString(String name) { - return fromString(name, ScaleType.class); - } - - /** @return known ScaleType values. */ - public static Collection values() { - return values(ScaleType.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java deleted file mode 100644 index bf580cfa5b96..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of Schedule. */ -public interface Schedule { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the schedule. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Current provisioning state of the schedule. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the startAt value. - */ - OffsetDateTime startAt(); - - /** - * Gets the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the stopAt value. - */ - OffsetDateTime stopAt(); - - /** - * Gets the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @return the recurrencePattern value. - */ - RecurrencePattern recurrencePattern(); - - /** - * Gets the timeZoneId property: The IANA timezone id for the schedule. - * - * @return the timeZoneId value. - */ - String timeZoneId(); - - /** - * Gets the notes property: Notes for this schedule. - * - * @return the notes value. - */ - String notes(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.ScheduleInner object. - * - * @return the inner object. - */ - ScheduleInner innerModel(); - - /** The entirety of the Schedule definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The Schedule definition stages. */ - interface DefinitionStages { - /** The first stage of the Schedule definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the Schedule definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, labName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in - * resource URIs. - * @return the next definition stage. - */ - WithCreate withExistingLab(String resourceGroupName, String labName); - } - /** - * The stage of the Schedule definition which contains all the minimum required properties for the resource to - * be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithStartAt, - DefinitionStages.WithStopAt, - DefinitionStages.WithRecurrencePattern, - DefinitionStages.WithTimeZoneId, - DefinitionStages.WithNotes { - /** - * Executes the create request. - * - * @return the created resource. - */ - Schedule create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Schedule create(Context context); - } - /** The stage of the Schedule definition allowing to specify startAt. */ - interface WithStartAt { - /** - * Specifies the startAt property: When lab user virtual machines will be started. Timestamp offsets will be - * ignored and timeZoneId is used instead.. - * - * @param startAt When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * @return the next definition stage. - */ - WithCreate withStartAt(OffsetDateTime startAt); - } - /** The stage of the Schedule definition allowing to specify stopAt. */ - interface WithStopAt { - /** - * Specifies the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be - * ignored and timeZoneId is used instead.. - * - * @param stopAt When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * @return the next definition stage. - */ - WithCreate withStopAt(OffsetDateTime stopAt); - } - /** The stage of the Schedule definition allowing to specify recurrencePattern. */ - interface WithRecurrencePattern { - /** - * Specifies the recurrencePattern property: The recurrence pattern of the scheduled actions.. - * - * @param recurrencePattern The recurrence pattern of the scheduled actions. - * @return the next definition stage. - */ - WithCreate withRecurrencePattern(RecurrencePattern recurrencePattern); - } - /** The stage of the Schedule definition allowing to specify timeZoneId. */ - interface WithTimeZoneId { - /** - * Specifies the timeZoneId property: The IANA timezone id for the schedule.. - * - * @param timeZoneId The IANA timezone id for the schedule. - * @return the next definition stage. - */ - WithCreate withTimeZoneId(String timeZoneId); - } - /** The stage of the Schedule definition allowing to specify notes. */ - interface WithNotes { - /** - * Specifies the notes property: Notes for this schedule.. - * - * @param notes Notes for this schedule. - * @return the next definition stage. - */ - WithCreate withNotes(String notes); - } - } - /** - * Begins update for the Schedule resource. - * - * @return the stage of resource update. - */ - Schedule.Update update(); - - /** The template for Schedule update. */ - interface Update - extends UpdateStages.WithStartAt, - UpdateStages.WithStopAt, - UpdateStages.WithRecurrencePattern, - UpdateStages.WithTimeZoneId, - UpdateStages.WithNotes { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Schedule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Schedule apply(Context context); - } - /** The Schedule update stages. */ - interface UpdateStages { - /** The stage of the Schedule update allowing to specify startAt. */ - interface WithStartAt { - /** - * Specifies the startAt property: When lab user virtual machines will be started. Timestamp offsets will be - * ignored and timeZoneId is used instead.. - * - * @param startAt When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * @return the next definition stage. - */ - Update withStartAt(OffsetDateTime startAt); - } - /** The stage of the Schedule update allowing to specify stopAt. */ - interface WithStopAt { - /** - * Specifies the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be - * ignored and timeZoneId is used instead.. - * - * @param stopAt When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * @return the next definition stage. - */ - Update withStopAt(OffsetDateTime stopAt); - } - /** The stage of the Schedule update allowing to specify recurrencePattern. */ - interface WithRecurrencePattern { - /** - * Specifies the recurrencePattern property: The recurrence pattern of the scheduled actions.. - * - * @param recurrencePattern The recurrence pattern of the scheduled actions. - * @return the next definition stage. - */ - Update withRecurrencePattern(RecurrencePattern recurrencePattern); - } - /** The stage of the Schedule update allowing to specify timeZoneId. */ - interface WithTimeZoneId { - /** - * Specifies the timeZoneId property: The IANA timezone id for the schedule.. - * - * @param timeZoneId The IANA timezone id for the schedule. - * @return the next definition stage. - */ - Update withTimeZoneId(String timeZoneId); - } - /** The stage of the Schedule update allowing to specify notes. */ - interface WithNotes { - /** - * Specifies the notes property: Notes for this schedule.. - * - * @param notes Notes for this schedule. - * @return the next definition stage. - */ - Update withNotes(String notes); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Schedule refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Schedule refresh(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java deleted file mode 100644 index 7398ea1c45c6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.ScheduleUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Schedule for automatically turning virtual machines in a lab on and off at specified times. Used for updates. */ -@Fluent -public final class ScheduleUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleUpdate.class); - - /* - * Schedule resource properties - */ - @JsonProperty(value = "properties") - private ScheduleUpdateProperties innerProperties; - - /** - * Get the innerProperties property: Schedule resource properties. - * - * @return the innerProperties value. - */ - private ScheduleUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the startAt value. - */ - public OffsetDateTime startAt() { - return this.innerProperties() == null ? null : this.innerProperties().startAt(); - } - - /** - * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @param startAt the startAt value to set. - * @return the ScheduleUpdate object itself. - */ - public ScheduleUpdate withStartAt(OffsetDateTime startAt) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleUpdateProperties(); - } - this.innerProperties().withStartAt(startAt); - return this; - } - - /** - * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @return the stopAt value. - */ - public OffsetDateTime stopAt() { - return this.innerProperties() == null ? null : this.innerProperties().stopAt(); - } - - /** - * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and - * timeZoneId is used instead. - * - * @param stopAt the stopAt value to set. - * @return the ScheduleUpdate object itself. - */ - public ScheduleUpdate withStopAt(OffsetDateTime stopAt) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleUpdateProperties(); - } - this.innerProperties().withStopAt(stopAt); - return this; - } - - /** - * Get the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @return the recurrencePattern value. - */ - public RecurrencePattern recurrencePattern() { - return this.innerProperties() == null ? null : this.innerProperties().recurrencePattern(); - } - - /** - * Set the recurrencePattern property: The recurrence pattern of the scheduled actions. - * - * @param recurrencePattern the recurrencePattern value to set. - * @return the ScheduleUpdate object itself. - */ - public ScheduleUpdate withRecurrencePattern(RecurrencePattern recurrencePattern) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleUpdateProperties(); - } - this.innerProperties().withRecurrencePattern(recurrencePattern); - return this; - } - - /** - * Get the timeZoneId property: The IANA timezone id for the schedule. - * - * @return the timeZoneId value. - */ - public String timeZoneId() { - return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); - } - - /** - * Set the timeZoneId property: The IANA timezone id for the schedule. - * - * @param timeZoneId the timeZoneId value to set. - * @return the ScheduleUpdate object itself. - */ - public ScheduleUpdate withTimeZoneId(String timeZoneId) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleUpdateProperties(); - } - this.innerProperties().withTimeZoneId(timeZoneId); - return this; - } - - /** - * Get the notes property: Notes for this schedule. - * - * @return the notes value. - */ - public String notes() { - return this.innerProperties() == null ? null : this.innerProperties().notes(); - } - - /** - * Set the notes property: Notes for this schedule. - * - * @param notes the notes value to set. - * @return the ScheduleUpdate object itself. - */ - public ScheduleUpdate withNotes(String notes) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduleUpdateProperties(); - } - this.innerProperties().withNotes(notes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedules.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedules.java deleted file mode 100644 index 07476f13dc43..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedules.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Schedules. */ -public interface Schedules { - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - PagedIterable listByLab(String resourceGroupName, String labName); - - /** - * Returns a list of all schedules for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of schedules. - */ - PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times. - */ - Schedule get(String resourceGroupName, String labName, String scheduleName); - - /** - * Returns the properties of a lab Schedule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String labName, String scheduleName, Context context); - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String labName, String scheduleName); - - /** - * Operation to delete a schedule resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource - * URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String labName, String scheduleName, Context context); - - /** - * Returns the properties of a lab Schedule. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - Schedule getById(String id); - - /** - * Returns the properties of a lab Schedule. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Operation to delete a schedule resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Operation to delete a schedule resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Schedule resource. - * - * @param name resource name. - * @return the first stage of the new Schedule definition. - */ - Schedule.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SecurityProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SecurityProfile.java deleted file mode 100644 index 765a1b4a9347..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SecurityProfile.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The lab security profile. */ -@Fluent -public final class SecurityProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityProfile.class); - - /* - * The registration code for the lab. - */ - @JsonProperty(value = "registrationCode", access = JsonProperty.Access.WRITE_ONLY) - private String registrationCode; - - /* - * Whether any user or only specified users can register to a lab. - */ - @JsonProperty(value = "openAccess") - private EnableState openAccess; - - /** - * Get the registrationCode property: The registration code for the lab. - * - * @return the registrationCode value. - */ - public String registrationCode() { - return this.registrationCode; - } - - /** - * Get the openAccess property: Whether any user or only specified users can register to a lab. - * - * @return the openAccess value. - */ - public EnableState openAccess() { - return this.openAccess; - } - - /** - * Set the openAccess property: Whether any user or only specified users can register to a lab. - * - * @param openAccess the openAccess value to set. - * @return the SecurityProfile object itself. - */ - public SecurityProfile withOpenAccess(EnableState openAccess) { - this.openAccess = openAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.java deleted file mode 100644 index 68b9b08517e0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ShutdownOnIdleMode. */ -public enum ShutdownOnIdleMode { - /** Enum value None. */ - NONE("None"), - - /** Enum value UserAbsence. */ - USER_ABSENCE("UserAbsence"), - - /** Enum value LowUsage. */ - LOW_USAGE("LowUsage"); - - /** The actual serialized value for a ShutdownOnIdleMode instance. */ - private final String value; - - ShutdownOnIdleMode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ShutdownOnIdleMode instance. - * - * @param value the serialized value to parse. - * @return the parsed ShutdownOnIdleMode object, or null if unable to parse. - */ - @JsonCreator - public static ShutdownOnIdleMode fromString(String value) { - ShutdownOnIdleMode[] items = ShutdownOnIdleMode.values(); - for (ShutdownOnIdleMode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Sku.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Sku.java deleted file mode 100644 index 1f57ad384b72..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Sku.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource model definition representing SKU. */ -@Fluent -public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - - /* - * The name of the SKU. Ex - P3. It is typically a letter+number code - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * This field is required to be implemented by the Resource Provider if the - * service has more than one tier, but is not required on a PUT. - */ - @JsonProperty(value = "tier") - private SkuTier tier; - - /* - * The SKU size. When the name field is the combination of tier and some - * other value, this would be the standalone code. - */ - @JsonProperty(value = "size") - private String size; - - /* - * If the service has different generations of hardware, for the same SKU, - * then that can be captured here. - */ - @JsonProperty(value = "family") - private String family; - - /* - * If the SKU supports scale out/in then the capacity integer should be - * included. If scale out/in is not possible for the resource this may be - * omitted. - */ - @JsonProperty(value = "capacity") - private Integer capacity; - - /** - * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more - * than one tier, but is not required on a PUT. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more - * than one tier, but is not required on a PUT. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(SkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this - * would be the standalone code. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this - * would be the standalone code. - * - * @param size the size value to set. - * @return the Sku object itself. - */ - public Sku withSize(String size) { - this.size = size; - return this; - } - - /** - * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be - * captured here. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be - * captured here. - * - * @param family the family value to set. - * @return the Sku object itself. - */ - public Sku withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If - * scale out/in is not possible for the resource this may be omitted. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If - * scale out/in is not possible for the resource this may be omitted. - * - * @param capacity the capacity value to set. - * @return the Sku object itself. - */ - public Sku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw logger - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SkuTier.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SkuTier.java deleted file mode 100644 index 015660718870..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SkuTier.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for SkuTier. */ -public enum SkuTier { - /** Enum value Free. */ - FREE("Free"), - - /** Enum value Basic. */ - BASIC("Basic"), - - /** Enum value Standard. */ - STANDARD("Standard"), - - /** Enum value Premium. */ - PREMIUM("Premium"); - - /** The actual serialized value for a SkuTier instance. */ - private final String value; - - SkuTier(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SkuTier instance. - * - * @param value the serialized value to parse. - * @return the parsed SkuTier object, or null if unable to parse. - */ - @JsonCreator - public static SkuTier fromString(String value) { - SkuTier[] items = SkuTier.values(); - for (SkuTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Skus.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Skus.java deleted file mode 100644 index 59fd1249ad23..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Skus.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Skus. */ -public interface Skus { - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - PagedIterable list(); - - /** - * Returns a list of all the Azure Lab Services resource SKUs. - * - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services skus. - */ - PagedIterable list(String filter, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java deleted file mode 100644 index 29f6f0a4c044..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Support contact information and instructions. */ -@Fluent -public final class SupportInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportInfo.class); - - /* - * Support web address. - */ - @JsonProperty(value = "url") - private String url; - - /* - * Support contact email address. - */ - @JsonProperty(value = "email") - private String email; - - /* - * Support contact phone number. - */ - @JsonProperty(value = "phone") - private String phone; - - /* - * Support instructions. - */ - @JsonProperty(value = "instructions") - private String instructions; - - /** - * Get the url property: Support web address. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Support web address. - * - * @param url the url value to set. - * @return the SupportInfo object itself. - */ - public SupportInfo withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the email property: Support contact email address. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Set the email property: Support contact email address. - * - * @param email the email value to set. - * @return the SupportInfo object itself. - */ - public SupportInfo withEmail(String email) { - this.email = email; - return this; - } - - /** - * Get the phone property: Support contact phone number. - * - * @return the phone value. - */ - public String phone() { - return this.phone; - } - - /** - * Set the phone property: Support contact phone number. - * - * @param phone the phone value to set. - * @return the SupportInfo object itself. - */ - public SupportInfo withPhone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get the instructions property: Support instructions. - * - * @return the instructions value. - */ - public String instructions() { - return this.instructions; - } - - /** - * Set the instructions property: Support instructions. - * - * @param instructions the instructions value to set. - * @return the SupportInfo object itself. - */ - public SupportInfo withInstructions(String instructions) { - this.instructions = instructions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java deleted file mode 100644 index 6349b73f01d6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Base tracked resource type for all PATCH updates. */ -@Fluent -public class TrackedResourceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackedResourceUpdate.class); - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - private List tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public List tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TrackedResourceUpdate object itself. - */ - public TrackedResourceUpdate withTags(List tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.java deleted file mode 100644 index d629595d01aa..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.UsageInner; - -/** An immutable client-side representation of Usage. */ -public interface Usage { - /** - * Gets the currentValue property: The current usage. - * - * @return the currentValue value. - */ - Long currentValue(); - - /** - * Gets the limit property: The limit integer. - * - * @return the limit value. - */ - Long limit(); - - /** - * Gets the unit property: The unit details. - * - * @return the unit value. - */ - UsageUnit unit(); - - /** - * Gets the name property: The name. - * - * @return the name value. - */ - UsageName name(); - - /** - * Gets the id property: The fully qualified arm resource id. - * - * @return the id value. - */ - String id(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.UsageInner object. - * - * @return the inner object. - */ - UsageInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java deleted file mode 100644 index 5c158a0651a1..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Usage Names. */ -@Fluent -public final class UsageName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); - - /* - * The localized name of the resource. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /* - * The name of the resource. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the localizedValue property: The localized name of the resource. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: The localized name of the resource. - * - * @param localizedValue the localizedValue value to set. - * @return the UsageName object itself. - */ - public UsageName withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Get the value property: The name of the resource. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The name of the resource. - * - * @param value the value value to set. - * @return the UsageName object itself. - */ - public UsageName withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.java deleted file mode 100644 index 7ad595b0d62f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for UsageUnit. */ -public final class UsageUnit extends ExpandableStringEnum { - /** Static value Count for UsageUnit. */ - public static final UsageUnit COUNT = fromString("Count"); - - /** - * Creates or finds a UsageUnit from its string representation. - * - * @param name a name to look for. - * @return the corresponding UsageUnit. - */ - @JsonCreator - public static UsageUnit fromString(String name) { - return fromString(name, UsageUnit.class); - } - - /** @return known UsageUnit values. */ - public static Collection values() { - return values(UsageUnit.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.java deleted file mode 100644 index 35928cffc7c3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Usages. */ -public interface Usages { - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - PagedIterable listByLocation(String location); - - /** - * Returns list of usage per SKU family for the specified subscription in the specified region. - * - * @param location The location name. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Core Usages. - */ - PagedIterable listByLocation(String location, String filter, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java deleted file mode 100644 index e6c7246ea10b..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import java.time.Duration; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of User. */ -public interface User { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the user resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Current provisioning state of the user resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the displayName property: Display name of the user, for example user's full name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the email property: Email address of the user. - * - * @return the email value. - */ - String email(); - - /** - * Gets the registrationState property: State of the user's registration within the lab. - * - * @return the registrationState value. - */ - RegistrationState registrationState(); - - /** - * Gets the invitationState property: State of the invitation message for the user. - * - * @return the invitationState value. - */ - InvitationState invitationState(); - - /** - * Gets the invitationSent property: Date and time when the invitation message was sent to the user. - * - * @return the invitationSent value. - */ - OffsetDateTime invitationSent(); - - /** - * Gets the totalUsage property: How long the user has used their virtual machines in this lab. - * - * @return the totalUsage value. - */ - Duration totalUsage(); - - /** - * Gets the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @return the additionalUsageQuota value. - */ - Duration additionalUsageQuota(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.UserInner object. - * - * @return the inner object. - */ - UserInner innerModel(); - - /** The entirety of the User definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithEmail, - DefinitionStages.WithCreate { - } - /** The User definition stages. */ - interface DefinitionStages { - /** The first stage of the User definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the User definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, labName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in - * resource URIs. - * @return the next definition stage. - */ - WithEmail withExistingLab(String resourceGroupName, String labName); - } - /** The stage of the User definition allowing to specify email. */ - interface WithEmail { - /** - * Specifies the email property: Email address of the user.. - * - * @param email Email address of the user. - * @return the next definition stage. - */ - WithCreate withEmail(String email); - } - /** - * The stage of the User definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithAdditionalUsageQuota { - /** - * Executes the create request. - * - * @return the created resource. - */ - User create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - User create(Context context); - } - /** The stage of the User definition allowing to specify additionalUsageQuota. */ - interface WithAdditionalUsageQuota { - /** - * Specifies the additionalUsageQuota property: The amount of usage quota time the user gets in addition to - * the lab usage quota.. - * - * @param additionalUsageQuota The amount of usage quota time the user gets in addition to the lab usage - * quota. - * @return the next definition stage. - */ - WithCreate withAdditionalUsageQuota(Duration additionalUsageQuota); - } - } - /** - * Begins update for the User resource. - * - * @return the stage of resource update. - */ - User.Update update(); - - /** The template for User update. */ - interface Update extends UpdateStages.WithAdditionalUsageQuota { - /** - * Executes the update request. - * - * @return the updated resource. - */ - User apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - User apply(Context context); - } - /** The User update stages. */ - interface UpdateStages { - /** The stage of the User update allowing to specify additionalUsageQuota. */ - interface WithAdditionalUsageQuota { - /** - * Specifies the additionalUsageQuota property: The amount of usage quota time the user gets in addition to - * the lab usage quota.. - * - * @param additionalUsageQuota The amount of usage quota time the user gets in addition to the lab usage - * quota. - * @return the next definition stage. - */ - Update withAdditionalUsageQuota(Duration additionalUsageQuota); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - User refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - User refresh(Context context); - - /** - * Operation to invite a user to a lab. - * - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void invite(InviteBody body); - - /** - * Operation to invite a user to a lab. - * - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void invite(InviteBody body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java deleted file mode 100644 index bf5aacfa6160..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.UserUpdateProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** User of a lab that can register for and use virtual machines within the lab. Used for updates. */ -@Fluent -public final class UserUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdate.class); - - /* - * User resource properties - */ - @JsonProperty(value = "properties") - private UserUpdateProperties innerProperties; - - /** - * Get the innerProperties property: User resource properties. - * - * @return the innerProperties value. - */ - private UserUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @return the additionalUsageQuota value. - */ - public Duration additionalUsageQuota() { - return this.innerProperties() == null ? null : this.innerProperties().additionalUsageQuota(); - } - - /** - * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage - * quota. - * - * @param additionalUsageQuota the additionalUsageQuota value to set. - * @return the UserUpdate object itself. - */ - public UserUpdate withAdditionalUsageQuota(Duration additionalUsageQuota) { - if (this.innerProperties() == null) { - this.innerProperties = new UserUpdateProperties(); - } - this.innerProperties().withAdditionalUsageQuota(additionalUsageQuota); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java deleted file mode 100644 index a766aa8ad88c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Users. */ -public interface Users { - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - PagedIterable listByLab(String resourceGroupName, String labName); - - /** - * Returns a list of all users for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of users. - */ - PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab. - */ - User get(String resourceGroupName, String labName, String username); - - /** - * Returns the properties of a lab user. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String labName, String username, Context context); - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String labName, String username); - - /** - * Operation to delete a user resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String labName, String username, Context context); - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void invite(String resourceGroupName, String labName, String username, InviteBody body); - - /** - * Operation to invite a user to a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context); - - /** - * Returns the properties of a lab user. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. - */ - User getById(String id); - - /** - * Returns the properties of a lab user. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Operation to delete a user resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Operation to delete a user resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new User resource. - * - * @param name resource name. - * @return the first stage of the new User definition. - */ - User.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.java deleted file mode 100644 index 4ae3003e3ac3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; - -/** An immutable client-side representation of VirtualMachine. */ -public interface VirtualMachine { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: System data of the Lab virtual machine. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the provisioningState property: Current provisioning state of the virtual machine. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the state property: The current state of the virtual machine. - * - * @return the state value. - */ - VirtualMachineState state(); - - /** - * Gets the connectionProfile property: Profile for information about connecting to the virtual machine. - * - * @return the connectionProfile value. - */ - VirtualMachineConnectionProfile connectionProfile(); - - /** - * Gets the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine. - * - * @return the claimedByUserId value. - */ - String claimedByUserId(); - - /** - * Gets the vmType property: The type of this VM resource. - * - * @return the vmType value. - */ - VirtualMachineType vmType(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner object. - * - * @return the inner object. - */ - VirtualMachineInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.java deleted file mode 100644 index 60440ad49e53..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The additional capabilities for a lab VM. */ -@Fluent -public final class VirtualMachineAdditionalCapabilities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineAdditionalCapabilities.class); - - /* - * Flag to pre-install dedicated GPU drivers. - */ - @JsonProperty(value = "installGpuDrivers") - private EnableState installGpuDrivers; - - /** - * Get the installGpuDrivers property: Flag to pre-install dedicated GPU drivers. - * - * @return the installGpuDrivers value. - */ - public EnableState installGpuDrivers() { - return this.installGpuDrivers; - } - - /** - * Set the installGpuDrivers property: Flag to pre-install dedicated GPU drivers. - * - * @param installGpuDrivers the installGpuDrivers value to set. - * @return the VirtualMachineAdditionalCapabilities object itself. - */ - public VirtualMachineAdditionalCapabilities withInstallGpuDrivers(EnableState installGpuDrivers) { - this.installGpuDrivers = installGpuDrivers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java deleted file mode 100644 index 01e1d968a5bb..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The connection information for the virtual machine. */ -@Immutable -public final class VirtualMachineConnectionProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineConnectionProfile.class); - - /* - * The private IP address of the virtual machine. - */ - @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) - private String privateIpAddress; - - /* - * Port and host name separated by semicolon for connecting via SSH - * protocol to the virtual machine. - */ - @JsonProperty(value = "sshAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String sshAuthority; - - /* - * URL for connecting via SSH protocol to the virtual machine in browser. - */ - @JsonProperty(value = "sshInBrowserUrl", access = JsonProperty.Access.WRITE_ONLY) - private String sshInBrowserUrl; - - /* - * Port and host name separated by semicolon for connecting via RDP - * protocol to the virtual machine. - */ - @JsonProperty(value = "rdpAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String rdpAuthority; - - /* - * URL for connecting via RDP protocol to the virtual machine in browser. - */ - @JsonProperty(value = "rdpInBrowserUrl", access = JsonProperty.Access.WRITE_ONLY) - private String rdpInBrowserUrl; - - /* - * The username used to log on to the virtual machine as admin. - */ - @JsonProperty(value = "adminUsername", access = JsonProperty.Access.WRITE_ONLY) - private String adminUsername; - - /* - * The username used to log on to the virtual machine as non-admin, if one - * exists. - */ - @JsonProperty(value = "nonAdminUsername", access = JsonProperty.Access.WRITE_ONLY) - private String nonAdminUsername; - - /** - * Get the privateIpAddress property: The private IP address of the virtual machine. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Get the sshAuthority property: Port and host name separated by semicolon for connecting via SSH protocol to the - * virtual machine. - * - * @return the sshAuthority value. - */ - public String sshAuthority() { - return this.sshAuthority; - } - - /** - * Get the sshInBrowserUrl property: URL for connecting via SSH protocol to the virtual machine in browser. - * - * @return the sshInBrowserUrl value. - */ - public String sshInBrowserUrl() { - return this.sshInBrowserUrl; - } - - /** - * Get the rdpAuthority property: Port and host name separated by semicolon for connecting via RDP protocol to the - * virtual machine. - * - * @return the rdpAuthority value. - */ - public String rdpAuthority() { - return this.rdpAuthority; - } - - /** - * Get the rdpInBrowserUrl property: URL for connecting via RDP protocol to the virtual machine in browser. - * - * @return the rdpInBrowserUrl value. - */ - public String rdpInBrowserUrl() { - return this.rdpInBrowserUrl; - } - - /** - * Get the adminUsername property: The username used to log on to the virtual machine as admin. - * - * @return the adminUsername value. - */ - public String adminUsername() { - return this.adminUsername; - } - - /** - * Get the nonAdminUsername property: The username used to log on to the virtual machine as non-admin, if one - * exists. - * - * @return the nonAdminUsername value. - */ - public String nonAdminUsername() { - return this.nonAdminUsername; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java deleted file mode 100644 index 14a10442eca0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; - -/** The base virtual machine configuration for a lab. */ -@Fluent -public final class VirtualMachineProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineProfile.class); - - /* - * Indicates what lab virtual machines are created from. - */ - @JsonProperty(value = "createOption", required = true) - private CreateOption createOption; - - /* - * The image configuration for lab virtual machines. - */ - @JsonProperty(value = "imageReference", required = true) - private ImageReference imageReference; - - /* - * The OS type of the image - */ - @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) - private OsType osType; - - /* - * The SKU for the lab. Defines the type of virtual machines used in the - * lab. - */ - @JsonProperty(value = "sku", required = true) - private Sku sku; - - /* - * Additional VM capabilities. - */ - @JsonProperty(value = "additionalCapabilities") - private VirtualMachineAdditionalCapabilities additionalCapabilities; - - /* - * The initial quota alloted to each lab user. Must be a time span between - * 0 and 9999 hours. - */ - @JsonProperty(value = "usageQuota", required = true) - private Duration usageQuota; - - /* - * Enabling this option will use the same password for all user VMs. - */ - @JsonProperty(value = "useSharedPassword") - private EnableState useSharedPassword; - - /* - * Credentials for the admin user on the VM. - */ - @JsonProperty(value = "adminUser", required = true) - private Credentials adminUser; - - /* - * Credentials for the non-admin user on the VM, if one exists. - */ - @JsonProperty(value = "nonAdminUser") - private Credentials nonAdminUser; - - /** - * Get the createOption property: Indicates what lab virtual machines are created from. - * - * @return the createOption value. - */ - public CreateOption createOption() { - return this.createOption; - } - - /** - * Set the createOption property: Indicates what lab virtual machines are created from. - * - * @param createOption the createOption value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withCreateOption(CreateOption createOption) { - this.createOption = createOption; - return this; - } - - /** - * Get the imageReference property: The image configuration for lab virtual machines. - * - * @return the imageReference value. - */ - public ImageReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: The image configuration for lab virtual machines. - * - * @param imageReference the imageReference value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withImageReference(ImageReference imageReference) { - this.imageReference = imageReference; - return this; - } - - /** - * Get the osType property: The OS type of the image. - * - * @return the osType value. - */ - public OsType osType() { - return this.osType; - } - - /** - * Get the sku property: The SKU for the lab. Defines the type of virtual machines used in the lab. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU for the lab. Defines the type of virtual machines used in the lab. - * - * @param sku the sku value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the additionalCapabilities property: Additional VM capabilities. - * - * @return the additionalCapabilities value. - */ - public VirtualMachineAdditionalCapabilities additionalCapabilities() { - return this.additionalCapabilities; - } - - /** - * Set the additionalCapabilities property: Additional VM capabilities. - * - * @param additionalCapabilities the additionalCapabilities value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withAdditionalCapabilities( - VirtualMachineAdditionalCapabilities additionalCapabilities) { - this.additionalCapabilities = additionalCapabilities; - return this; - } - - /** - * Get the usageQuota property: The initial quota alloted to each lab user. Must be a time span between 0 and 9999 - * hours. - * - * @return the usageQuota value. - */ - public Duration usageQuota() { - return this.usageQuota; - } - - /** - * Set the usageQuota property: The initial quota alloted to each lab user. Must be a time span between 0 and 9999 - * hours. - * - * @param usageQuota the usageQuota value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withUsageQuota(Duration usageQuota) { - this.usageQuota = usageQuota; - return this; - } - - /** - * Get the useSharedPassword property: Enabling this option will use the same password for all user VMs. - * - * @return the useSharedPassword value. - */ - public EnableState useSharedPassword() { - return this.useSharedPassword; - } - - /** - * Set the useSharedPassword property: Enabling this option will use the same password for all user VMs. - * - * @param useSharedPassword the useSharedPassword value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withUseSharedPassword(EnableState useSharedPassword) { - this.useSharedPassword = useSharedPassword; - return this; - } - - /** - * Get the adminUser property: Credentials for the admin user on the VM. - * - * @return the adminUser value. - */ - public Credentials adminUser() { - return this.adminUser; - } - - /** - * Set the adminUser property: Credentials for the admin user on the VM. - * - * @param adminUser the adminUser value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withAdminUser(Credentials adminUser) { - this.adminUser = adminUser; - return this; - } - - /** - * Get the nonAdminUser property: Credentials for the non-admin user on the VM, if one exists. - * - * @return the nonAdminUser value. - */ - public Credentials nonAdminUser() { - return this.nonAdminUser; - } - - /** - * Set the nonAdminUser property: Credentials for the non-admin user on the VM, if one exists. - * - * @param nonAdminUser the nonAdminUser value to set. - * @return the VirtualMachineProfile object itself. - */ - public VirtualMachineProfile withNonAdminUser(Credentials nonAdminUser) { - this.nonAdminUser = nonAdminUser; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (createOption() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property createOption in model VirtualMachineProfile")); - } - if (imageReference() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property imageReference in model VirtualMachineProfile")); - } else { - imageReference().validate(); - } - if (sku() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model VirtualMachineProfile")); - } else { - sku().validate(); - } - if (additionalCapabilities() != null) { - additionalCapabilities().validate(); - } - if (usageQuota() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property usageQuota in model VirtualMachineProfile")); - } - if (adminUser() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property adminUser in model VirtualMachineProfile")); - } else { - adminUser().validate(); - } - if (nonAdminUser() != null) { - nonAdminUser().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.java deleted file mode 100644 index be9f29a1a527..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for VirtualMachineState. */ -public enum VirtualMachineState { - /** Enum value Stopped. */ - STOPPED("Stopped"), - - /** Enum value Starting. */ - STARTING("Starting"), - - /** Enum value Running. */ - RUNNING("Running"), - - /** Enum value Stopping. */ - STOPPING("Stopping"), - - /** Enum value ResettingPassword. */ - RESETTING_PASSWORD("ResettingPassword"), - - /** Enum value Reimaging. */ - REIMAGING("Reimaging"), - - /** Enum value Redeploying. */ - REDEPLOYING("Redeploying"); - - /** The actual serialized value for a VirtualMachineState instance. */ - private final String value; - - VirtualMachineState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a VirtualMachineState instance. - * - * @param value the serialized value to parse. - * @return the parsed VirtualMachineState object, or null if unable to parse. - */ - @JsonCreator - public static VirtualMachineState fromString(String value) { - VirtualMachineState[] items = VirtualMachineState.values(); - for (VirtualMachineState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.java deleted file mode 100644 index 1229ba20ba6f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for VirtualMachineType. */ -public enum VirtualMachineType { - /** Enum value User. */ - USER("User"), - - /** Enum value Template. */ - TEMPLATE("Template"); - - /** The actual serialized value for a VirtualMachineType instance. */ - private final String value; - - VirtualMachineType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a VirtualMachineType instance. - * - * @param value the serialized value to parse. - * @return the parsed VirtualMachineType object, or null if unable to parse. - */ - @JsonCreator - public static VirtualMachineType fromString(String value) { - VirtualMachineType[] items = VirtualMachineType.values(); - for (VirtualMachineType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java deleted file mode 100644 index 0a5e33a46726..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of VirtualMachines. */ -public interface VirtualMachines { - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - PagedIterable listByLab(String resourceGroupName, String labName); - - /** - * Returns a list of all virtual machines for a lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param filter The filter to apply to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged list of lab services virtual machines. - */ - PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource. - */ - VirtualMachine get(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Returns the properties for a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab virtual machine resource along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to start a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to stop a lab virtual machine. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void reimage(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published - * snapshot of the reference environment of the lab. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void reimage(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void redeploy(String resourceGroupName, String labName, String virtualMachineName); - - /** - * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context); - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void resetPassword(String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body); - - /** - * Resets a lab virtual machine password. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource - * URIs. - * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. - * Used in resource URIs. - * @param body The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void resetPassword( - String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.java deleted file mode 100644 index 9277a8a4b20c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for WeekDay. */ -public enum WeekDay { - /** Enum value Sunday. */ - SUNDAY("Sunday"), - - /** Enum value Monday. */ - MONDAY("Monday"), - - /** Enum value Tuesday. */ - TUESDAY("Tuesday"), - - /** Enum value Wednesday. */ - WEDNESDAY("Wednesday"), - - /** Enum value Thursday. */ - THURSDAY("Thursday"), - - /** Enum value Friday. */ - FRIDAY("Friday"), - - /** Enum value Saturday. */ - SATURDAY("Saturday"); - - /** The actual serialized value for a WeekDay instance. */ - private final String value; - - WeekDay(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a WeekDay instance. - * - * @param value the serialized value to parse. - * @return the parsed WeekDay object, or null if unable to parse. - */ - @JsonCreator - public static WeekDay fromString(String value) { - WeekDay[] items = WeekDay.values(); - for (WeekDay item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java deleted file mode 100644 index d81e0f8a774b..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for LabServicesClient. REST API for managing Azure Lab Services images. */ -package com.azure.resourcemanager.labservices.models; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java deleted file mode 100644 index ab8d6690d2e9..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for LabServicesClient. REST API for managing Azure Lab Services images. */ -package com.azure.resourcemanager.labservices; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/module-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/module-info.java deleted file mode 100644 index c4f4afb79235..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/module-info.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.resourcemanager.labservices { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.labservices; - exports com.azure.resourcemanager.labservices.fluent; - exports com.azure.resourcemanager.labservices.fluent.models; - exports com.azure.resourcemanager.labservices.models; - - opens com.azure.resourcemanager.labservices.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.labservices.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java deleted file mode 100644 index 0fd737fe939a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.resourcemanager.labservices.models.EnableState; - -/** Samples for Images CreateOrUpdate. */ -public final class ImagesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/putImage.json - */ - /** - * Sample code: putImage. - * - * @param manager Entry point to LabServicesManager. - */ - public static void putImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .images() - .define("image1") - .withExistingLabPlan("testrg123", "testlabplan") - .withEnabledState(EnableState.ENABLED) - .create(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.java deleted file mode 100644 index 97e44adbb3c7..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Images Get. */ -public final class ImagesGetSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/getImage.json - */ - /** - * Sample code: getImage. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.images().getWithResponse("testrg123", "testlabplan", "image1", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.java deleted file mode 100644 index d2b5e0159e9c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Images ListByLabPlan. */ -public final class ImagesListByLabPlanSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/listImages.json - */ - /** - * Sample code: listImages. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listImages(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.images().listByLabPlan("testrg123", "testlabplan", null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.java deleted file mode 100644 index 229d9145976c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.Image; - -/** Samples for Images Update. */ -public final class ImagesUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/patchImage.json - */ - /** - * Sample code: patchImage. - * - * @param manager Entry point to LabServicesManager. - */ - public static void patchImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { - Image resource = - manager.images().getWithResponse("testrg123", "testlabplan", "image1", Context.NONE).getValue(); - resource.update().withEnabledState(EnableState.ENABLED).apply(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.java deleted file mode 100644 index ae50f65419f0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.ConnectionType; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; -import com.azure.resourcemanager.labservices.models.ShutdownOnIdleMode; -import com.azure.resourcemanager.labservices.models.SupportInfo; -import java.time.Duration; - -/** Samples for LabPlans CreateOrUpdate. */ -public final class LabPlansCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/putLabPlan.json - */ - /** - * Sample code: putLabPlan. - * - * @param manager Entry point to LabServicesManager. - */ - public static void putLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .labPlans() - .define("testlabplan") - .withRegion("westus") - .withExistingResourceGroup("testrg123") - .withDefaultConnectionProfile( - new ConnectionProfile() - .withWebSshAccess(ConnectionType.NONE) - .withWebRdpAccess(ConnectionType.NONE) - .withClientSshAccess(ConnectionType.PUBLIC) - .withClientRdpAccess(ConnectionType.PUBLIC)) - .withDefaultAutoShutdownProfile( - new AutoShutdownProfile() - .withShutdownOnDisconnect(EnableState.ENABLED) - .withShutdownWhenNotConnected(EnableState.ENABLED) - .withShutdownOnIdle(ShutdownOnIdleMode.USER_ABSENCE) - .withDisconnectDelay(Duration.parse("00:05")) - .withNoConnectDelay(Duration.parse("01:00")) - .withIdleDelay(Duration.parse("01:00"))) - .withDefaultNetworkProfile( - new LabPlanNetworkProfile() - .withSubnetId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")) - .withSharedGalleryId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Compute/galleries/testsig") - .withSupportInfo( - new SupportInfo() - .withUrl("help.contoso.com") - .withEmail("help@contoso.com") - .withPhone("+1-202-555-0123") - .withInstructions("Contact support for help.")) - .create(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.java deleted file mode 100644 index e5dadb6b47d8..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for LabPlans Delete. */ -public final class LabPlansDeleteSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/deleteLabPlan.json - */ - /** - * Sample code: deleteLabPlan. - * - * @param manager Entry point to LabServicesManager. - */ - public static void deleteLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labPlans().delete("testrg123", "testlabplan", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.java deleted file mode 100644 index 1346c881d822..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for LabPlans GetByResourceGroup. */ -public final class LabPlansGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/getLabPlan.json - */ - /** - * Sample code: getLabPlan. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labPlans().getByResourceGroupWithResponse("testrg123", "testlabplan", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.java deleted file mode 100644 index d16e26863214..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for LabPlans ListByResourceGroup. */ -public final class LabPlansListByResourceGroupSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/listResourceGroupLabPlans.json - */ - /** - * Sample code: listResourceGroupLabPlans. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listResourceGroupLabPlans(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labPlans().listByResourceGroup("testrg123", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.java deleted file mode 100644 index d75db6c5d98c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for LabPlans List. */ -public final class LabPlansListSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/listLabPlans.json - */ - /** - * Sample code: listLabPlans. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listLabPlans(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labPlans().list(null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.java deleted file mode 100644 index cfb92b0bb04d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.SaveImageBody; - -/** Samples for LabPlans SaveImage. */ -public final class LabPlansSaveImageSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/saveImageVirtualMachine.json - */ - /** - * Sample code: saveImageVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void saveImageVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .labPlans() - .saveImage( - "testrg123", - "testlabplan", - new SaveImageBody() - .withName("Test Image") - .withLabVirtualMachineId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/virtualMachines/template"), - Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.java deleted file mode 100644 index 6b7a7452919d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.ConnectionType; -import com.azure.resourcemanager.labservices.models.LabPlan; - -/** Samples for LabPlans Update. */ -public final class LabPlansUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/patchLabPlan.json - */ - /** - * Sample code: patchLabPlan. - * - * @param manager Entry point to LabServicesManager. - */ - public static void patchLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { - LabPlan resource = - manager.labPlans().getByResourceGroupWithResponse("testrg123", "testlabplan", Context.NONE).getValue(); - resource - .update() - .withDefaultConnectionProfile( - new ConnectionProfile() - .withWebSshAccess(ConnectionType.NONE) - .withWebRdpAccess(ConnectionType.NONE) - .withClientSshAccess(ConnectionType.PUBLIC) - .withClientRdpAccess(ConnectionType.PUBLIC)) - .apply(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java deleted file mode 100644 index 96eab3ebebf6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; -import com.azure.resourcemanager.labservices.models.ConnectionProfile; -import com.azure.resourcemanager.labservices.models.ConnectionType; -import com.azure.resourcemanager.labservices.models.CreateOption; -import com.azure.resourcemanager.labservices.models.Credentials; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.ImageReference; -import com.azure.resourcemanager.labservices.models.LabNetworkProfile; -import com.azure.resourcemanager.labservices.models.SecurityProfile; -import com.azure.resourcemanager.labservices.models.ShutdownOnIdleMode; -import com.azure.resourcemanager.labservices.models.Sku; -import com.azure.resourcemanager.labservices.models.VirtualMachineAdditionalCapabilities; -import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; -import java.time.Duration; - -/** Samples for Labs CreateOrUpdate. */ -public final class LabsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/putLab.json - */ - /** - * Sample code: putLab. - * - * @param manager Entry point to LabServicesManager. - */ - public static void putLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .labs() - .define("testlab") - .withRegion("westus") - .withExistingResourceGroup("testrg123") - .withNetworkProfile( - new LabNetworkProfile() - .withSubnetId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")) - .withAutoShutdownProfile( - new AutoShutdownProfile() - .withShutdownOnDisconnect(EnableState.ENABLED) - .withShutdownWhenNotConnected(EnableState.ENABLED) - .withShutdownOnIdle(ShutdownOnIdleMode.USER_ABSENCE) - .withDisconnectDelay(Duration.parse("00:05")) - .withNoConnectDelay(Duration.parse("01:00")) - .withIdleDelay(Duration.parse("01:00"))) - .withConnectionProfile( - new ConnectionProfile() - .withWebSshAccess(ConnectionType.NONE) - .withWebRdpAccess(ConnectionType.NONE) - .withClientSshAccess(ConnectionType.PUBLIC) - .withClientRdpAccess(ConnectionType.PUBLIC)) - .withVirtualMachineProfile( - new VirtualMachineProfile() - .withCreateOption(CreateOption.TEMPLATE_VM) - .withImageReference( - new ImageReference() - .withOffer("WindowsServer") - .withPublisher("Microsoft") - .withSku("2019-Datacenter") - .withVersion("2019.0.20190410")) - .withSku(new Sku().withName("Medium")) - .withAdditionalCapabilities( - new VirtualMachineAdditionalCapabilities().withInstallGpuDrivers(EnableState.DISABLED)) - .withUsageQuota(Duration.parse("10:00")) - .withUseSharedPassword(EnableState.DISABLED) - .withAdminUser(new Credentials().withUsername("test-user"))) - .withSecurityProfile(new SecurityProfile().withOpenAccess(EnableState.DISABLED)) - .withLabPlanId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan") - .withTitle("Test Lab") - .withDescription("This is a test lab.") - .create(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsDeleteSamples.java deleted file mode 100644 index e00d47f23f80..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Labs Delete. */ -public final class LabsDeleteSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/deleteLab.json - */ - /** - * Sample code: deleteLab. - * - * @param manager Entry point to LabServicesManager. - */ - public static void deleteLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labs().delete("testrg123", "testlab", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsGetByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsGetByResourceGroupSamples.java deleted file mode 100644 index d75bc1cd33fa..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Labs GetByResourceGroup. */ -public final class LabsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/getLab.json - */ - /** - * Sample code: getLab. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labs().getByResourceGroupWithResponse("testrg123", "testlab", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListByResourceGroupSamples.java deleted file mode 100644 index ec0edd684538..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Labs ListByResourceGroup. */ -public final class LabsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/listResourceGroupLabs.json - */ - /** - * Sample code: listResourceGroupLabs. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listResourceGroupLabs(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labs().listByResourceGroup("testrg123", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListSamples.java deleted file mode 100644 index 63fefa80b99f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Labs List. */ -public final class LabsListSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/listLabs.json - */ - /** - * Sample code: listLabs. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listLabs(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labs().list(null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.java deleted file mode 100644 index 87f2fb32eb3c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Labs Publish. */ -public final class LabsPublishSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/publishLab.json - */ - /** - * Sample code: publishLab. - * - * @param manager Entry point to LabServicesManager. - */ - public static void publishLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labs().publish("testrg123", "testlab", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.java deleted file mode 100644 index 03f0090bd50a..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Labs SyncGroup. */ -public final class LabsSyncGroupSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/syncLab.json - */ - /** - * Sample code: syncLab. - * - * @param manager Entry point to LabServicesManager. - */ - public static void syncLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.labs().syncGroup("testrg123", "testlab", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.java deleted file mode 100644 index 002dd14557d1..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.EnableState; -import com.azure.resourcemanager.labservices.models.Lab; -import com.azure.resourcemanager.labservices.models.SecurityProfile; - -/** Samples for Labs Update. */ -public final class LabsUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/patchLab.json - */ - /** - * Sample code: patchLab. - * - * @param manager Entry point to LabServicesManager. - */ - public static void patchLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { - Lab resource = manager.labs().getByResourceGroupWithResponse("testrg123", "testlab", Context.NONE).getValue(); - resource.update().withSecurityProfile(new SecurityProfile().withOpenAccess(EnableState.ENABLED)).apply(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.java deleted file mode 100644 index 218f42c54ca6..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for OperationResults Get. */ -public final class OperationResultsGetSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/OperationResults/getOperationResult.json - */ - /** - * Sample code: getOperationResult. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getOperationResult(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.operationResults().getWithResponse("a64149d8-84cb-4566-ab8e-b4ee1a074174", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.java deleted file mode 100644 index 386139845e35..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabServices/listOperations.json - */ - /** - * Sample code: listOperations. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listOperations(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.operations().list(Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java deleted file mode 100644 index f304f71d5990..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.resourcemanager.labservices.models.RecurrenceFrequency; -import com.azure.resourcemanager.labservices.models.RecurrencePattern; -import java.time.LocalDate; -import java.time.OffsetDateTime; - -/** Samples for Schedules CreateOrUpdate. */ -public final class SchedulesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/putSchedule.json - */ - /** - * Sample code: putSchedule. - * - * @param manager Entry point to LabServicesManager. - */ - public static void putSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .schedules() - .define("schedule1") - .withExistingLab("testrg123", "testlab") - .withStartAt(OffsetDateTime.parse("2020-05-26T12:00:00Z")) - .withStopAt(OffsetDateTime.parse("2020-05-26T18:00:00Z")) - .withRecurrencePattern( - new RecurrencePattern() - .withFrequency(RecurrenceFrequency.DAILY) - .withInterval(2) - .withExpirationDate(LocalDate.parse("2020-08-14"))) - .withTimeZoneId("America/Los_Angeles") - .withNotes("Schedule 1 for students") - .create(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesDeleteSamples.java deleted file mode 100644 index 0bbf78d882cf..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Schedules Delete. */ -public final class SchedulesDeleteSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/deleteSchedule.json - */ - /** - * Sample code: deleteSchedule. - * - * @param manager Entry point to LabServicesManager. - */ - public static void deleteSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.schedules().delete("testrg123", "testlab", "schedule1", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesGetSamples.java deleted file mode 100644 index 0d687b8ac5f3..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Schedules Get. */ -public final class SchedulesGetSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/getSchedule.json - */ - /** - * Sample code: getSchedule. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.schedules().getWithResponse("testrg123", "testlab", "schedule1", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.java deleted file mode 100644 index 1eba45ff2526..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Schedules ListByLab. */ -public final class SchedulesListByLabSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/listSchedule.json - */ - /** - * Sample code: getListSchedule. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getListSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.schedules().listByLab("testrg123", "testlab", null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.java deleted file mode 100644 index 0d7c4df73b43..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.RecurrenceFrequency; -import com.azure.resourcemanager.labservices.models.RecurrencePattern; -import com.azure.resourcemanager.labservices.models.Schedule; -import java.time.LocalDate; - -/** Samples for Schedules Update. */ -public final class SchedulesUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/patchSchedule.json - */ - /** - * Sample code: patchSchedule. - * - * @param manager Entry point to LabServicesManager. - */ - public static void patchSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { - Schedule resource = - manager.schedules().getWithResponse("testrg123", "testlab", "schedule1", Context.NONE).getValue(); - resource - .update() - .withRecurrencePattern( - new RecurrencePattern() - .withFrequency(RecurrenceFrequency.DAILY) - .withInterval(2) - .withExpirationDate(LocalDate.parse("2020-08-14"))) - .apply(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.java deleted file mode 100644 index e1dc4f497136..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Skus List. */ -public final class SkusListSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Skus/listSkus.json - */ - /** - * Sample code: listSkus. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listSkus(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.skus().list(null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.java deleted file mode 100644 index 54ac5359d0cb..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Usages ListByLocation. */ -public final class UsagesListByLocationSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Usages/getUsages.json - */ - /** - * Sample code: listUsages. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listUsages(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.usages().listByLocation("westus2", null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.java deleted file mode 100644 index 90488cd05095..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import java.time.Duration; - -/** Samples for Users CreateOrUpdate. */ -public final class UsersCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/putUser.json - */ - /** - * Sample code: putUser. - * - * @param manager Entry point to LabServicesManager. - */ - public static void putUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .users() - .define("testuser") - .withExistingLab("testrg123", "testlab") - .withEmail("testuser@contoso.com") - .withAdditionalUsageQuota(Duration.parse("20:00")) - .create(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersDeleteSamples.java deleted file mode 100644 index 9699f5ec112f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Users Delete. */ -public final class UsersDeleteSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/deleteUser.json - */ - /** - * Sample code: deleteUser. - * - * @param manager Entry point to LabServicesManager. - */ - public static void deleteUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.users().delete("testrg123", "testlab", "testuser", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersGetSamples.java deleted file mode 100644 index be62aace0ad2..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Users Get. */ -public final class UsersGetSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/getUser.json - */ - /** - * Sample code: getUser. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.users().getWithResponse("testrg123", "testlab", "testuser", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.java deleted file mode 100644 index bacbfc338512..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.InviteBody; - -/** Samples for Users Invite. */ -public final class UsersInviteSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/inviteUser.json - */ - /** - * Sample code: inviteUser. - * - * @param manager Entry point to LabServicesManager. - */ - public static void inviteUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .users() - .invite( - "testrg123", - "testlab", - "testuser", - new InviteBody().withText("Invitation to lab testlab"), - Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.java deleted file mode 100644 index 4760ac3f9325..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for Users ListByLab. */ -public final class UsersListByLabSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/listUser.json - */ - /** - * Sample code: listUser. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.users().listByLab("testrg123", "testlab", null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.java deleted file mode 100644 index c3f2bb4f5928..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.User; -import java.time.Duration; - -/** Samples for Users Update. */ -public final class UsersUpdateSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/patchUser.json - */ - /** - * Sample code: patchUser. - * - * @param manager Entry point to LabServicesManager. - */ - public static void patchUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { - User resource = manager.users().getWithResponse("testrg123", "testlab", "testuser", Context.NONE).getValue(); - resource.update().withAdditionalUsageQuota(Duration.parse("20:00")).apply(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesGetSamples.java deleted file mode 100644 index 10e5d02ba815..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Get. */ -public final class VirtualMachinesGetSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/getVirtualMachine.json - */ - /** - * Sample code: getVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void getVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.virtualMachines().getWithResponse("testrg123", "testlab", "template", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.java deleted file mode 100644 index 675738c03ef0..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines ListByLab. */ -public final class VirtualMachinesListByLabSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/listVirtualMachine.json - */ - /** - * Sample code: listVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void listVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.virtualMachines().listByLab("testrg123", "testlab", null, Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesRedeploySamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesRedeploySamples.java deleted file mode 100644 index 3879044d3c98..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesRedeploySamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Redeploy. */ -public final class VirtualMachinesRedeploySamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/redeployVirtualMachine.json - */ - /** - * Sample code: redeployVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void redeployVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.virtualMachines().redeploy("testrg123", "testlab", "template", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.java deleted file mode 100644 index e852754d5f75..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Reimage. */ -public final class VirtualMachinesReimageSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/reimageVirtualMachine.json - */ - /** - * Sample code: reimageVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void reimageVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.virtualMachines().reimage("testrg123", "testlab", "template", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.java deleted file mode 100644 index 9973f710d06f..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.models.ResetPasswordBody; - -/** Samples for VirtualMachines ResetPassword. */ -public final class VirtualMachinesResetPasswordSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/resetPasswordVirtualMachine.json - */ - /** - * Sample code: resetPasswordVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void resetPasswordVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager - .virtualMachines() - .resetPassword( - "testrg123", - "testlab", - "template", - new ResetPasswordBody().withUsername("example-username").withPassword("example-password"), - Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStartSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStartSamples.java deleted file mode 100644 index 82e77b0c9b2c..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStartSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Start. */ -public final class VirtualMachinesStartSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/startVirtualMachine.json - */ - /** - * Sample code: startVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void startVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.virtualMachines().start("testrg123", "testlab", "template", Context.NONE); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStopSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStopSamples.java deleted file mode 100644 index f73e1111096d..000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStopSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Stop. */ -public final class VirtualMachinesStopSamples { - /* - * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/stopVirtualMachine.json - */ - /** - * Sample code: stopVirtualMachine. - * - * @param manager Entry point to LabServicesManager. - */ - public static void stopVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { - manager.virtualMachines().stop("testrg123", "testlab", "template", Context.NONE); - } -}