diff --git a/sdk/appplatform/mgmt/.gitignore b/sdk/appplatform/mgmt/.gitignore new file mode 100644 index 000000000000..f537a954e09a --- /dev/null +++ b/sdk/appplatform/mgmt/.gitignore @@ -0,0 +1,2 @@ +/piggymetrics +# folder created in unit test diff --git a/sdk/appplatform/mgmt/pom.xml b/sdk/appplatform/mgmt/pom.xml new file mode 100644 index 000000000000..6b323b92c0cf --- /dev/null +++ b/sdk/appplatform/mgmt/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + + com.azure.resourcemanager + azure-resourcemanager-parent + 2.0.0-SNAPSHOT + ../../management/pom.xml + + + azure-resourcemanager-appplatform + jar + + Microsoft Azure SDK for App Platform Management + This package contains Microsoft Azure App Platform Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + com.azure.resourcemanager + azure-resourcemanager-resources + 2.0.0-SNAPSHOT + + + com.azure + azure-storage-file-share + 12.5.0 + + + org.apache.commons + commons-compress + 1.20 + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-api + test + + + com.azure + azure-core-http-netty + test + + + com.azure + azure-identity + test + + + + + azure-mgmt-sdk-test-jar + + + !maven.test.skip + + + + + com.azure.resourcemanager + azure-resourcemanager-resources + 2.0.0-SNAPSHOT + test-jar + test + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + true + + true + true + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java new file mode 100644 index 000000000000..4954f555b43b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.appplatform.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.fluent.BindingsClient; +import com.azure.resourcemanager.appplatform.fluent.CertificatesClient; +import com.azure.resourcemanager.appplatform.fluent.CustomDomainsClient; +import com.azure.resourcemanager.appplatform.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.fluent.OperationsClient; +import com.azure.resourcemanager.appplatform.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.fluent.SkusClient; + +/** Initializes a new instance of the AppPlatformManagementClient type. */ +@ServiceClient(builder = AppPlatformManagementClientBuilder.class) +public final class AppPlatformManagementClient extends AzureServiceClient { + private final ClientLogger logger = new ClientLogger(AppPlatformManagementClient.class); + + /** + * Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @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 ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The AppsClient object to access its operations. */ + private final AppsClient apps; + + /** + * Gets the AppsClient object to access its operations. + * + * @return the AppsClient object. + */ + public AppsClient getApps() { + return this.apps; + } + + /** The BindingsClient object to access its operations. */ + private final BindingsClient bindings; + + /** + * Gets the BindingsClient object to access its operations. + * + * @return the BindingsClient object. + */ + public BindingsClient getBindings() { + return this.bindings; + } + + /** The CertificatesClient object to access its operations. */ + private final CertificatesClient certificates; + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + public CertificatesClient getCertificates() { + return this.certificates; + } + + /** The CustomDomainsClient object to access its operations. */ + private final CustomDomainsClient customDomains; + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + public CustomDomainsClient getCustomDomains() { + return this.customDomains; + } + + /** The DeploymentsClient object to access its operations. */ + private final DeploymentsClient deployments; + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + public DeploymentsClient getDeployments() { + return this.deployments; + } + + /** 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 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 AppPlatformManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param environment The Azure environment. + */ + AppPlatformManagementClient( + HttpPipeline httpPipeline, AzureEnvironment environment, String subscriptionId, String endpoint) { + super(httpPipeline, environment); + this.httpPipeline = httpPipeline; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2019-05-01-preview"; + this.services = new ServicesClient(this); + this.apps = new AppsClient(this); + this.bindings = new BindingsClient(this); + this.certificates = new CertificatesClient(this); + this.customDomains = new CustomDomainsClient(this); + this.deployments = new DeploymentsClient(this); + this.operations = new OperationsClient(this); + this.skus = new SkusClient(this); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java new file mode 100644 index 000000000000..fe7fcab4df6b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform; + +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; + +/** A builder for creating a new instance of the AppPlatformManagementClient type. */ +@ServiceClientBuilder(serviceClients = {AppPlatformManagementClient.class}) +public final class AppPlatformManagementClientBuilder { + /* + * Gets subscription ID which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder 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 AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Builds an instance of AppPlatformManagementClient with the provided parameters. + * + * @return an instance of AppPlatformManagementClient. + */ + public AppPlatformManagementClient buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + AppPlatformManagementClient client = + new AppPlatformManagementClient(pipeline, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java new file mode 100644 index 000000000000..02426a2949cd --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform; + + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpPipeline; +import com.azure.resourcemanager.appplatform.implementation.SpringServicesImpl; +import com.azure.resourcemanager.appplatform.models.SpringServices; +import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; +import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; +import com.azure.resourcemanager.resources.fluentcore.arm.implementation.Manager; +import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; +import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; + +/** Entry point to Azure App Platform management. */ +public final class AppPlatformManager extends Manager { + // Collections + private SpringServices springServices; + /** + * Get a Configurable instance that can be used to create AppPlatformManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AppPlatformManager.ConfigurableImpl(); + } + + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param credential the credential to use + * @param profile the profile to use + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate(TokenCredential credential, AzureProfile profile) { + return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); + } + + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param httpPipeline the HttpPipeline to be used for API calls. + * @param profile the profile to use + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + return authenticate(httpPipeline, profile, new SdkContext()); + } + + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param httpPipeline the HttpPipeline to be used for API calls. + * @param profile the profile to use + * @param sdkContext the sdk context + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate( + HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) { + return new AppPlatformManager(httpPipeline, profile, sdkContext); + } + + /** The interface allowing configurations to be set. */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param credential the credential to use + * @param profile the profile to use + * @return the interface exposing AppPlatform management API entry points that work across subscriptions + */ + AppPlatformManager authenticate(TokenCredential credential, AzureProfile profile); + } + + /** The implementation for Configurable interface. */ + private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { + public AppPlatformManager authenticate(TokenCredential credential, AzureProfile profile) { + return AppPlatformManager.authenticate(buildHttpPipeline(credential, profile), profile); + } + } + + private AppPlatformManager(HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) { + super( + httpPipeline, + profile, + new AppPlatformManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.environment().getResourceManagerEndpoint()) + .subscriptionId(profile.subscriptionId()) + .buildClient(), + sdkContext); + } + + /** @return Entry point for Spring Service management API. */ + public SpringServices springServices() { + if (springServices == null) { + springServices = new SpringServicesImpl(this); + } + return springServices; + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java new file mode 100644 index 000000000000..7e392b21bc22 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java @@ -0,0 +1,1577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +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.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.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.appplatform.models.ResourceUploadDefinition; +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 Apps. */ +public final class AppsClient { + private final ClientLogger logger = new ClientLogger(AppsClient.class); + + /** The proxy service used to perform REST calls. */ + private final AppsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of AppsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public AppsClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(AppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface AppsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @QueryParam("syncStatus") String syncStatus, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") AppResourceInner appResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") AppResourceInner appResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/getResourceUploadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getResourceUploadUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + syncStatus, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + syncStatus, + context); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String serviceName, String appName) { + final String syncStatus = null; + final Context context = null; + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get(String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getAsync(resourceGroupName, serviceName, appName, syncStatus).block(); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + return getAsync(resourceGroupName, serviceName, appName, syncStatus, context).block(); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get(String resourceGroupName, String serviceName, String appName) { + final String syncStatus = null; + final Context context = null; + return getAsync(resourceGroupName, serviceName, appName, syncStatus).block(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).getSyncPoller(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).getSyncPoller(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).block(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName) { + deleteAsync(resourceGroupName, serviceName, appName).block(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, context).block(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource).getSyncPoller(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).getSyncPoller(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateAsync(resourceGroupName, serviceName, appName, appResource).block(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return updateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getResourceUploadUrlAsync( + String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, appName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getResourceUploadUrlAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, appName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceUploadDefinition getResourceUploadUrl(String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlAsync(resourceGroupName, serviceName, appName).block(); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceUploadDefinition getResourceUploadUrl( + String resourceGroupName, String serviceName, String appName, Context context) { + return getResourceUploadUrlAsync(resourceGroupName, serviceName, appName, 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 object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java new file mode 100644 index 000000000000..9a10fb6f6cdf --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java @@ -0,0 +1,1296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +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.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.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.BindingResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.BindingResourceInner; +import com.azure.resourcemanager.appplatform.models.BindingResourceProperties; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Bindings. */ +public final class BindingsClient { + private final ClientLogger logger = new ClientLogger(BindingsClient.class); + + /** The proxy service used to perform REST calls. */ + private final BindingsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of BindingsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public BindingsClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(BindingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBindings to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface BindingsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @BodyParam("application/json") BindingResourceInner bindingResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @BodyParam("application/json") BindingResourceInner bindingResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, bindingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner get(String resourceGroupName, String serviceName, String appName, String bindingName) { + return getAsync(resourceGroupName, serviceName, appName, bindingName).block(); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner get( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return getAsync(resourceGroupName, serviceName, appName, bindingName, context).block(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, bindingName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, properties).block(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, properties, context).block(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, bindingName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String bindingName) { + deleteAsync(resourceGroupName, serviceName, appName, bindingName).block(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String bindingName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, bindingName, context).block(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return updateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return updateAsync(resourceGroupName, serviceName, appName, bindingName, properties).block(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, bindingName, properties, context).block(); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, 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 object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java new file mode 100644 index 000000000000..5a1853b7f415 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java @@ -0,0 +1,956 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +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.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.CertificateResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.CertificateResourceInner; +import com.azure.resourcemanager.appplatform.models.CertificateProperties; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Certificates. */ +public final class CertificatesClient { + private final ClientLogger logger = new ClientLogger(CertificatesClient.class); + + /** The proxy service used to perform REST calls. */ + private final CertificatesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of CertificatesClient. + * + * @param client the instance of the service client containing this operation class. + */ + public CertificatesClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCertificates to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface CertificatesService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates/{certificateName}") + @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("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates/{certificateName}") + @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("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") CertificateResourceInner certificateResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String certificateName) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner get(String resourceGroupName, String serviceName, String certificateName) { + return getAsync(resourceGroupName, serviceName, certificateName).block(); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner get( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return getAsync(resourceGroupName, serviceName, certificateName, context).block(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + certificateResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + certificateResource, + context); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateProperties properties, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, certificateName, properties).block(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, certificateName, properties, context).block(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String certificateName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, certificateName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, certificateName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String certificateName) { + deleteAsync(resourceGroupName, serviceName, certificateName).block(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String certificateName, Context context) { + deleteAsync(resourceGroupName, serviceName, certificateName, context).block(); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, 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 collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java new file mode 100644 index 000000000000..bf62bebbb1a7 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java @@ -0,0 +1,1526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.CustomDomainResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.CustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.models.CustomDomainProperties; +import com.azure.resourcemanager.appplatform.models.CustomDomainValidatePayload; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomDomains. */ +public final class CustomDomainsClient { + private final ClientLogger logger = new ClientLogger(CustomDomainsClient.class); + + /** The proxy service used to perform REST calls. */ + private final CustomDomainsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of CustomDomainsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public CustomDomainsClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(CustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCustomDomains to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface CustomDomainsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") CustomDomainResourceInner domainResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") CustomDomainResourceInner domainResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") CustomDomainValidatePayload validatePayload, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, domainName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, domainName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner get( + String resourceGroupName, String serviceName, String appName, String domainName) { + return getAsync(resourceGroupName, serviceName, appName, domainName).block(); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner get( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return getAsync(resourceGroupName, serviceName, appName, domainName, context).block(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, properties).block(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, properties, context).block(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, domainName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, domainName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String domainName) { + deleteAsync(resourceGroupName, serviceName, appName, domainName).block(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String domainName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, domainName, context).block(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> patchWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> patchWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service + .patch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono patchAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return patchWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono patchAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return patchWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner patch( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return patchAsync(resourceGroupName, serviceName, appName, domainName, properties).block(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner patch( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return patchAsync(resourceGroupName, serviceName, appName, domainName, properties, context).block(); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, context)); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + CustomDomainValidatePayload validatePayload = new CustomDomainValidatePayload(); + validatePayload.withName(name); + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + validatePayload, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + CustomDomainValidatePayload validatePayload = new CustomDomainValidatePayload(); + validatePayload.withName(name); + return service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + validatePayload, + context); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateAsync( + String resourceGroupName, String serviceName, String appName, String name) { + return validateWithResponseAsync(resourceGroupName, serviceName, appName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateAsync( + String resourceGroupName, String serviceName, String appName, String name, Context context) { + return validateWithResponseAsync(resourceGroupName, serviceName, appName, name, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validate( + String resourceGroupName, String serviceName, String appName, String name) { + return validateAsync(resourceGroupName, serviceName, appName, name).block(); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validate( + String resourceGroupName, String serviceName, String appName, String name, Context context) { + return validateAsync(resourceGroupName, serviceName, appName, name, 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 collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java new file mode 100644 index 000000000000..47fed40a9026 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java @@ -0,0 +1,2960 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +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.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.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceProperties; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Deployments. */ +public final class DeploymentsClient { + private final ClientLogger logger = new ClientLogger(DeploymentsClient.class); + + /** The proxy service used to perform REST calls. */ + private final DeploymentsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of DeploymentsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public DeploymentsClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientDeployments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface DeploymentsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DeploymentResourceInner deploymentResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DeploymentResourceInner deploymentResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @QueryParam("version") String version, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterAllDeployments( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("version") String version, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/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("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogFileUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterAllDeploymentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner get( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner get( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, properties); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, properties, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties) + .getSyncPoller(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .getSyncPoller(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties).block(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .block(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String deploymentName) { + deleteAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String deploymentName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, properties); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties).getSyncPoller(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return updateAsync(resourceGroupName, serviceName, appName, deploymentName, properties).block(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context).block(); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, List version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + versionConverted, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + versionConverted, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + final List version = null; + final Context context = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version, context)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + final List version = null; + final Context context = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsSinglePageAsync( + String resourceGroupName, String serviceName, List version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return FluxUtil + .withContext( + context -> + service + .listClusterAllDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + versionConverted, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsSinglePageAsync( + String resourceGroupName, String serviceName, List version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return service + .listClusterAllDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + versionConverted, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listClusterAllDeploymentsAsync( + String resourceGroupName, String serviceName, List version) { + return new PagedFlux<>( + () -> listClusterAllDeploymentsSinglePageAsync(resourceGroupName, serviceName, version), + nextLink -> listClusterAllDeploymentsNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listClusterAllDeploymentsAsync( + String resourceGroupName, String serviceName, List version, Context context) { + return new PagedFlux<>( + () -> listClusterAllDeploymentsSinglePageAsync(resourceGroupName, serviceName, version, context), + nextLink -> listClusterAllDeploymentsNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listClusterAllDeploymentsAsync( + String resourceGroupName, String serviceName) { + final List version = null; + final Context context = null; + return new PagedFlux<>( + () -> listClusterAllDeploymentsSinglePageAsync(resourceGroupName, serviceName, version), + nextLink -> listClusterAllDeploymentsNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listClusterAllDeployments( + String resourceGroupName, String serviceName, List version) { + return new PagedIterable<>(listClusterAllDeploymentsAsync(resourceGroupName, serviceName, version)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listClusterAllDeployments( + String resourceGroupName, String serviceName, List version, Context context) { + return new PagedIterable<>(listClusterAllDeploymentsAsync(resourceGroupName, serviceName, version, context)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listClusterAllDeployments( + String resourceGroupName, String serviceName) { + final List version = null; + final Context context = null; + return new PagedIterable<>(listClusterAllDeploymentsAsync(resourceGroupName, serviceName, version)); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String deploymentName) { + startAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String deploymentName, Context context) { + startAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> stopWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> stopWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String deploymentName) { + stopAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String appName, String deploymentName, Context context) { + stopAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + restartAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + restartAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogFileUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .getLogFileUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogFileUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .getLogFileUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLogFileUrlAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLogFileUrlAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getLogFileUrlWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogFileUrlResponseInner getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogFileUrlResponseInner getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getLogFileUrlAsync(resourceGroupName, serviceName, appName, deploymentName, 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 object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, 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 object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listClusterAllDeploymentsNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listClusterAllDeploymentsNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java new file mode 100644 index 000000000000..3b81c594d1df --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +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.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.AvailableOperationsInner; +import com.azure.resourcemanager.appplatform.fluent.inner.OperationDetailInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Operations. */ +public final class OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClient.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of OperationsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public OperationsClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface OperationsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("/providers/Microsoft.AppPlatform/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java new file mode 100644 index 000000000000..9f9648f56e3f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java @@ -0,0 +1,2432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +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.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.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceListInner; +import com.azure.resourcemanager.appplatform.models.NameAvailabilityParameters; +import com.azure.resourcemanager.appplatform.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.models.TestKeyType; +import com.azure.resourcemanager.appplatform.models.TestKeys; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +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 Services. */ +public final class ServicesClient + implements InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete { + private final ClientLogger logger = new ClientLogger(ServicesClient.class); + + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of ServicesClient. + * + * @param client the instance of the service client containing this operation class. + */ + public ServicesClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface ServicesService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @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("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @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("serviceName") String serviceName, + @BodyParam("application/json") ServiceResourceInner resource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @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("serviceName") String serviceName, + @BodyParam("application/json") ServiceResourceInner resource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/listTestKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTestKeys( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/regenerateTestKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateTestKey( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/disableTestEndpoint") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disableTestEndpoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/enableTestEndpoint") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enableTestEndpoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") NameAvailabilityParameters availabilityParameters, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String serviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String serviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName) { + return getByResourceGroupAsync(resourceGroupName, serviceName).block(); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName, Context context) { + return getByResourceGroupAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, resource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, resource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource).getSyncPoller(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource, context).getSyncPoller(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, serviceName, resource).block(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, resource, context).block(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName) { + deleteAsync(resourceGroupName, serviceName).block(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, Context context) { + deleteAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, serviceName, resource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, resource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateAsync(resourceGroupName, serviceName, resource).getSyncPoller(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, resource, context).getSyncPoller(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateAsync(resourceGroupName, serviceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner update(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return updateAsync(resourceGroupName, serviceName, resource).block(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner update( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return updateAsync(resourceGroupName, serviceName, resource, context).block(); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestKeysWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .listTestKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestKeysWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .listTestKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listTestKeysAsync(String resourceGroupName, String serviceName) { + return listTestKeysWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listTestKeysAsync(String resourceGroupName, String serviceName, Context context) { + return listTestKeysWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys listTestKeys(String resourceGroupName, String serviceName) { + return listTestKeysAsync(resourceGroupName, serviceName).block(); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys listTestKeys(String resourceGroupName, String serviceName, Context context) { + return listTestKeysAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> regenerateTestKeyWithResponseAsync( + String resourceGroupName, String serviceName, TestKeyType keyType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (keyType == null) { + return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); + } + RegenerateTestKeyRequestPayload regenerateTestKeyRequest = new RegenerateTestKeyRequestPayload(); + regenerateTestKeyRequest.withKeyType(keyType); + return FluxUtil + .withContext( + context -> + service + .regenerateTestKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + regenerateTestKeyRequest, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> regenerateTestKeyWithResponseAsync( + String resourceGroupName, String serviceName, TestKeyType keyType, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (keyType == null) { + return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); + } + RegenerateTestKeyRequestPayload regenerateTestKeyRequest = new RegenerateTestKeyRequestPayload(); + regenerateTestKeyRequest.withKeyType(keyType); + return service + .regenerateTestKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + regenerateTestKeyRequest, + context); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono regenerateTestKeyAsync(String resourceGroupName, String serviceName, TestKeyType keyType) { + return regenerateTestKeyWithResponseAsync(resourceGroupName, serviceName, keyType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono regenerateTestKeyAsync( + String resourceGroupName, String serviceName, TestKeyType keyType, Context context) { + return regenerateTestKeyWithResponseAsync(resourceGroupName, serviceName, keyType, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys regenerateTestKey(String resourceGroupName, String serviceName, TestKeyType keyType) { + return regenerateTestKeyAsync(resourceGroupName, serviceName, keyType).block(); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys regenerateTestKey( + String resourceGroupName, String serviceName, TestKeyType keyType, Context context) { + return regenerateTestKeyAsync(resourceGroupName, serviceName, keyType, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> disableTestEndpointWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .disableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> disableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .disableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableTestEndpointAsync(String resourceGroupName, String serviceName) { + return disableTestEndpointWithResponseAsync(resourceGroupName, serviceName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableTestEndpointAsync(String resourceGroupName, String serviceName, Context context) { + return disableTestEndpointWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableTestEndpoint(String resourceGroupName, String serviceName) { + disableTestEndpointAsync(resourceGroupName, serviceName).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableTestEndpoint(String resourceGroupName, String serviceName, Context context) { + disableTestEndpointAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enableTestEndpointWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .enableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .enableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableTestEndpointAsync(String resourceGroupName, String serviceName) { + return enableTestEndpointWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableTestEndpointAsync(String resourceGroupName, String serviceName, Context context) { + return enableTestEndpointWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys enableTestEndpoint(String resourceGroupName, String serviceName) { + return enableTestEndpointAsync(resourceGroupName, serviceName).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys enableTestEndpoint(String resourceGroupName, String serviceName, Context context) { + return enableTestEndpointAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters availabilityParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and 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.")); + } + if (availabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null.")); + } else { + availabilityParameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + availabilityParameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters availabilityParameters, 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.")); + } + if (availabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null.")); + } else { + availabilityParameters.validate(); + } + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + availabilityParameters, + context); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityWithResponseAsync(location, availabilityParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, availabilityParameters, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability( + String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityAsync(location, availabilityParameters).block(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + return checkNameAvailabilityAsync(location, availabilityParameters, context).block(); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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.")); + } + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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.")); + } + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listBySubscriptionNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listBySubscriptionNext(nextLink, 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java new file mode 100644 index 000000000000..30ebdec908c9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +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.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.ResourceSkuCollectionInner; +import com.azure.resourcemanager.appplatform.models.ResourceSku; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Skus. */ +public final class SkusClient { + private final ClientLogger logger = new ClientLogger(SkusClient.class); + + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of SkusClient. + * + * @param client the instance of the service client containing this operation class. + */ + public SkusClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface SkusService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java new file mode 100644 index 000000000000..2f109d497941 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The AppResourceCollection model. */ +@Fluent +public final class AppResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceCollectionInner.class); + + /* + * Collection of App resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of App resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of App resources. + * + * @param value the value value to set. + * @return the AppResourceCollectionInner object itself. + */ + public AppResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AppResourceCollectionInner object itself. + */ + public AppResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java new file mode 100644 index 000000000000..f58db5c69ff1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.models.ManagedIdentityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AppResource model. */ +@Fluent +public final class AppResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceInner.class); + + /* + * Properties of the App resource + */ + @JsonProperty(value = "properties") + private AppResourceProperties properties; + + /* + * The Managed Identity type of the app resource + */ + @JsonProperty(value = "identity") + private ManagedIdentityProperties identity; + + /* + * The GEO location of the application, always the same with its parent + * resource + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the properties property: Properties of the App resource. + * + * @return the properties value. + */ + public AppResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the App resource. + * + * @param properties the properties value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withProperties(AppResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The Managed Identity type of the app resource. + * + * @return the identity value. + */ + public ManagedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed Identity type of the app resource. + * + * @param identity the identity value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withIdentity(ManagedIdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The GEO location of the application, always the same with its parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The GEO location of the application, always the same with its parent resource. + * + * @param location the location value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java new file mode 100644 index 000000000000..67d4a6bb318a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The AvailableOperations model. */ +@Fluent +public final class AvailableOperationsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperationsInner.class); + + /* + * Collection of available operation details + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of available operation details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of available operation details. + * + * @param value the value value to set. + * @return the AvailableOperationsInner object itself. + */ + public AvailableOperationsInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AvailableOperationsInner object itself. + */ + public AvailableOperationsInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java new file mode 100644 index 000000000000..0df492b8aec3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The BindingResourceCollection model. */ +@Fluent +public final class BindingResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceCollectionInner.class); + + /* + * Collection of Binding resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Binding resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Binding resources. + * + * @param value the value value to set. + * @return the BindingResourceCollectionInner object itself. + */ + public BindingResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BindingResourceCollectionInner object itself. + */ + public BindingResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java new file mode 100644 index 000000000000..8cb4e051a6ad --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.BindingResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BindingResource model. */ +@Fluent +public final class BindingResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceInner.class); + + /* + * Properties of the Binding resource + */ + @JsonProperty(value = "properties") + private BindingResourceProperties properties; + + /** + * Get the properties property: Properties of the Binding resource. + * + * @return the properties value. + */ + public BindingResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Binding resource. + * + * @param properties the properties value to set. + * @return the BindingResourceInner object itself. + */ + public BindingResourceInner withProperties(BindingResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java new file mode 100644 index 000000000000..364e824fb2a9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The CertificateResourceCollection model. */ +@Fluent +public final class CertificateResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateResourceCollectionInner.class); + + /* + * The certificate resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of certificate list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The certificate resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The certificate resources list. + * + * @param value the value value to set. + * @return the CertificateResourceCollectionInner object itself. + */ + public CertificateResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of certificate list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of certificate list. + * + * @param nextLink the nextLink value to set. + * @return the CertificateResourceCollectionInner object itself. + */ + public CertificateResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java new file mode 100644 index 000000000000..d07a5ba613bf --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CertificateResource model. */ +@Fluent +public final class CertificateResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateResourceInner.class); + + /* + * Properties of the certificate resource payload. + */ + @JsonProperty(value = "properties") + private CertificateProperties properties; + + /** + * Get the properties property: Properties of the certificate resource payload. + * + * @return the properties value. + */ + public CertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the certificate resource payload. + * + * @param properties the properties value to set. + * @return the CertificateResourceInner object itself. + */ + public CertificateResourceInner withProperties(CertificateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java new file mode 100644 index 000000000000..82118f638cec --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The CustomDomainResourceCollection model. */ +@Fluent +public final class CustomDomainResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainResourceCollectionInner.class); + + /* + * The custom domain resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of custom domain list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The custom domain resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The custom domain resources list. + * + * @param value the value value to set. + * @return the CustomDomainResourceCollectionInner object itself. + */ + public CustomDomainResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of custom domain list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of custom domain list. + * + * @param nextLink the nextLink value to set. + * @return the CustomDomainResourceCollectionInner object itself. + */ + public CustomDomainResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java new file mode 100644 index 000000000000..8e8ccf3aeabe --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.CustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomDomainResource model. */ +@Fluent +public final class CustomDomainResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainResourceInner.class); + + /* + * Properties of the custom domain resource. + */ + @JsonProperty(value = "properties") + private CustomDomainProperties properties; + + /** + * Get the properties property: Properties of the custom domain resource. + * + * @return the properties value. + */ + public CustomDomainProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the custom domain resource. + * + * @param properties the properties value to set. + * @return the CustomDomainResourceInner object itself. + */ + public CustomDomainResourceInner withProperties(CustomDomainProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java new file mode 100644 index 000000000000..321c7b235452 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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 CustomDomainValidateResult model. */ +@Fluent +public final class CustomDomainValidateResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainValidateResultInner.class); + + /* + * Indicates if domain name is valid. + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * Message of why domain name is invalid. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the isValid property: Indicates if domain name is valid. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set the isValid property: Indicates if domain name is valid. + * + * @param isValid the isValid value to set. + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the message property: Message of why domain name is invalid. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message of why domain name is invalid. + * + * @param message the message value to set. + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java new file mode 100644 index 000000000000..93b4a772bbcb --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The DeploymentResourceCollection model. */ +@Fluent +public final class DeploymentResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceCollectionInner.class); + + /* + * Collection of Deployment resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Deployment resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Deployment resources. + * + * @param value the value value to set. + * @return the DeploymentResourceCollectionInner object itself. + */ + public DeploymentResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the DeploymentResourceCollectionInner object itself. + */ + public DeploymentResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java new file mode 100644 index 000000000000..8efd733bbbe2 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DeploymentResource model. */ +@Fluent +public final class DeploymentResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceInner.class); + + /* + * Properties of the Deployment resource + */ + @JsonProperty(value = "properties") + private DeploymentResourceProperties properties; + + /** + * Get the properties property: Properties of the Deployment resource. + * + * @return the properties value. + */ + public DeploymentResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Deployment resource. + * + * @param properties the properties value to set. + * @return the DeploymentResourceInner object itself. + */ + public DeploymentResourceInner withProperties(DeploymentResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java new file mode 100644 index 000000000000..f23bf3682238 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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 LogFileUrlResponse model. */ +@Fluent +public final class LogFileUrlResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogFileUrlResponseInner.class); + + /* + * URL of the log file + */ + @JsonProperty(value = "url", required = true) + private String url; + + /** + * Get the url property: URL of the log file. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: URL of the log file. + * + * @param url the url value to set. + * @return the LogFileUrlResponseInner object itself. + */ + public LogFileUrlResponseInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (url() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model LogFileUrlResponseInner")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java new file mode 100644 index 000000000000..72d4dd61764f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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 NameAvailability model. */ +@Fluent +public final class NameAvailabilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class); + + /* + * Indicates whether the name is available + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * Reason why the name is not available + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Message why the name is not available + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: Reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Reason why the name is not available. + * + * @param reason the reason value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Message why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message why the name is not available. + * + * @param message the message value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java new file mode 100644 index 000000000000..24de8b15d88b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.OperationDisplay; +import com.azure.resourcemanager.appplatform.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationDetail model. */ +@Fluent +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); + + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java new file mode 100644 index 000000000000..8cb0c08e98ab --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.ResourceSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuCollection model. */ +@Fluent +public final class ResourceSkuCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCollectionInner.class); + + /* + * Collection of resource SKU + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of resource SKU. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resource SKU. + * + * @param value the value value to set. + * @return the ResourceSkuCollectionInner object itself. + */ + public ResourceSkuCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ResourceSkuCollectionInner object itself. + */ + public ResourceSkuCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java new file mode 100644 index 000000000000..180198979b3d --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServiceResource model. */ +@Fluent +public final class ServiceResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceInner.class); + + /* + * Properties of the Service resource + */ + @JsonProperty(value = "properties") + private ClusterResourceProperties properties; + + /* + * Sku of the Service resource + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the properties property: Properties of the Service resource. + * + * @return the properties value. + */ + public ClusterResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Service resource. + * + * @param properties the properties value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withProperties(ClusterResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the Service resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the Service resource. + * + * @param sku the sku value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java new file mode 100644 index 000000000000..6019ea83a38c --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +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; + +/** The ServiceResourceList model. */ +@Fluent +public final class ServiceResourceListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceListInner.class); + + /* + * Collection of Service resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Service resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Service resources. + * + * @param value the value value to set. + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java new file mode 100644 index 000000000000..24d311207401 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner classes for AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform.fluent.inner; diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java new file mode 100644 index 000000000000..919204581a25 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the client classes for AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform.fluent; diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java new file mode 100644 index 000000000000..d985f51f1d5c --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.models.DeploymentInstance; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceStatus; +import com.azure.resourcemanager.appplatform.models.DeploymentSettings; +import com.azure.resourcemanager.appplatform.models.ResourceUploadDefinition; +import com.azure.resourcemanager.appplatform.models.RuntimeVersion; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.UserSourceInfo; +import com.azure.resourcemanager.appplatform.models.UserSourceType; +import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; +import com.azure.resourcemanager.resources.fluentcore.model.Indexable; +import com.azure.storage.file.share.ShareFileAsyncClient; +import com.azure.storage.file.share.ShareFileClientBuilder; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; +import org.apache.commons.compress.utils.IOUtils; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; +import java.util.zip.GZIPOutputStream; + +public class SpringAppDeploymentImpl + extends ExternalChildResourceImpl + implements SpringAppDeployment, SpringAppDeployment.Definition, SpringAppDeployment.Update { + private static final int BLOCK_SIZE = 4 * 1024 * 1024; // 4MB + private final SpringAppDeploymentsImpl client; + private DeploymentSettings originalDeploymentSettings; + + SpringAppDeploymentImpl(String name, SpringAppImpl parent, + DeploymentResourceInner innerObject, SpringAppDeploymentsImpl client) { + super(name, parent, innerObject); + this.client = client; + } + + @Override + public String appName() { + if (inner().properties() == null) { + return null; + } + return inner().properties().appName(); + } + + @Override + public DeploymentSettings settings() { + if (inner().properties() == null) { + return null; + } + return inner().properties().deploymentSettings(); + } + + @Override + public DeploymentResourceStatus status() { + if (inner().properties() == null) { + return null; + } + return inner().properties().status(); + } + + @Override + public boolean isActive() { + if (inner().properties() == null) { + return false; + } + return inner().properties().active(); + } + + @Override + public OffsetDateTime createdTime() { + if (inner().properties() == null) { + return null; + } + return inner().properties().createdTime(); + } + + @Override + public List instances() { + if (inner().properties() == null) { + return null; + } + return inner().properties().instances(); + } + + @Override + public String getLogFileUrl() { + return getLogFileUrlAsync().block(); + } + + @Override + public Mono getLogFileUrlAsync() { + return manager().inner().getDeployments().getLogFileUrlAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name() + ) + .map(LogFileUrlResponseInner::url); + } + + private void ensureDeploySettings() { + if (inner().properties() == null) { + inner().withProperties(new DeploymentResourceProperties()); + } + if (inner().properties().deploymentSettings() == null) { + inner().properties().withDeploymentSettings(new DeploymentSettings()); + } + } + + private void ensureSource() { + if (inner().properties() == null) { + inner().withProperties(new DeploymentResourceProperties()); + } + if (inner().properties().source() == null) { + inner().properties().withSource(new UserSourceInfo()); + } + } + + private File compressSource(File sourceFolder) throws IOException { + File compressFile = File.createTempFile("java_package", "tar.gz"); + compressFile.deleteOnExit(); + try (TarArchiveOutputStream tarArchiveOutputStream = new TarArchiveOutputStream( + new GZIPOutputStream(new FileOutputStream(compressFile)))) { + tarArchiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); + + for (Path sourceFile : Files.walk(sourceFolder.toPath()).collect(Collectors.toList())) { + String relativePath = sourceFolder.toPath().relativize(sourceFile).toString(); + TarArchiveEntry entry = new TarArchiveEntry(sourceFile.toFile(), relativePath); + if (sourceFile.toFile().isFile()) { + try (InputStream inputStream = new FileInputStream(sourceFile.toFile())) { + tarArchiveOutputStream.putArchiveEntry(entry); + IOUtils.copy(inputStream, tarArchiveOutputStream); + tarArchiveOutputStream.closeArchiveEntry(); + } + } else { + tarArchiveOutputStream.putArchiveEntry(entry); + tarArchiveOutputStream.closeArchiveEntry(); + } + } + } + return compressFile; + } + + private ShareFileAsyncClient createShareFileAsyncClient(ResourceUploadDefinition option) { + return new ShareFileClientBuilder() + .endpoint(option.uploadUrl()) + .httpClient(manager().httpPipeline().getHttpClient()) + .buildFileAsyncClient(); + } + + private Mono uploadToStorage(File source, ResourceUploadDefinition option) { + inner().properties().source().withRelativePath(option.relativePath()); + try { + ShareFileAsyncClient shareFileAsyncClient = createShareFileAsyncClient(option); + return shareFileAsyncClient.create(source.length()) + .flatMap(fileInfo -> shareFileAsyncClient.uploadFromFile(source.getAbsolutePath())) + .then(Mono.empty()); + } catch (Exception e) { + return Mono.error(e); + } + } + + @Override + public SpringAppDeploymentImpl withJarFile(File jar) { + ensureSource(); + inner().properties().source().withType(UserSourceType.JAR); + this.addDependency( + context -> parent().getResourceUploadUrlAsync() + .flatMap(option -> uploadToStorage(jar, option) + .then(context.voidMono())) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withSourceCodeFolder(File sourceCodeFolder) { + ensureSource(); + inner().properties().source().withType(UserSourceType.SOURCE); + this.addDependency( + context -> parent().getResourceUploadUrlAsync() + .flatMap(option -> { + try { + return uploadToStorage(compressSource(sourceCodeFolder), option); + } catch (Exception e) { + return Mono.error(e); + } + }) + .then(context.voidMono()) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withExistingSource(UserSourceType type, String relativePath) { + ensureSource(); + inner().properties().source().withType(type); + inner().properties().source().withRelativePath(relativePath); + return this; + } + + @Override + public SpringAppDeploymentImpl withSourceCodeTarGzFile(File sourceCodeTarGz) { + ensureSource(); + inner().properties().source().withType(UserSourceType.SOURCE); + this.addDependency( + context -> parent().getResourceUploadUrlAsync() + .flatMap(option -> uploadToStorage(sourceCodeTarGz, option) + .then(context.voidMono())) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withTargetModule(String moduleName) { + ensureSource(); + inner().properties().source().withArtifactSelector(moduleName); + return this; + } + + @Override + public SpringAppDeploymentImpl withSingleModule() { + ensureSource(); + inner().properties().source().withArtifactSelector(null); + return this; + } + + @Override + public SpringAppDeploymentImpl withSettingsFromActiveDeployment() { + this.addDependency( + context -> client.getByNameAsync(parent().activeDeployment()) + .map(deployment -> { + originalDeploymentSettings = deployment.settings(); + return (Indexable) deployment; + }) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withSettingsFromDeployment(SpringAppDeployment deployment) { + originalDeploymentSettings = deployment.settings(); + return this; + } + + @Override + public SpringAppDeploymentImpl withSettingsFromDeployment(String deploymentName) { + this.addDependency( + context -> client.getByNameAsync(deploymentName) + .map(deployment -> { + originalDeploymentSettings = deployment.settings(); + return (Indexable) deployment; + }) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withCustomSetting() { + ensureDeploySettings(); + inner().properties().withDeploymentSettings(new DeploymentSettings()); + return this; + } + + @Override + public SpringAppDeploymentImpl withInstance(int count) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withInstanceCount(count); + return this; + } + + @Override + public SpringAppDeploymentImpl withCpu(int cpuCount) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withCpu(cpuCount); + return this; + } + + @Override + public SpringAppDeploymentImpl withMemory(int sizeInGB) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withMemoryInGB(sizeInGB); + return this; + } + + @Override + public SpringAppDeploymentImpl withRuntime(RuntimeVersion version) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withRuntimeVersion(version); + return this; + } + + @Override + public SpringAppDeploymentImpl withJvmOptions(String jvmOptions) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withJvmOptions(jvmOptions); + return this; + } + + private void ensureEnvironments() { + ensureDeploySettings(); + if (inner().properties().deploymentSettings().environmentVariables() == null) { + inner().properties().deploymentSettings().withEnvironmentVariables(new HashMap<>()); + } + } + + @Override + public SpringAppDeploymentImpl withEnvironment(String key, String value) { + ensureEnvironments(); + inner().properties().deploymentSettings().environmentVariables().put(key, value); + return this; + } + + @Override + public SpringAppDeploymentImpl withoutEnvironment(String key) { + ensureEnvironments(); + inner().properties().deploymentSettings().environmentVariables().remove(key); + return this; + } + + @Override + public SpringAppDeploymentImpl withVersionName(String versionName) { + ensureSource(); + inner().properties().source().withVersion(versionName); + return this; + } + + @Override + public SpringAppDeploymentImpl withActivation() { + this.addPostRunDependent( + context -> parent().update().withActiveDeployment(name()).applyAsync() + .map(app -> (Indexable) app) + ); + return this; + } + + @Override + public Mono createResourceAsync() { + if (originalDeploymentSettings != null) { + ensureDeploySettings(); + inner().properties().withDeploymentSettings(originalDeploymentSettings); + } + return manager().inner().getDeployments().createOrUpdateAsync( + parent().parent().resourceGroupName(), parent().parent().name(), + parent().name(), name(), inner().properties() + ) + .map(inner -> { + originalDeploymentSettings = null; + setInner(inner); + return this; + }); + } + + @Override + public Mono updateResourceAsync() { + if (originalDeploymentSettings != null) { + ensureDeploySettings(); + inner().properties().withDeploymentSettings(originalDeploymentSettings); + } + return manager().inner().getDeployments().updateAsync( + parent().parent().resourceGroupName(), parent().parent().name(), + parent().name(), name(), inner().properties() + ) + .map(inner -> { + originalDeploymentSettings = null; + setInner(inner); + return this; + }); + } + + @Override + public Mono deleteResourceAsync() { + return manager().inner().getDeployments().deleteAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name() + ); + } + + @Override + protected Mono getInnerAsync() { + return manager().inner().getDeployments().getAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name() + ); + } + + @Override + public String id() { + return inner().id(); + } + + @Override + public SpringAppDeploymentImpl update() { + prepareUpdate(); + return this; + } + + private AppPlatformManager manager() { + return parent().manager(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java new file mode 100644 index 000000000000..e1cc32e5e3c1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployments; +import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesNonCachedImpl; +import reactor.core.publisher.Mono; + +public class SpringAppDeploymentsImpl + extends ExternalChildResourcesNonCachedImpl< + SpringAppDeploymentImpl, SpringAppDeployment, DeploymentResourceInner, SpringAppImpl, SpringApp> + implements SpringAppDeployments { + + SpringAppDeploymentsImpl(SpringAppImpl parent) { + super(parent, parent.taskGroup(), "SpringAppDeployment"); + } + + @Override + public SpringAppDeployment getById(String id) { + return getByIdAsync(id).block(); + } + + @Override + public Mono getByIdAsync(String id) { + return getByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public SpringAppDeployment getByName(String name) { + return getByNameAsync(name).block(); + } + + @Override + public Mono getByNameAsync(String name) { + return inner().getAsync(parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name) + .map(this::wrapModel); + } + + @Override + public AppPlatformManager manager() { + return parent().parent().manager(); + } + + @Override + public SpringAppImpl parent() { + return super.getParent(); + } + + @Override + public SpringAppDeploymentImpl define(String name) { + return super.prepareIndependentDefine(wrapModel(name)); + } + + @Override + public void deleteById(String id) { + deleteByIdAsync(id).block(); + } + + @Override + public Mono deleteByIdAsync(String id) { + return deleteByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public void deleteByName(String name) { + deleteByNameAsync(name).block(); + } + + @Override + public Mono deleteByNameAsync(String name) { + return inner().deleteAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name); + } + + @Override + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + @Override + public PagedFlux listAsync() { + return inner().listAsync(parent().parent().resourceGroupName(), parent().parent().name(), parent().name()) + .mapPage(this::wrapModel); + } + + private SpringAppDeploymentImpl wrapModel(String name) { + return new SpringAppDeploymentImpl(name, parent(), new DeploymentResourceInner(), this); + } + + private SpringAppDeploymentImpl wrapModel(DeploymentResourceInner inner) { + return inner == null ? null : new SpringAppDeploymentImpl(inner.name(), parent(), inner, this); + } + + @Override + public DeploymentsClient inner() { + return manager().inner().getDeployments(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java new file mode 100644 index 000000000000..6d811a0eb8d4 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.appplatform.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.models.PersistentDisk; +import com.azure.resourcemanager.appplatform.models.ResourceUploadDefinition; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployments; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.appplatform.models.TemporaryDisk; +import com.azure.resourcemanager.appplatform.models.UserSourceType; +import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.time.OffsetDateTime; + +public class SpringAppImpl + extends ExternalChildResourceImpl + implements SpringApp, SpringApp.Definition, SpringApp.Update { + private Creatable springAppDeploymentToCreate = null; + + SpringAppImpl(String name, SpringServiceImpl parent, AppResourceInner innerObject) { + super(name, parent, innerObject); + } + + @Override + public boolean isPublic() { + if (inner().properties() == null) { + return false; + } + return inner().properties().publicProperty(); + } + + @Override + public boolean isHttpsOnly() { + if (inner().properties() == null) { + return false; + } + return inner().properties().httpsOnly(); + } + + @Override + public String url() { + if (inner().properties() == null) { + return null; + } + return inner().properties().url(); + } + + @Override + public TemporaryDisk temporaryDisk() { + if (inner().properties() == null) { + return null; + } + return inner().properties().temporaryDisk(); + } + + @Override + public PersistentDisk persistentDisk() { + if (inner().properties() == null) { + return null; + } + return inner().properties().persistentDisk(); + } + + @Override + public ManagedIdentityProperties identity() { + return inner().identity(); + } + + @Override + public OffsetDateTime createdTime() { + if (inner().properties() == null) { + return null; + } + return inner().properties().createdTime(); + } + + @Override + public String activeDeployment() { + if (inner().properties() == null) { + return null; + } + return inner().properties().activeDeploymentName(); + } + + @Override + public SpringAppDeployments deployments() { + return new SpringAppDeploymentsImpl(this); + } + + @Override + public Mono getResourceUploadUrlAsync() { + return manager().inner().getApps().getResourceUploadUrlAsync( + parent().resourceGroupName(), parent().name(), name()); + } + + @Override + public ResourceUploadDefinition getResourceUploadUrl() { + return getResourceUploadUrlAsync().block(); + } + + private void ensureProperty() { + if (inner().properties() == null) { + inner().withProperties(new AppResourceProperties()); + } + } + + @Override + public SpringAppImpl withPublicEndpoint() { + ensureProperty(); + inner().properties().withPublicProperty(true); + return this; + } + + @Override + public SpringAppImpl withoutPublicEndpoint() { + ensureProperty(); + inner().properties().withPublicProperty(false); + return this; + } + + @Override + public SpringAppImpl withCustomDomain(String domain) { + ensureProperty(); + inner().properties().withFqdn(domain); + return this; + } + + @Override + public SpringAppImpl withoutCustomDomain() { + ensureProperty(); + inner().properties().withFqdn(null); + return this; + } + + @Override + public SpringAppImpl withHttpsOnly() { + ensureProperty(); + inner().properties().withHttpsOnly(true); + return this; + } + + @Override + public SpringAppImpl withoutHttpsOnly() { + ensureProperty(); + inner().properties().withHttpsOnly(false); + return this; + } + + @Override + public SpringAppImpl withTemporaryDisk(int sizeInGB, String mountPath) { + ensureProperty(); + inner().properties().withTemporaryDisk(new TemporaryDisk().withSizeInGB(sizeInGB).withMountPath(mountPath)); + return this; + } + + @Override + public SpringAppImpl withoutTemporaryDisk() { + ensureProperty(); + inner().properties().withTemporaryDisk(null); + return this; + } + + @Override + public SpringAppImpl withPersistentDisk(int sizeInGB, String mountPath) { + ensureProperty(); + inner().properties().withPersistentDisk(new PersistentDisk().withSizeInGB(sizeInGB).withMountPath(mountPath)); + return this; + } + + @Override + public SpringAppImpl withoutPersistentDisk() { + ensureProperty(); + inner().properties().withPersistentDisk(null); + return this; + } + + @Override + public SpringAppImpl withActiveDeployment(String name) { + ensureProperty(); + inner().properties().withActiveDeploymentName(name); + return this; + } + + @Override + public SpringAppImpl withoutDeployment(String name) { + this.addPostRunDependent( + context -> deployments().deleteByNameAsync(name) + .then(context.voidMono()) + ); + return this; + } + + @Override + public SpringAppImpl deployJar(String name, File jarFile) { + ensureProperty(); + inner().properties().withActiveDeploymentName(name); + springAppDeploymentToCreate = deployments().define(name) + .withJarFile(jarFile) + .withCustomSetting(); + return this; + } + + @Override + public SpringAppImpl deploySource(String name, File sourceCodeFolder, String targetModule) { + ensureProperty(); + inner().properties().withActiveDeploymentName(name); + springAppDeploymentToCreate = deployments().define(name) + .withSourceCodeFolder(sourceCodeFolder) + .withTargetModule(targetModule) + .withCustomSetting(); + return this; + } + + @Override + public Mono createResourceAsync() { + if (springAppDeploymentToCreate == null) { + String defaultDeploymentName = "default"; + withActiveDeployment(defaultDeploymentName); + springAppDeploymentToCreate = deployments().define(defaultDeploymentName) + .withExistingSource(UserSourceType.JAR, String.format("<%s>", defaultDeploymentName)) + .withCustomSetting(); + } + return manager().inner().getApps().createOrUpdateAsync( + parent().resourceGroupName(), parent().name(), name(), new AppResourceInner()) + .flatMap(inner -> updateResourceAsync()); + } + + @Override + public Mono updateResourceAsync() { + Mono createDeployment; + if (springAppDeploymentToCreate != null) { + createDeployment = springAppDeploymentToCreate.createAsync().last(); + } else { + createDeployment = Mono.empty(); + } + return createDeployment + .then( + manager().inner().getApps().updateAsync( + parent().resourceGroupName(), parent().name(), name(), inner() + ) + .map(inner -> { + setInner(inner); + springAppDeploymentToCreate = null; + return this; + })); + } + + @Override + public Mono deleteResourceAsync() { + return manager().inner().getApps().deleteAsync(parent().resourceGroupName(), parent().name(), name()); + } + + @Override + protected Mono getInnerAsync() { + return manager().inner().getApps().getAsync(parent().resourceGroupName(), parent().name(), name()); + } + + @Override + public String id() { + return inner().id(); + } + + @Override + public SpringAppImpl update() { + prepareUpdate(); + return this; + } + + public AppPlatformManager manager() { + return parent().manager(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java new file mode 100644 index 000000000000..3bf35e72e449 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringApps; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesNonCachedImpl; +import reactor.core.publisher.Mono; + +public class SpringAppsImpl + extends ExternalChildResourcesNonCachedImpl< + SpringAppImpl, SpringApp, AppResourceInner, SpringServiceImpl, SpringService> + implements SpringApps { + + SpringAppsImpl(SpringServiceImpl parent) { + super(parent, parent.taskGroup(), "SpringApp"); + } + + @Override + public SpringApp getById(String id) { + return getByIdAsync(id).block(); + } + + @Override + public Mono getByIdAsync(String id) { + return getByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public SpringApp getByName(String name) { + return getByNameAsync(name).block(); + } + + @Override + public Mono getByNameAsync(String name) { + return inner().getAsync(parent().resourceGroupName(), parent().name(), name) + .map(this::wrapModel); + } + + @Override + public AppPlatformManager manager() { + return parent().manager(); + } + + @Override + public SpringServiceImpl parent() { + return super.getParent(); + } + + @Override + public SpringAppImpl define(String name) { + return super.prepareIndependentDefine(wrapModel(name)); + } + + @Override + public void deleteById(String id) { + deleteByIdAsync(id).block(); + } + + @Override + public Mono deleteByIdAsync(String id) { + return deleteByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public void deleteByName(String name) { + deleteByNameAsync(name).block(); + } + + @Override + public Mono deleteByNameAsync(String name) { + return inner().deleteAsync(parent().resourceGroupName(), parent().name(), name); + } + + @Override + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + @Override + public PagedFlux listAsync() { + return inner().listAsync(parent().resourceGroupName(), parent().name()) + .mapPage(this::wrapModel); + } + + private SpringAppImpl wrapModel(AppResourceInner inner) { + return inner == null ? null : new SpringAppImpl(inner.name(), parent(), inner); + } + + private SpringAppImpl wrapModel(String name) { + return new SpringAppImpl(name, parent(), new AppResourceInner()); + } + + @Override + public AppsClient inner() { + return manager().inner().getApps(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java new file mode 100644 index 000000000000..5ac8e890fab1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.models.ConfigServerSettings; +import com.azure.resourcemanager.appplatform.models.Sku; +import com.azure.resourcemanager.appplatform.models.SpringApps; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.appplatform.models.TestKeyType; +import com.azure.resourcemanager.appplatform.models.TestKeys; +import com.azure.resourcemanager.appplatform.models.TraceProperties; +import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import reactor.core.publisher.Mono; + +public class SpringServiceImpl + extends GroupableResourceImpl + implements SpringService, SpringService.Definition, SpringService.Update { + + SpringServiceImpl(String name, ServiceResourceInner innerObject, AppPlatformManager manager) { + super(name, innerObject, manager); + } + @Override + public Sku sku() { + return inner().sku(); + } + + @Override + public TraceProperties traceProperties() { + return inner().properties().trace(); + } + + @Override + public ConfigServerProperties serverProperties() { + return inner().properties().configServerProperties(); + } + + @Override + public SpringApps apps() { + return new SpringAppsImpl(this); + } + + @Override + public TestKeys listTestKeys() { + return listTestKeysAsync().block(); + } + + @Override + public Mono listTestKeysAsync() { + return manager().inner().getServices().listTestKeysAsync(resourceGroupName(), name()); + } + + @Override + public TestKeys regenerateTestKeys(TestKeyType keyType) { + return regenerateTestKeysAsync(keyType).block(); + } + + @Override + public Mono regenerateTestKeysAsync(TestKeyType keyType) { + return manager().inner().getServices().regenerateTestKeyAsync(resourceGroupName(), name(), keyType); + } + + @Override + public void disableTestEndpoint() { + disableTestEndpointAsync().block(); + } + + @Override + public Mono disableTestEndpointAsync() { + return manager().inner().getServices().disableTestEndpointAsync(resourceGroupName(), name()); + } + + @Override + public TestKeys enableTestEndpoint() { + return enableTestEndpointAsync().block(); + } + + @Override + public Mono enableTestEndpointAsync() { + return manager().inner().getServices().enableTestEndpointAsync(resourceGroupName(), name()); + } + + @Override + public SpringServiceImpl withSku(String skuName) { + return withSku(new Sku().withName(skuName)); + } + + @Override + public SpringServiceImpl withSku(String skuName, int capacity) { + return withSku(new Sku().withName(skuName).withCapacity(capacity)); + } + + @Override + public SpringServiceImpl withSku(Sku sku) { + inner().withSku(sku); + return this; + } + + @Override + public SpringServiceImpl withTracing(String appInsightInstrumentationKey) { + if (inner().properties() == null) { + inner().withProperties(new ClusterResourceProperties()); + } + inner().properties().withTrace( + new TraceProperties().withAppInsightInstrumentationKey(appInsightInstrumentationKey).withEnabled(true)); + return this; + } + + @Override + public SpringServiceImpl withoutTracing() { + if (inner().properties() == null) { + inner().withProperties(new ClusterResourceProperties()); + } + inner().properties().withTrace(new TraceProperties().withEnabled(false)); + return this; + } + + private void ensureGitConfig() { + if (inner().properties() == null) { + inner().withProperties(new ClusterResourceProperties()); + } + if (inner().properties().configServerProperties() == null) { + inner().properties().withConfigServerProperties(new ConfigServerProperties()); + } + if (inner().properties().configServerProperties().configServer() == null) { + inner().properties().configServerProperties().withConfigServer(new ConfigServerSettings()); + } + if (inner().properties().configServerProperties().configServer().gitProperty() == null) { + inner().properties().configServerProperties().configServer().withGitProperty(new ConfigServerGitProperty()); + } + } + + @Override + public SpringServiceImpl withGitUri(String uri) { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().gitProperty().withUri(uri); + return this; + } + + @Override + public SpringServiceImpl withGitUriAndCredential(String uri, String username, String password) { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().gitProperty() + .withUri(uri).withUsername(username).withPassword(password); + return this; + } + + @Override + public SpringServiceImpl withGitConfig(ConfigServerGitProperty gitConfig) { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().withGitProperty(gitConfig); + return this; + } + + @Override + public SpringServiceImpl withoutGitConfig() { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().withGitProperty(null); + return this; + } + + @Override + public Mono createResourceAsync() { + Mono createOrUpdate; + if (isInCreateMode()) { + createOrUpdate = manager().inner().getServices().createOrUpdateAsync(resourceGroupName(), name(), inner()); + } else { + createOrUpdate = manager().inner().getServices().updateAsync(resourceGroupName(), name(), inner()); + } + return createOrUpdate + .map(inner -> { + this.setInner(inner); + return this; + }); + } + + @Override + protected Mono getInnerAsync() { + return manager().inner().getServices().getByResourceGroupAsync(resourceGroupName(), name()); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java new file mode 100644 index 000000000000..d48cd6be55a3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.models.ResourceSku; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.appplatform.models.SpringServices; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import reactor.core.publisher.Mono; + +public class SpringServicesImpl + extends GroupableResourcesImpl< + SpringService, SpringServiceImpl, ServiceResourceInner, ServicesClient, AppPlatformManager> + implements SpringServices { + public SpringServicesImpl(AppPlatformManager manager) { + super(manager.inner().getServices(), manager); + } + + @Override + protected Mono getInnerAsync(String resourceGroupName, String name) { + return inner().getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Mono deleteInnerAsync(String resourceGroupName, String name) { + return inner().deleteAsync(resourceGroupName, name); + } + + @Override + protected SpringServiceImpl wrapModel(String name) { + return new SpringServiceImpl(name, new ServiceResourceInner(), manager()); + } + + @Override + protected SpringServiceImpl wrapModel(ServiceResourceInner inner) { + return inner == null ? null : new SpringServiceImpl(inner.name(), inner, manager()); + } + + @Override + public PagedIterable listSkus() { + return new PagedIterable<>(listSkusAsync()); + } + + @Override + public PagedFlux listSkusAsync() { + return manager().inner().getSkus().listAsync(); + } + + @Override + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + @Override + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return inner().listByResourceGroupAsync(resourceGroupName).mapPage(this::wrapModel); + } + + @Override + public SpringServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + @Override + public PagedFlux listAsync() { + return inner().listAsync().mapPage(this::wrapModel); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java new file mode 100644 index 000000000000..30ca64791bf8 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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.OffsetDateTime; + +/** The AppResourceProperties model. */ +@Fluent +public final class AppResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceProperties.class); + + /* + * Indicates whether the App exposes public endpoint + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /* + * URL of the App + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Provisioning state of the App + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AppResourceProvisioningState provisioningState; + + /* + * Name of the active deployment of the App + */ + @JsonProperty(value = "activeDeploymentName") + private String activeDeploymentName; + + /* + * Fully qualified dns Name. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * Indicate if only https is allowed. + */ + @JsonProperty(value = "httpsOnly") + private Boolean httpsOnly; + + /* + * Date time when the resource is created + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Temporary disk settings + */ + @JsonProperty(value = "temporaryDisk") + private TemporaryDisk temporaryDisk; + + /* + * Persistent disk settings + */ + @JsonProperty(value = "persistentDisk") + private PersistentDisk persistentDisk; + + /** + * Get the publicProperty property: Indicates whether the App exposes public endpoint. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: Indicates whether the App exposes public endpoint. + * + * @param publicProperty the publicProperty value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the url property: URL of the App. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the provisioningState property: Provisioning state of the App. + * + * @return the provisioningState value. + */ + public AppResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the activeDeploymentName property: Name of the active deployment of the App. + * + * @return the activeDeploymentName value. + */ + public String activeDeploymentName() { + return this.activeDeploymentName; + } + + /** + * Set the activeDeploymentName property: Name of the active deployment of the App. + * + * @param activeDeploymentName the activeDeploymentName value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withActiveDeploymentName(String activeDeploymentName) { + this.activeDeploymentName = activeDeploymentName; + return this; + } + + /** + * Get the fqdn property: Fully qualified dns Name. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fully qualified dns Name. + * + * @param fqdn the fqdn value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the httpsOnly property: Indicate if only https is allowed. + * + * @return the httpsOnly value. + */ + public Boolean httpsOnly() { + return this.httpsOnly; + } + + /** + * Set the httpsOnly property: Indicate if only https is allowed. + * + * @param httpsOnly the httpsOnly value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withHttpsOnly(Boolean httpsOnly) { + this.httpsOnly = httpsOnly; + return this; + } + + /** + * Get the createdTime property: Date time when the resource is created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the temporaryDisk property: Temporary disk settings. + * + * @return the temporaryDisk value. + */ + public TemporaryDisk temporaryDisk() { + return this.temporaryDisk; + } + + /** + * Set the temporaryDisk property: Temporary disk settings. + * + * @param temporaryDisk the temporaryDisk value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withTemporaryDisk(TemporaryDisk temporaryDisk) { + this.temporaryDisk = temporaryDisk; + return this; + } + + /** + * Get the persistentDisk property: Persistent disk settings. + * + * @return the persistentDisk value. + */ + public PersistentDisk persistentDisk() { + return this.persistentDisk; + } + + /** + * Set the persistentDisk property: Persistent disk settings. + * + * @param persistentDisk the persistentDisk value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPersistentDisk(PersistentDisk persistentDisk) { + this.persistentDisk = persistentDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (temporaryDisk() != null) { + temporaryDisk().validate(); + } + if (persistentDisk() != null) { + persistentDisk().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java new file mode 100644 index 000000000000..8c0a7f688cd1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AppResourceProvisioningState. */ +public final class AppResourceProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Creating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a AppResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppResourceProvisioningState. + */ + @JsonCreator + public static AppResourceProvisioningState fromString(String name) { + return fromString(name, AppResourceProvisioningState.class); + } + + /** @return known AppResourceProvisioningState values. */ + public static Collection values() { + return values(AppResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java new file mode 100644 index 000000000000..52deb17dbba9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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.Map; + +/** The BindingResourceProperties model. */ +@Fluent +public final class BindingResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceProperties.class); + + /* + * The name of the bound resource + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * The standard Azure resource type of the bound resource + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The Azure resource id of the bound resource + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The key of the bound resource + */ + @JsonProperty(value = "key") + private String key; + + /* + * Binding parameters of the Binding resource + */ + @JsonProperty(value = "bindingParameters") + private Map bindingParameters; + + /* + * The generated Spring Boot property file for this binding. The secret + * will be deducted. + */ + @JsonProperty(value = "generatedProperties", access = JsonProperty.Access.WRITE_ONLY) + private String generatedProperties; + + /* + * Creation time of the Binding resource + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * Update time of the Binding resource + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private String updatedAt; + + /** + * Get the resourceName property: The name of the bound resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of the bound resource. + * + * @param resourceName the resourceName value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the resourceType property: The standard Azure resource type of the bound resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The standard Azure resource type of the bound resource. + * + * @param resourceType the resourceType value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the resourceId property: The Azure resource id of the bound resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Azure resource id of the bound resource. + * + * @param resourceId the resourceId value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the key property: The key of the bound resource. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key of the bound resource. + * + * @param key the key value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the bindingParameters property: Binding parameters of the Binding resource. + * + * @return the bindingParameters value. + */ + public Map bindingParameters() { + return this.bindingParameters; + } + + /** + * Set the bindingParameters property: Binding parameters of the Binding resource. + * + * @param bindingParameters the bindingParameters value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withBindingParameters(Map bindingParameters) { + this.bindingParameters = bindingParameters; + return this; + } + + /** + * Get the generatedProperties property: The generated Spring Boot property file for this binding. The secret will + * be deducted. + * + * @return the generatedProperties value. + */ + public String generatedProperties() { + return this.generatedProperties; + } + + /** + * Get the createdAt property: Creation time of the Binding resource. + * + * @return the createdAt value. + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Update time of the Binding resource. + * + * @return the updatedAt value. + */ + public String updatedAt() { + return this.updatedAt; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java new file mode 100644 index 000000000000..cbc1c6d505c5 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The CertificateProperties model. */ +@Fluent +public final class CertificateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateProperties.class); + + /* + * The thumbprint of certificate. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /* + * The vault uri of user key vault. + */ + @JsonProperty(value = "vaultUri", required = true) + private String vaultUri; + + /* + * The certificate name of key vault. + */ + @JsonProperty(value = "keyVaultCertName", required = true) + private String keyVaultCertName; + + /* + * The certificate version of key vault. + */ + @JsonProperty(value = "certVersion") + private String certVersion; + + /* + * The issuer of certificate. + */ + @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) + private String issuer; + + /* + * The issue date of certificate. + */ + @JsonProperty(value = "issuedDate", access = JsonProperty.Access.WRITE_ONLY) + private String issuedDate; + + /* + * The expiration date of certificate. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /* + * The activate date of certificate. + */ + @JsonProperty(value = "activateDate", access = JsonProperty.Access.WRITE_ONLY) + private String activateDate; + + /* + * The subject name of certificate. + */ + @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) + private String subjectName; + + /* + * The domain list of certificate. + */ + @JsonProperty(value = "dnsNames", access = JsonProperty.Access.WRITE_ONLY) + private List dnsNames; + + /** + * Get the thumbprint property: The thumbprint of certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get the vaultUri property: The vault uri of user key vault. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: The vault uri of user key vault. + * + * @param vaultUri the vaultUri value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the keyVaultCertName property: The certificate name of key vault. + * + * @return the keyVaultCertName value. + */ + public String keyVaultCertName() { + return this.keyVaultCertName; + } + + /** + * Set the keyVaultCertName property: The certificate name of key vault. + * + * @param keyVaultCertName the keyVaultCertName value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withKeyVaultCertName(String keyVaultCertName) { + this.keyVaultCertName = keyVaultCertName; + return this; + } + + /** + * Get the certVersion property: The certificate version of key vault. + * + * @return the certVersion value. + */ + public String certVersion() { + return this.certVersion; + } + + /** + * Set the certVersion property: The certificate version of key vault. + * + * @param certVersion the certVersion value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withCertVersion(String certVersion) { + this.certVersion = certVersion; + return this; + } + + /** + * Get the issuer property: The issuer of certificate. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Get the issuedDate property: The issue date of certificate. + * + * @return the issuedDate value. + */ + public String issuedDate() { + return this.issuedDate; + } + + /** + * Get the expirationDate property: The expiration date of certificate. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the activateDate property: The activate date of certificate. + * + * @return the activateDate value. + */ + public String activateDate() { + return this.activateDate; + } + + /** + * Get the subjectName property: The subject name of certificate. + * + * @return the subjectName value. + */ + public String subjectName() { + return this.subjectName; + } + + /** + * Get the dnsNames property: The domain list of certificate. + * + * @return the dnsNames value. + */ + public List dnsNames() { + return this.dnsNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property vaultUri in model CertificateProperties")); + } + if (keyVaultCertName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultCertName in model CertificateProperties")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java new file mode 100644 index 000000000000..fde846a738c5 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 ClusterResourceProperties model. */ +@Fluent +public final class ClusterResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterResourceProperties.class); + + /* + * Provisioning state of the Service + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Config server git properties of the Service + */ + @JsonProperty(value = "configServerProperties") + private ConfigServerProperties configServerProperties; + + /* + * Trace properties of the Service + */ + @JsonProperty(value = "trace") + private TraceProperties trace; + + /* + * Version of the Service + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private Integer version; + + /* + * ServiceInstanceEntity GUID which uniquely identifies a created resource + */ + @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceId; + + /** + * Get the provisioningState property: Provisioning state of the Service. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the configServerProperties property: Config server git properties of the Service. + * + * @return the configServerProperties value. + */ + public ConfigServerProperties configServerProperties() { + return this.configServerProperties; + } + + /** + * Set the configServerProperties property: Config server git properties of the Service. + * + * @param configServerProperties the configServerProperties value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withConfigServerProperties(ConfigServerProperties configServerProperties) { + this.configServerProperties = configServerProperties; + return this; + } + + /** + * Get the trace property: Trace properties of the Service. + * + * @return the trace value. + */ + public TraceProperties trace() { + return this.trace; + } + + /** + * Set the trace property: Trace properties of the Service. + * + * @param trace the trace value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withTrace(TraceProperties trace) { + this.trace = trace; + return this; + } + + /** + * Get the version property: Version of the Service. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Get the serviceId property: ServiceInstanceEntity GUID which uniquely identifies a created resource. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configServerProperties() != null) { + configServerProperties().validate(); + } + if (trace() != null) { + trace().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java new file mode 100644 index 000000000000..042d8f5781c5 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ConfigServerGitProperty model. */ +@Fluent +public final class ConfigServerGitProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerGitProperty.class); + + /* + * Repositories of git. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label") + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** + * Get the repositories property: Repositories of git. + * + * @return the repositories value. + */ + public List repositories() { + return this.repositories; + } + + /** + * Set the repositories property: Repositories of git. + * + * @param repositories the repositories value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withRepositories(List repositories) { + this.repositories = repositories; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositories() != null) { + repositories().forEach(e -> e.validate()); + } + if (uri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model ConfigServerGitProperty")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java new file mode 100644 index 000000000000..a44623269ba6 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 ConfigServerProperties model. */ +@Fluent +public final class ConfigServerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerProperties.class); + + /* + * State of the config server. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ConfigServerState state; + + /* + * Error when apply config server settings. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Settings of config server. + */ + @JsonProperty(value = "configServer") + private ConfigServerSettings configServer; + + /** + * Get the state property: State of the config server. + * + * @return the state value. + */ + public ConfigServerState state() { + return this.state; + } + + /** + * Get the error property: Error when apply config server settings. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when apply config server settings. + * + * @param error the error value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the configServer property: Settings of config server. + * + * @return the configServer value. + */ + public ConfigServerSettings configServer() { + return this.configServer; + } + + /** + * Set the configServer property: Settings of config server. + * + * @param configServer the configServer value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withConfigServer(ConfigServerSettings configServer) { + this.configServer = configServer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (configServer() != null) { + configServer().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java new file mode 100644 index 000000000000..f7d62b02b9ff --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 ConfigServerSettings model. */ +@Fluent +public final class ConfigServerSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerSettings.class); + + /* + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigServerGitProperty gitProperty; + + /** + * Get the gitProperty property: Property of git environment. + * + * @return the gitProperty value. + */ + public ConfigServerGitProperty gitProperty() { + return this.gitProperty; + } + + /** + * Set the gitProperty property: Property of git environment. + * + * @param gitProperty the gitProperty value to set. + * @return the ConfigServerSettings object itself. + */ + public ConfigServerSettings withGitProperty(ConfigServerGitProperty gitProperty) { + this.gitProperty = gitProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitProperty() != null) { + gitProperty().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java new file mode 100644 index 000000000000..488afab778be --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfigServerState. */ +public final class ConfigServerState extends ExpandableStringEnum { + /** Static value NotAvailable for ConfigServerState. */ + public static final ConfigServerState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Deleted for ConfigServerState. */ + public static final ConfigServerState DELETED = fromString("Deleted"); + + /** Static value Failed for ConfigServerState. */ + public static final ConfigServerState FAILED = fromString("Failed"); + + /** Static value Succeeded for ConfigServerState. */ + public static final ConfigServerState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ConfigServerState. */ + public static final ConfigServerState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ConfigServerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigServerState. + */ + @JsonCreator + public static ConfigServerState fromString(String name) { + return fromString(name, ConfigServerState.class); + } + + /** @return known ConfigServerState values. */ + public static Collection values() { + return values(ConfigServerState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java new file mode 100644 index 000000000000..d98b35b605bd --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 CustomDomainProperties model. */ +@Fluent +public final class CustomDomainProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainProperties.class); + + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * The app name of domain. + */ + @JsonProperty(value = "appName") + private String appName; + + /* + * The bound certificate name of domain. + */ + @JsonProperty(value = "certName") + private String certName; + + /** + * Get the thumbprint property: The thumbprint of bound certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of bound certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the appName property: The app name of domain. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Set the appName property: The app name of domain. + * + * @param appName the appName value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the certName property: The bound certificate name of domain. + * + * @return the certName value. + */ + public String certName() { + return this.certName; + } + + /** + * Set the certName property: The bound certificate name of domain. + * + * @param certName the certName value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withCertName(String certName) { + this.certName = certName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java new file mode 100644 index 000000000000..cb3af8d3fe01 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 CustomDomainValidatePayload model. */ +@Fluent +public final class CustomDomainValidatePayload { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainValidatePayload.class); + + /* + * Name to be validated + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: Name to be validated. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to be validated. + * + * @param name the name value to set. + * @return the CustomDomainValidatePayload object itself. + */ + public CustomDomainValidatePayload withName(String name) { + this.name = name; + 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 CustomDomainValidatePayload")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java new file mode 100644 index 000000000000..218634d9ad4a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 DeploymentInstance model. */ +@Immutable +public final class DeploymentInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInstance.class); + + /* + * Name of the deployment instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the deployment instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Failed reason of the deployment instance + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * Discovery status of the deployment instance + */ + @JsonProperty(value = "discoveryStatus", access = JsonProperty.Access.WRITE_ONLY) + private String discoveryStatus; + + /** + * Get the name property: Name of the deployment instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the deployment instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the reason property: Failed reason of the deployment instance. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the discoveryStatus property: Discovery status of the deployment instance. + * + * @return the discoveryStatus value. + */ + public String discoveryStatus() { + return this.discoveryStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java new file mode 100644 index 000000000000..35dd214aab00 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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.OffsetDateTime; +import java.util.List; + +/** The DeploymentResourceProperties model. */ +@Fluent +public final class DeploymentResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceProperties.class); + + /* + * Uploaded source information of the deployment. + */ + @JsonProperty(value = "source") + private UserSourceInfo source; + + /* + * App name of the deployment + */ + @JsonProperty(value = "appName", access = JsonProperty.Access.WRITE_ONLY) + private String appName; + + /* + * Deployment settings of the Deployment + */ + @JsonProperty(value = "deploymentSettings") + private DeploymentSettings deploymentSettings; + + /* + * Provisioning state of the Deployment + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceProvisioningState provisioningState; + + /* + * Status of the Deployment + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceStatus status; + + /* + * Indicates whether the Deployment is active + */ + @JsonProperty(value = "active", access = JsonProperty.Access.WRITE_ONLY) + private Boolean active; + + /* + * Date time when the resource is created + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Collection of instances belong to the Deployment + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** + * Get the source property: Uploaded source information of the deployment. + * + * @return the source value. + */ + public UserSourceInfo source() { + return this.source; + } + + /** + * Set the source property: Uploaded source information of the deployment. + * + * @param source the source value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withSource(UserSourceInfo source) { + this.source = source; + return this; + } + + /** + * Get the appName property: App name of the deployment. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Get the deploymentSettings property: Deployment settings of the Deployment. + * + * @return the deploymentSettings value. + */ + public DeploymentSettings deploymentSettings() { + return this.deploymentSettings; + } + + /** + * Set the deploymentSettings property: Deployment settings of the Deployment. + * + * @param deploymentSettings the deploymentSettings value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withDeploymentSettings(DeploymentSettings deploymentSettings) { + this.deploymentSettings = deploymentSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Deployment. + * + * @return the provisioningState value. + */ + public DeploymentResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the Deployment. + * + * @return the status value. + */ + public DeploymentResourceStatus status() { + return this.status; + } + + /** + * Get the active property: Indicates whether the Deployment is active. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Get the createdTime property: Date time when the resource is created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the instances property: Collection of instances belong to the Deployment. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (deploymentSettings() != null) { + deploymentSettings().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java new file mode 100644 index 000000000000..87dab02b2b2c --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentResourceProvisioningState. */ +public final class DeploymentResourceProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DeploymentResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResourceProvisioningState. + */ + @JsonCreator + public static DeploymentResourceProvisioningState fromString(String name) { + return fromString(name, DeploymentResourceProvisioningState.class); + } + + /** @return known DeploymentResourceProvisioningState values. */ + public static Collection values() { + return values(DeploymentResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java new file mode 100644 index 000000000000..c171ec186ac9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentResourceStatus. */ +public final class DeploymentResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus STOPPED = fromString("Stopped"); + + /** Static value Running for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus RUNNING = fromString("Running"); + + /** Static value Failed for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus FAILED = fromString("Failed"); + + /** Static value Allocating for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus ALLOCATING = fromString("Allocating"); + + /** Static value Upgrading for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Compiling for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus COMPILING = fromString("Compiling"); + + /** + * Creates or finds a DeploymentResourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResourceStatus. + */ + @JsonCreator + public static DeploymentResourceStatus fromString(String name) { + return fromString(name, DeploymentResourceStatus.class); + } + + /** @return known DeploymentResourceStatus values. */ + public static Collection values() { + return values(DeploymentResourceStatus.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java new file mode 100644 index 000000000000..64293725cfa3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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.Map; + +/** The DeploymentSettings model. */ +@Fluent +public final class DeploymentSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentSettings.class); + + /* + * Required CPU, basic tier should be 1, standard tier should be in range + * (1, 4) + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /* + * Required Memory size in GB, basic tier should be in range (1, 2), + * standard tier should be in range (1, 8) + */ + @JsonProperty(value = "memoryInGB") + private Integer memoryInGB; + + /* + * JVM parameter + */ + @JsonProperty(value = "jvmOptions") + private String jvmOptions; + + /* + * Instance count, basic tier should be in range (1, 25), standard tier + * should be in range (1, 500) + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /* + * Collection of environment variables + */ + @JsonProperty(value = "environmentVariables") + private Map environmentVariables; + + /* + * Runtime version + */ + @JsonProperty(value = "runtimeVersion") + private RuntimeVersion runtimeVersion; + + /** + * Get the cpu property: Required CPU, basic tier should be 1, standard tier should be in range (1, 4). + * + * @return the cpu value. + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU, basic tier should be 1, standard tier should be in range (1, 4). + * + * @param cpu the cpu value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memoryInGB property: Required Memory size in GB, basic tier should be in range (1, 2), standard tier + * should be in range (1, 8). + * + * @return the memoryInGB value. + */ + public Integer memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: Required Memory size in GB, basic tier should be in range (1, 2), standard tier + * should be in range (1, 8). + * + * @param memoryInGB the memoryInGB value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withMemoryInGB(Integer memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the jvmOptions property: JVM parameter. + * + * @return the jvmOptions value. + */ + public String jvmOptions() { + return this.jvmOptions; + } + + /** + * Set the jvmOptions property: JVM parameter. + * + * @param jvmOptions the jvmOptions value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withJvmOptions(String jvmOptions) { + this.jvmOptions = jvmOptions; + return this; + } + + /** + * Get the instanceCount property: Instance count, basic tier should be in range (1, 25), standard tier should be in + * range (1, 500). + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: Instance count, basic tier should be in range (1, 25), standard tier should be in + * range (1, 500). + * + * @param instanceCount the instanceCount value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the environmentVariables property: Collection of environment variables. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Collection of environment variables. + * + * @param environmentVariables the environmentVariables value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the runtimeVersion property: Runtime version. + * + * @return the runtimeVersion value. + */ + public RuntimeVersion runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime version. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withRuntimeVersion(RuntimeVersion runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java new file mode 100644 index 000000000000..658e2cf3bf54 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 Error model. */ +@Fluent +public final class Error { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * The code of error. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The message of error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: The code of error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The code of error. + * + * @param code the code value to set. + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The message of error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message of error. + * + * @param message the message value to set. + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java new file mode 100644 index 000000000000..00e9327d2763 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The GitPatternRepository model. */ +@Fluent +public final class GitPatternRepository { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GitPatternRepository.class); + + /* + * Name of the repository + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Collection of pattern of the repository + */ + @JsonProperty(value = "pattern") + private List pattern; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label") + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** + * Get the name property: Name of the repository. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the repository. + * + * @param name the name value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withName(String name) { + this.name = name; + return this; + } + + /** + * Get the pattern property: Collection of pattern of the repository. + * + * @return the pattern value. + */ + public List pattern() { + return this.pattern; + } + + /** + * Set the pattern property: Collection of pattern of the repository. + * + * @param pattern the pattern value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPattern(List pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + 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 GitPatternRepository")); + } + if (uri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model GitPatternRepository")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java new file mode 100644 index 000000000000..dd3abe662d5f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 LogSpecification model. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * Name of the log + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the log + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of the log + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of the log. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of the log. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java new file mode 100644 index 000000000000..eeaad7f5b410 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 ManagedIdentityProperties model. */ +@Fluent +public final class ManagedIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentityProperties.class); + + /* + * The type property. + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * The principalId property. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The tenantId property. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The principalId property. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principalId property. + * + * @param principalId the principalId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java new file mode 100644 index 000000000000..5f5f786f44f0 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentityType. */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedIdentityType. */ + public static final ManagedIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** @return known ManagedIdentityType values. */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java new file mode 100644 index 000000000000..efa8babf2616 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 MetricDimension model. */ +@Fluent +public final class MetricDimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); + + /* + * Name of the dimension + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the dimension + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the dimension. + * + * @param name the name value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java new file mode 100644 index 000000000000..c2fe877a1992 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The MetricSpecification model. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of the metric + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the metric + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localized friendly description of the metric + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit that makes sense for the metric + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Supported aggregation types + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * Supported time grain types + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Dimensions of the metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit that makes sense for the metric. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: Supported aggregation types. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: Supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: Supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the dimensions property: Dimensions of the metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of the metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java new file mode 100644 index 000000000000..b66eb3e5da15 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 NameAvailabilityParameters model. */ +@Fluent +public final class NameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityParameters.class); + + /* + * Type of the resource to check name availability + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Name to be checked + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type property: Type of the resource to check name availability. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource to check name availability. + * + * @param type the type value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: Name to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to be checked. + * + * @param name the name value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model NameAvailabilityParameters")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model NameAvailabilityParameters")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java new file mode 100644 index 000000000000..3a9e2be984aa --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 OperationDisplay model. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Resource provider of the operation + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource of the operation + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Resource provider of the operation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource of the operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java new file mode 100644 index 000000000000..fdb26b5bff72 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 OperationProperties model. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * Service specifications of the operation + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Service specifications of the operation. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java new file mode 100644 index 000000000000..58ce442a6a98 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 PersistentDisk model. */ +@Fluent +public final class PersistentDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PersistentDisk.class); + + /* + * Size of the persistent disk in GB + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /* + * Size of the used persistent disk in GB + */ + @JsonProperty(value = "usedInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer usedInGB; + + /* + * Mount path of the persistent disk + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get the sizeInGB property: Size of the persistent disk in GB. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Size of the persistent disk in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the PersistentDisk object itself. + */ + public PersistentDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get the usedInGB property: Size of the used persistent disk in GB. + * + * @return the usedInGB value. + */ + public Integer usedInGB() { + return this.usedInGB; + } + + /** + * Get the mountPath property: Mount path of the persistent disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Mount path of the persistent disk. + * + * @param mountPath the mountPath value to set. + * @return the PersistentDisk object itself. + */ + public PersistentDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java new file mode 100644 index 000000000000..b8bf927b282b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** Static value Moved for ProvisioningState. */ + public static final ProvisioningState MOVED = fromString("Moved"); + + /** Static value MoveFailed for ProvisioningState. */ + public static final ProvisioningState MOVE_FAILED = fromString("MoveFailed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java new file mode 100644 index 000000000000..71f8d8c6d2cc --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 RegenerateTestKeyRequestPayload model. */ +@Fluent +public final class RegenerateTestKeyRequestPayload { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateTestKeyRequestPayload.class); + + /* + * Type of the test key + */ + @JsonProperty(value = "keyType", required = true) + private TestKeyType keyType; + + /** + * Get the keyType property: Type of the test key. + * + * @return the keyType value. + */ + public TestKeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: Type of the test key. + * + * @param keyType the keyType value to set. + * @return the RegenerateTestKeyRequestPayload object itself. + */ + public RegenerateTestKeyRequestPayload withKeyType(TestKeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model RegenerateTestKeyRequestPayload")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java new file mode 100644 index 000000000000..42e32e16d043 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ResourceSku model. */ +@Fluent +public final class ResourceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSku.class); + + /* + * Gets the type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * Gets the name of SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets the tier of SKU. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Gets the capacity of SKU. + */ + @JsonProperty(value = "capacity") + private SkuCapacity capacity; + + /* + * Gets the set of locations that the SKU is available. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets a list of locations and availability zones in those locations where + * the SKU is available. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /* + * Gets the restrictions because of which SKU cannot be used. This is + * empty if there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get the resourceType property: Gets the type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Gets the type of resource the SKU applies to. + * + * @param resourceType the resourceType value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the name property: Gets the name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the name of SKU. + * + * @param name the name value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gets the tier of SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Gets the tier of SKU. + * + * @param tier the tier value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Gets the capacity of SKU. + * + * @return the capacity value. + */ + public SkuCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Gets the capacity of SKU. + * + * @param capacity the capacity value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withCapacity(SkuCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the locations property: Gets the set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets the set of locations that the SKU is available. + * + * @param locations the locations value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @param locationInfo the locationInfo value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the restrictions property: Gets the restrictions because of which SKU cannot be used. This is empty if there + * are no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: Gets the restrictions because of which SKU cannot be used. This is empty if there + * are no restrictions. + * + * @param restrictions the restrictions value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java new file mode 100644 index 000000000000..6db765498a20 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 ResourceSkuCapabilities model. */ +@Fluent +public final class ResourceSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); + + /* + * Gets an invariant to describe the feature. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets an invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: Gets an invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets an invariant to describe the feature. + * + * @param name the name value to set. + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Gets an invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Gets an invariant if the feature is measured by quantity. + * + * @param value the value value to set. + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities 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/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java new file mode 100644 index 000000000000..439d9f0afa85 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ResourceSkuLocationInfo model. */ +@Fluent +public final class ResourceSkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuLocationInfo.class); + + /* + * Gets location of the SKU + */ + @JsonProperty(value = "location") + private String location; + + /* + * Gets list of availability zones where the SKU is supported. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Gets details of capabilities available to a SKU in specific zones. + */ + @JsonProperty(value = "zoneDetails") + private List zoneDetails; + + /** + * Get the location property: Gets location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Gets location of the SKU. + * + * @param location the location value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: Gets list of availability zones where the SKU is supported. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Gets list of availability zones where the SKU is supported. + * + * @param zones the zones value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Set the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @param zoneDetails the zoneDetails value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZoneDetails(List zoneDetails) { + this.zoneDetails = zoneDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java new file mode 100644 index 000000000000..ad66bfad2718 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ResourceSkuRestrictionInfo model. */ +@Fluent +public final class ResourceSkuRestrictionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictionInfo.class); + + /* + * Gets locations where the SKU is restricted + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets list of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the locations property: Gets locations where the SKU is restricted. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets locations where the SKU is restricted. + * + * @param locations the locations value to set. + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the zones property: Gets list of availability zones where the SKU is restricted. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Gets list of availability zones where the SKU is restricted. + * + * @param zones the zones value to set. + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java new file mode 100644 index 000000000000..ae843bfe3c65 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ResourceSkuRestrictions model. */ +@Fluent +public final class ResourceSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); + + /* + * Gets the type of restrictions. Possible values include: 'Location', + * 'Zone' + */ + @JsonProperty(value = "type") + private ResourceSkuRestrictionsType type; + + /* + * Gets the value of restrictions. If the restriction type is set to + * location. This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values") + private List values; + + /* + * Gets the information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo") + private ResourceSkuRestrictionInfo restrictionInfo; + + /* + * Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription' + */ + @JsonProperty(value = "reasonCode") + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type property: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @return the type value. + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Set the type property: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @param type the type value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withType(ResourceSkuRestrictionsType type) { + this.type = type; + return this; + } + + /** + * Get the values property: Gets the value of restrictions. If the restriction type is set to location. This would + * be different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Gets the value of restrictions. If the restriction type is set to location. This would + * be different locations where the SKU is restricted. + * + * @param values the values value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the restrictionInfo property: Gets the information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value. + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Set the restrictionInfo property: Gets the information about the restriction where the SKU cannot be used. + * + * @param restrictionInfo the restrictionInfo value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withRestrictionInfo(ResourceSkuRestrictionInfo restrictionInfo) { + this.restrictionInfo = restrictionInfo; + return this; + } + + /** + * Get the reasonCode property: Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + * + * @return the reasonCode value. + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reasonCode property: Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withReasonCode(ResourceSkuRestrictionsReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restrictionInfo() != null) { + restrictionInfo().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 000000000000..6b2bc15da8cb --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsReasonCode. */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = + fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsReasonCode. + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** @return known ResourceSkuRestrictionsReasonCode values. */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java new file mode 100644 index 000000000000..bd8bbf9208a1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsType. */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value Location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("Location"); + + /** Static value Zone for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType ZONE = fromString("Zone"); + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsType. + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** @return known ResourceSkuRestrictionsType values. */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java new file mode 100644 index 000000000000..8b7e417fb214 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ResourceSkuZoneDetails model. */ +@Fluent +public final class ResourceSkuZoneDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuZoneDetails.class); + + /* + * Gets the set of zones that the SKU is available in with the + * specified capabilities. + */ + @JsonProperty(value = "name") + private List name; + + /* + * Gets a list of capabilities that are available for the SKU in the + * specified list of zones. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * Get the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Set the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @param name the name value to set. + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withName(List name) { + this.name = name; + return this; + } + + /** + * Get the capabilities property: Gets a list of capabilities that are available for the SKU in the specified list + * of zones. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: Gets a list of capabilities that are available for the SKU in the specified list + * of zones. + * + * @param capabilities the capabilities value to set. + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java new file mode 100644 index 000000000000..5b3202dbe0a1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 ResourceUploadDefinition model. */ +@Fluent +public final class ResourceUploadDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUploadDefinition.class); + + /* + * Source relative path + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * Upload URL + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * Get the relativePath property: Source relative path. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Source relative path. + * + * @param relativePath the relativePath value to set. + * @return the ResourceUploadDefinition object itself. + */ + public ResourceUploadDefinition withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the uploadUrl property: Upload URL. + * + * @return the uploadUrl value. + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the uploadUrl property: Upload URL. + * + * @param uploadUrl the uploadUrl value to set. + * @return the ResourceUploadDefinition object itself. + */ + public ResourceUploadDefinition withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java new file mode 100644 index 000000000000..389b259eb9f5 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RuntimeVersion. */ +public final class RuntimeVersion extends ExpandableStringEnum { + /** Static value Java_8 for RuntimeVersion. */ + public static final RuntimeVersion JAVA_8 = fromString("Java_8"); + + /** Static value Java_11 for RuntimeVersion. */ + public static final RuntimeVersion JAVA_11 = fromString("Java_11"); + + /** + * Creates or finds a RuntimeVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuntimeVersion. + */ + @JsonCreator + public static RuntimeVersion fromString(String name) { + return fromString(name, RuntimeVersion.class); + } + + /** @return known RuntimeVersion values. */ + public static Collection values() { + return values(RuntimeVersion.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java new file mode 100644 index 000000000000..b7e442aee6bf --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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; + +/** The ServiceSpecification model. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Specifications of the Log for Azure Monitoring + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Specifications of the Metrics for Azure Monitoring + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java new file mode 100644 index 000000000000..4b869c3b0352 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 Sku model. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Name of the Sku + */ + @JsonProperty(value = "name") + private String name; + + /* + * Tier of the Sku + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Current capacity of the target resource + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: Name of the Sku. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Sku. + * + * @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: Tier of the Sku. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of the Sku. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Current capacity of the target resource. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Current capacity of the target resource. + * + * @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() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java new file mode 100644 index 000000000000..4240eadd47dc --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 SkuCapacity model. */ +@Fluent +public final class SkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapacity.class); + + /* + * Gets or sets the minimum. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Gets or sets the maximum. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /* + * Gets or sets the default. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /* + * Gets or sets the type of the scale. + */ + @JsonProperty(value = "scaleType") + private SkuScaleType scaleType; + + /** + * Get the minimum property: Gets or sets the minimum. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Gets or sets the minimum. + * + * @param minimum the minimum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Gets or sets the maximum. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Gets or sets the maximum. + * + * @param maximum the maximum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: Gets or sets the default. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Gets or sets the default. + * + * @param defaultProperty the defaultProperty value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scaleType property: Gets or sets the type of the scale. + * + * @return the scaleType value. + */ + public SkuScaleType scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: Gets or sets the type of the scale. + * + * @param scaleType the scaleType value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withScaleType(SkuScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java new file mode 100644 index 000000000000..12e659cfe329 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuScaleType. */ +public final class SkuScaleType extends ExpandableStringEnum { + /** Static value None for SkuScaleType. */ + public static final SkuScaleType NONE = fromString("None"); + + /** Static value Manual for SkuScaleType. */ + public static final SkuScaleType MANUAL = fromString("Manual"); + + /** Static value Automatic for SkuScaleType. */ + public static final SkuScaleType AUTOMATIC = fromString("Automatic"); + + /** + * Creates or finds a SkuScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuScaleType. + */ + @JsonCreator + public static SkuScaleType fromString(String name) { + return fromString(name, SkuScaleType.class); + } + + /** @return known SkuScaleType values. */ + public static Collection values() { + return values(SkuScaleType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java new file mode 100644 index 000000000000..a796973d671f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; +import com.azure.resourcemanager.resources.fluentcore.model.Appliable; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; +import com.azure.resourcemanager.resources.fluentcore.model.Updatable; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of an Azure Spring App. */ +@Fluent +@Beta +public interface SpringApp + extends ExternalChildResource, + HasInner, + Updatable { + /** @return whether the app exposes public endpoint */ + boolean isPublic(); + + /** @return whether only https is allowed for the app */ + boolean isHttpsOnly(); + + /** @return the url of the app */ + String url(); + + /** @return the temporary disk of the app */ + TemporaryDisk temporaryDisk(); + + /** @return the persistent disk of the app */ + PersistentDisk persistentDisk(); + + /** @return the identity property of the app */ + ManagedIdentityProperties identity(); + + /** @return the creation time of the app */ + OffsetDateTime createdTime(); + + /** @return the active deployment name */ + String activeDeployment(); + + /** @return the entry point of the spring app deployment */ + SpringAppDeployments deployments(); + + /** @return the blob url to upload deployment */ + Mono getResourceUploadUrlAsync(); + + /** @return the blob url to upload deployment */ + ResourceUploadDefinition getResourceUploadUrl(); + + /** Container interface for all the definitions that need to be implemented. */ + interface Definition + extends DefinitionStages.Blank { } + + /** Grouping of all the spring app definition stages. */ + interface DefinitionStages { + /** The first stage of the spring app definition. */ + interface Blank extends WithCreate { } + + /** The stage of a spring app definition allowing to specify the endpoint. */ + interface WithEndpoint { + /** + * Enables the public endpoint for the spring app. + * @return the next stage of spring app definition + */ + WithCreate withPublicEndpoint(); + + /** + * Specifies the custom domain for the spring app. + * @param domain the domain name + * @return the next stage of spring app definition + */ + WithCreate withCustomDomain(String domain); + + /** + * Enables https only for the spring app. + * @return the next stage of spring app definition + */ + WithCreate withHttpsOnly(); + } + + /** The stage of a spring app definition allowing to specify the disk. */ + interface WithDisk { + /** + * Specifies the temporary disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app definition + */ + WithCreate withTemporaryDisk(int sizeInGB, String mountPath); + + /** + * Specifies the persistent disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app definition + */ + WithCreate withPersistentDisk(int sizeInGB, String mountPath); + } + + /** + * The stage of a spring app definition allowing to specify an simple active deployment. + * for more operations, use {@link #deployments()} + */ + interface WithDeployment { + /** + * Deploys the jar package for the spring app with default scale. + * @param name the name of the deployment + * @param jarFile the file of the jar + * @return the next stage of spring app definition + */ + WithCreate deployJar(String name, File jarFile); + + /** + * Deploys the source code for the spring app with default scale. + * @param name the name of the deployment + * @param sourceCodeFolder the source code folder + * @param targetModule the target module of the source code + * @return the next stage of spring app definition + */ + WithCreate deploySource(String name, File sourceCodeFolder, String targetModule); + } + + /** + * The stage of the definition which contains all the minimum required inputs for the resource to be created, + * but also allows for any other optional settings to be specified. + */ + interface WithCreate + extends Creatable, + DefinitionStages.WithEndpoint, + DefinitionStages.WithDisk, + DefinitionStages.WithDeployment { } + } + + /** The template for an update operation, containing all the settings that can be modified. */ + interface Update + extends Appliable, + UpdateStages.WithEndpoint, + UpdateStages.WithDisk, + UpdateStages.WithDeployment { } + + /** Grouping of spring app update stages. */ + interface UpdateStages { + /** The stage of a spring app update allowing to specify the endpoint. */ + interface WithEndpoint { + /** + * Enables the public endpoint for the spring app. + * @return the next stage of spring app update + */ + Update withPublicEndpoint(); + + /** + * Disables the public endpoint for the spring app. + * @return the next stage of spring app update + */ + Update withoutPublicEndpoint(); + + /** + * Specifies the custom domain for the spring app. + * @param domain the domain name + * @return the next stage of spring app update + */ + Update withCustomDomain(String domain); + + /** + * Removes the custom domain for the spring app. + * @return the next stage of spring app update + */ + Update withoutCustomDomain(); + + /** + * Enables https only for the spring app. + * @return the next stage of spring app update + */ + Update withHttpsOnly(); + + /** + * Disables https only for the spring app. + * @return the next stage of spring app update + */ + Update withoutHttpsOnly(); + } + + /** The stage of a spring app update allowing to specify the disk. */ + interface WithDisk { + /** + * Specifies the temporary disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app update + */ + Update withTemporaryDisk(int sizeInGB, String mountPath); + + /** + * Removes the temporary disk for the spring app. + * @return the next stage of spring app update + */ + Update withoutTemporaryDisk(); + + /** + * Specifies the persistent disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app update + */ + Update withPersistentDisk(int sizeInGB, String mountPath); + + /** + * Removes the persistent disk for the spring app. + * @return the next stage of spring app update + */ + Update withoutPersistentDisk(); + } + + + /** + * The stage of a spring app update allowing to specify an simple active deployment. + * for more operations, use {@link #deployments()} + */ + interface WithDeployment { + /** + * Deploys the jar package for the spring app with default scale. + * @param name the name of the deployment + * @param jarFile the file of the jar + * @return the next stage of spring app update + */ + Update deployJar(String name, File jarFile); + + /** + * Deploys the source code for the spring app with default scale. + * @param name the name of the deployment + * @param sourceCodeFolder the source code folder + * @param targetModule the target module of the source code + * @return the next stage of spring app update + */ + Update deploySource(String name, File sourceCodeFolder, String targetModule); + + /** + * Specifies active deployment for the spring app. + * @param name the name of the deployment + * @return the next stage of spring app update + */ + Update withActiveDeployment(String name); + + /** + * Removes a deployment for the spring app. + * @param name the name of the deployment + * @return the next stage of spring app update + */ + Update withoutDeployment(String name); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java new file mode 100644 index 000000000000..1c4f1d368803 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; +import com.azure.resourcemanager.resources.fluentcore.model.Appliable; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; +import com.azure.resourcemanager.resources.fluentcore.model.Updatable; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of an Azure deployment Deployment request. */ +@Fluent +@Beta +public interface SpringAppDeployment + extends ExternalChildResource, + HasInner, + Updatable { + /** @return the app name of the deployment */ + String appName(); + + /** @return the deploy settings of the deployment */ + DeploymentSettings settings(); + + /** @return the status of the deployment */ + DeploymentResourceStatus status(); + + /** @return whether the deployment is active */ + boolean isActive(); + + /** @return the creation time of the deployment */ + OffsetDateTime createdTime(); + + /** @return all the instances of the deployment */ + List instances(); + + /** @return the log file url of the deployment */ + String getLogFileUrl(); + + /** @return the log file url of the deployment */ + Mono getLogFileUrlAsync(); + + /** Container interface for all the definitions that need to be implemented. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithSource, + DefinitionStages.WithModule, + DefinitionStages.WithPredefinedSettings, + DefinitionStages.WithSettingsAndCreate { } + + /** Grouping of all the deployment definition stages. */ + interface DefinitionStages { + /** The first stage of the deployment definition. */ + interface Blank extends WithSource { } + + /** The stage of a deployment definition allowing to specify the source code or package. */ + interface WithSource { + /** + * Specifies the jar package for the deployment. + * @param jar the file of the jar + * @return the next stage of deployment definition + */ + WithPredefinedSettings withJarFile(File jar); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeFolder the folder of the source code + * @return the next stage of deployment definition + */ + WithModule withSourceCodeFolder(File sourceCodeFolder); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeTarGz a tar.gz file of the source code + * @return the next stage of deployment definition + */ + WithModule withSourceCodeTarGzFile(File sourceCodeTarGz); + + /** + * Specifies the a existing source in the cloud storage. + * @param type the source type in previous upload + * @param relativePath the relative path gotten from getResourceUploadUrl + * @return the next stage of deployment definition + */ + WithPredefinedSettings withExistingSource(UserSourceType type, String relativePath); + } + + /** The stage of a deployment definition allowing to specify the module of the source code. */ + interface WithModule { + /** + * Specifies the module of the source code. + * @param moduleName the target module of the multi-module source code + * @return the next stage of deployment definition + */ + WithPredefinedSettings withTargetModule(String moduleName); + + /** + * Specifies the only module of the source code. + * @return the next stage of deployment definition + */ + WithPredefinedSettings withSingleModule(); + } + + /** The stage of a deployment definition allowing to specify predefined settings. */ + interface WithPredefinedSettings { + /** + * Specifies the settings from the app active deployment. + * @return the next stage of deployment definition + */ + WithCreate withSettingsFromActiveDeployment(); + + /** + * Specifies the settings from another deployment. + * @param deployment the deployment object + * @return the next stage of deployment definition + */ + WithCreate withSettingsFromDeployment(SpringAppDeployment deployment); + + /** + * Specifies the settings from another deployment. + * @param deploymentName the name of the deployment + * @return the next stage of deployment definition + */ + WithCreate withSettingsFromDeployment(String deploymentName); + + /** + * Customizes settings of the deployment. + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withCustomSetting(); + } + + /** The stage of a deployment definition allowing to specify deployment settings. */ + interface WithSettings { + /** + * Specifies the instance number of the deployment. + * @param count the number of the instance + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withInstance(int count); + + /** + * Specifies the cpu number of the deployment. + * @param cpuCount the number of the cpu + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withCpu(int cpuCount); + + /** + * Specifies the memory of the deployment. + * @param sizeInGB the size of the memory in GB + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withMemory(int sizeInGB); + + /** + * Specifies the runtime version of the deployment. + * @param version the runtime version of Java + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withRuntime(RuntimeVersion version); + + /** + * Specifies the jvm options of the deployment. + * @param jvmOptions the argument of jvm + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withJvmOptions(String jvmOptions); + + /** + * Specifies a environment variable of the deployment. + * @param key the key of the environment + * @param value the value of the environment + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withEnvironment(String key, String value); + + /** + * Specifies the version of the deployment. + * @param versionName the version name of the deployment + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withVersionName(String versionName); + + /** + * Activates of the deployment after definition. + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withActivation(); + } + + interface WithBaseSettings { + /** + * Specifies the version of the deployment. + * @param versionName the version name of the deployment + * @return the next stage of deployment definition + */ + WithCreate withVersionName(String versionName); + + /** + * Activates of the deployment after definition. + * @return the next stage of deployment definition + */ + WithCreate withActivation(); + } + + /** + * The stage of the definition which contains all required inputs for the resource to be created. + */ + interface WithCreate + extends Creatable, + WithBaseSettings { } + + /** + * The stage of the definition which contains all the minimum required inputs for the resource to be created, + * but also allows for any other optional settings to be specified. + */ + interface WithSettingsAndCreate + extends WithCreate, + WithSettings { } + } + + /** The template for an update operation, containing all the settings that can be modified. */ + interface Update + extends Appliable, + UpdateStages.WithSource, + UpdateStages.WithModule, + UpdateStages.WithSettings { } + + /** Grouping of deployment update stages. */ + interface UpdateStages { + /** The stage of a deployment update allowing to specify deployment settings. */ + interface WithSettings { + /** + * Specifies the instance number of the deployment. + * @param count the number of the instance + * @return the next stage of deployment update + */ + Update withInstance(int count); + + /** + * Specifies the cpu number of the deployment. + * @param cpuCount the number of the cpu + * @return the next stage of deployment update + */ + Update withCpu(int cpuCount); + + /** + * Specifies the memory of the deployment. + * @param sizeInGB the size of the memory in GB + * @return the next stage of deployment update + */ + Update withMemory(int sizeInGB); + + /** + * Specifies the runtime version of the deployment. + * @param version the runtime version of Java + * @return the next stage of deployment update + */ + Update withRuntime(RuntimeVersion version); + + /** + * Specifies the jvm options of the deployment. + * @param jvmOptions the argument of jvm + * @return the next stage of deployment update + */ + Update withJvmOptions(String jvmOptions); + + /** + * Specifies a environment variable of the deployment. + * @param key the key of the environment + * @param value the value of the environment + * @return the next stage of deployment update + */ + Update withEnvironment(String key, String value); + + /** + * Removes a environment variable of the deployment. + * @param key the key of the environment + * @return the next stage of deployment update + */ + Update withoutEnvironment(String key); + + /** + * Specifies the version of the deployment. + * @param versionName the version name of the deployment + * @return the next stage of deployment update + */ + Update withVersionName(String versionName); + + /** + * Activates of the deployment after update. + * @return the next stage of deployment update + */ + Update withActivation(); + } + + /** The stage of a deployment update allowing to specify the source code or package. */ + interface WithSource { + /** + * Specifies the jar package for the deployment. + * @param jar the file of the jar + * @return the next stage of deployment update + */ + Update withJarFile(File jar); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeFolder the folder of the source code + * @return the next stage of deployment update + */ + WithModule withSourceCodeFolder(File sourceCodeFolder); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeTarGz a tar.gz file of the source code + * @return the next stage of deployment update + */ + WithModule withSourceCodeTarGzFile(File sourceCodeTarGz); + + /** + * Specifies the a existing source in the cloud storage. + * @param type the source type in previous upload + * @param relativePath the relative path gotten from getResourceUploadUrl + * @return the next stage of deployment update + */ + Update withExistingSource(UserSourceType type, String relativePath); + } + + /** The stage of a deployment update allowing to specify the module of the source code. */ + interface WithModule { + /** + * Specifies the module of the source code. + * @param moduleName the target module of the multi-module source code + * @return the next stage of deployment update + */ + Update withTargetModule(String moduleName); + + /** + * Specifies the only module of the source code. + * @return the next stage of deployment update + */ + Update withSingleModule(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java new file mode 100644 index 000000000000..94b05124a722 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.DeploymentsClient; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; + +/** Entry point for Spring App Deployments API. */ +@Fluent +@Beta +public interface SpringAppDeployments + extends HasManager, + HasInner, + HasParent, + SupportsCreating, + SupportsGettingById, + SupportsGettingByName, + SupportsListing, + SupportsDeletingById, + SupportsDeletingByName { +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java new file mode 100644 index 000000000000..d2cb8fe70155 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.AppsClient; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; + +/** Entry point for Spring Apps API. */ +@Fluent +@Beta +public interface SpringApps + extends HasManager, + HasInner, + HasParent, + SupportsCreating, + SupportsGettingById, + SupportsGettingByName, + SupportsListing, + SupportsDeletingById, + SupportsDeletingByName { +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java new file mode 100644 index 000000000000..6403422be52d --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; +import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; +import com.azure.resourcemanager.resources.fluentcore.model.Appliable; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; +import com.azure.resourcemanager.resources.fluentcore.model.Updatable; +import reactor.core.publisher.Mono; + +/** An immutable client-side representation of an Azure Spring Service. */ +@Fluent +@Beta +public interface SpringService + extends GroupableResource, + Refreshable, + Updatable { + + /** @return Sku of the service */ + Sku sku(); + + /** @return Trace properties of the service */ + TraceProperties traceProperties(); + + /** @return server properties of the service */ + ConfigServerProperties serverProperties(); + + /** @return the entry point of the spring app */ + SpringApps apps(); + + /** + * Lists test keys for the service. + * @return all test keys + */ + TestKeys listTestKeys(); + + /** + * Lists test keys for the service. + * @return all test keys + */ + Mono listTestKeysAsync(); + + /** + * Regenerates a test key for the Service. + * @param keyType the type of the regenerated key + * @return all test keys + */ + TestKeys regenerateTestKeys(TestKeyType keyType); + + /** + * Regenerates a test key for the Service. + * @param keyType the type of the regenerated key + * @return all test keys + */ + Mono regenerateTestKeysAsync(TestKeyType keyType); + + /** + * Disables the test endpoint for the service. + */ + void disableTestEndpoint(); + + /** + * Disables the test endpoint for the service. + * @return null + */ + Mono disableTestEndpointAsync(); + + /** + * Enables the test endpoint for the service. + * @return all test keys + */ + TestKeys enableTestEndpoint(); + + /** + * Enables the test endpoint for the service. + * @return all test keys + */ + Mono enableTestEndpointAsync(); + + /** Container interface for all the definitions that need to be implemented. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithGroup, + DefinitionStages.WithCreate { } + + /** Grouping of all the spring service definition stages. */ + interface DefinitionStages { + /** The first stage of the spring service definition. */ + interface Blank extends GroupableResource.DefinitionWithRegion { } + + /** The stage of a spring service definition allowing to specify the resource group. */ + interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { } + + /** + * The stage of a spring service definition allowing to specify sku. + * All sku supported could be gotten from {@link SpringServices#listSkus()}. + */ + interface WithSku { + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @return the next stage of spring service definition + */ + WithCreate withSku(String skuName); + + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @param capacity the capacity for the spring service + * @return the next stage of spring service definition + */ + WithCreate withSku(String skuName, int capacity); + + /** + * Specifies the sku of the spring service. + * @param sku the entire sku object + * @return the next stage of spring service definition + */ + WithCreate withSku(Sku sku); + } + + /** The stage of a spring service definition allowing to specify tracing with app insight. */ + interface WithTracing { + /** + * Specifies tracing property with app insight + * @param appInsightInstrumentationKey the app insight instrumentation key + * @return the next stage of spring service definition + */ + WithCreate withTracing(String appInsightInstrumentationKey); + } + + /** + * The stage of the definition which contains all the minimum required inputs for the resource to be created, + * but also allows for any other optional settings to be specified. + */ + interface WithCreate + extends Creatable, + Resource.DefinitionWithTags, + WithSku, + WithTracing { } + } + + /** The template for an update operation, containing all the settings that can be modified. */ + interface Update + extends Appliable, + Resource.UpdateWithTags, + UpdateStages.WithSku, + UpdateStages.WithTracing, + UpdateStages.WithConfiguration { } + + /** Grouping of spring service update stages. */ + interface UpdateStages { + /** + * The stage of a spring service update allowing to specify sku. + * All sku supported could be gotten from {@link SpringServices#listSkus()}. + */ + interface WithSku { + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @return the next stage of spring service update + */ + Update withSku(String skuName); + + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @param capacity the capacity for the spring service + * @return the next stage of spring service update + */ + Update withSku(String skuName, int capacity); + + /** + * Specifies the sku of the spring service. + * @param sku the entire sku object + * @return the next stage of spring service update + */ + Update withSku(Sku sku); + } + + /** The stage of a spring service update allowing to specify tracing with app insight. */ + interface WithTracing { + /** + * Specifies tracing property with app insight. + * @param appInsightInstrumentationKey the app insight instrumentation key + * @return the next stage of spring service update + */ + Update withTracing(String appInsightInstrumentationKey); + + /** + * Removes tracing property. + * @return the next stage of spring service update + */ + Update withoutTracing(); + } + + /** The stage of a spring service update allowing to specify the server configuration. */ + interface WithConfiguration { + /** + * Specifies the git repository for the spring service. + * @param uri the uri of the git repository + * @return the next stage of spring service update + */ + Update withGitUri(String uri); + + /** + * Specifies the git repository for the spring service. + * @param uri the uri of the git repository + * @param username the username of the private git repository + * @param password the password of the private git repository + * @return the next stage of spring service update + */ + Update withGitUriAndCredential(String uri, String username, String password); + + /** + * Specifies the git repository for the spring service. + * @param gitConfig the configuration of the git repository + * @return the next stage of spring service update + */ + Update withGitConfig(ConfigServerGitProperty gitConfig); + + /** + * Removes the git configuration. + * @return the next stage of spring service update + */ + Update withoutGitConfig(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java new file mode 100644 index 000000000000..861f7a4eca58 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.ServicesClient; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; + +/** Entry point for Spring Service management API. */ +@Fluent +@Beta +public interface SpringServices + extends HasManager, + HasInner, + SupportsCreating, + SupportsGettingById, + SupportsGettingByResourceGroup, + SupportsListing, + SupportsListingByResourceGroup, + SupportsDeletingById, + SupportsDeletingByResourceGroup { + /** @return all available sku. */ + PagedIterable listSkus(); + + /** @return all available sku. */ + PagedFlux listSkusAsync(); +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java new file mode 100644 index 000000000000..f40fe05185ce --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 TemporaryDisk model. */ +@Fluent +public final class TemporaryDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TemporaryDisk.class); + + /* + * Size of the temporary disk in GB + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /* + * Mount path of the temporary disk + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get the sizeInGB property: Size of the temporary disk in GB. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Size of the temporary disk in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get the mountPath property: Mount path of the temporary disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Mount path of the temporary disk. + * + * @param mountPath the mountPath value to set. + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java new file mode 100644 index 000000000000..df7eb484d704 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TestKeyType. */ +public final class TestKeyType extends ExpandableStringEnum { + /** Static value Primary for TestKeyType. */ + public static final TestKeyType PRIMARY = fromString("Primary"); + + /** Static value Secondary for TestKeyType. */ + public static final TestKeyType SECONDARY = fromString("Secondary"); + + /** + * Creates or finds a TestKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestKeyType. + */ + @JsonCreator + public static TestKeyType fromString(String name) { + return fromString(name, TestKeyType.class); + } + + /** @return known TestKeyType values. */ + public static Collection values() { + return values(TestKeyType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java new file mode 100644 index 000000000000..b0e1427bcafd --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 TestKeys model. */ +@Fluent +public final class TestKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestKeys.class); + + /* + * Primary key + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * Secondary key + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /* + * Primary test endpoint + */ + @JsonProperty(value = "primaryTestEndpoint") + private String primaryTestEndpoint; + + /* + * Secondary test endpoint + */ + @JsonProperty(value = "secondaryTestEndpoint") + private String secondaryTestEndpoint; + + /* + * Indicates whether the test endpoint feature enabled or not + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the primaryKey property: Primary key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary key. + * + * @param primaryKey the primaryKey value to set. + * @return the TestKeys object itself. + */ + public TestKeys withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary key. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary key. + * + * @param secondaryKey the secondaryKey value to set. + * @return the TestKeys object itself. + */ + public TestKeys withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the primaryTestEndpoint property: Primary test endpoint. + * + * @return the primaryTestEndpoint value. + */ + public String primaryTestEndpoint() { + return this.primaryTestEndpoint; + } + + /** + * Set the primaryTestEndpoint property: Primary test endpoint. + * + * @param primaryTestEndpoint the primaryTestEndpoint value to set. + * @return the TestKeys object itself. + */ + public TestKeys withPrimaryTestEndpoint(String primaryTestEndpoint) { + this.primaryTestEndpoint = primaryTestEndpoint; + return this; + } + + /** + * Get the secondaryTestEndpoint property: Secondary test endpoint. + * + * @return the secondaryTestEndpoint value. + */ + public String secondaryTestEndpoint() { + return this.secondaryTestEndpoint; + } + + /** + * Set the secondaryTestEndpoint property: Secondary test endpoint. + * + * @param secondaryTestEndpoint the secondaryTestEndpoint value to set. + * @return the TestKeys object itself. + */ + public TestKeys withSecondaryTestEndpoint(String secondaryTestEndpoint) { + this.secondaryTestEndpoint = secondaryTestEndpoint; + return this; + } + + /** + * Get the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @param enabled the enabled value to set. + * @return the TestKeys object itself. + */ + public TestKeys withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java new file mode 100644 index 000000000000..ddf58267be24 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 TraceProperties model. */ +@Fluent +public final class TraceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TraceProperties.class); + + /* + * State of the trace proxy. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TraceProxyState state; + + /* + * Error when apply trace proxy changes. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Indicates whether enable the tracing functionality + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Target application insight instrumentation key + */ + @JsonProperty(value = "appInsightInstrumentationKey") + private String appInsightInstrumentationKey; + + /** + * Get the state property: State of the trace proxy. + * + * @return the state value. + */ + public TraceProxyState state() { + return this.state; + } + + /** + * Get the error property: Error when apply trace proxy changes. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when apply trace proxy changes. + * + * @param error the error value to set. + * @return the TraceProperties object itself. + */ + public TraceProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the enabled property: Indicates whether enable the tracing functionality. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether enable the tracing functionality. + * + * @param enabled the enabled value to set. + * @return the TraceProperties object itself. + */ + public TraceProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the appInsightInstrumentationKey property: Target application insight instrumentation key. + * + * @return the appInsightInstrumentationKey value. + */ + public String appInsightInstrumentationKey() { + return this.appInsightInstrumentationKey; + } + + /** + * Set the appInsightInstrumentationKey property: Target application insight instrumentation key. + * + * @param appInsightInstrumentationKey the appInsightInstrumentationKey value to set. + * @return the TraceProperties object itself. + */ + public TraceProperties withAppInsightInstrumentationKey(String appInsightInstrumentationKey) { + this.appInsightInstrumentationKey = appInsightInstrumentationKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java new file mode 100644 index 000000000000..aa779bc61b1e --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TraceProxyState. */ +public final class TraceProxyState extends ExpandableStringEnum { + /** Static value NotAvailable for TraceProxyState. */ + public static final TraceProxyState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Failed for TraceProxyState. */ + public static final TraceProxyState FAILED = fromString("Failed"); + + /** Static value Succeeded for TraceProxyState. */ + public static final TraceProxyState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for TraceProxyState. */ + public static final TraceProxyState UPDATING = fromString("Updating"); + + /** + * Creates or finds a TraceProxyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TraceProxyState. + */ + @JsonCreator + public static TraceProxyState fromString(String name) { + return fromString(name, TraceProxyState.class); + } + + /** @return known TraceProxyState values. */ + public static Collection values() { + return values(TraceProxyState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java new file mode 100644 index 000000000000..2f2cf6bbb5a9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The TrackedResource model. */ +@Fluent +public class TrackedResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackedResource.class); + + /* + * The GEO location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Tags of the service which is a list of key value pairs that describe the + * resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the location property: The GEO location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The GEO location of the resource. + * + * @param location the location value to set. + * @return the TrackedResource object itself. + */ + public TrackedResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Tags of the service which is a list of key value pairs that describe the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the service which is a list of key value pairs that describe the resource. + * + * @param tags the tags value to set. + * @return the TrackedResource object itself. + */ + public TrackedResource withTags(Map 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/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java new file mode 100644 index 000000000000..e846a1b3cd60 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.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 UserSourceInfo model. */ +@Fluent +public final class UserSourceInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserSourceInfo.class); + + /* + * Type of the source uploaded + */ + @JsonProperty(value = "type") + private UserSourceType type; + + /* + * Relative path of the storage which stores the source + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * Version of the source + */ + @JsonProperty(value = "version") + private String version; + + /* + * Selector for the artifact to be used for the deployment for multi-module + * projects. This should be + * the relative path to the target module/project. + */ + @JsonProperty(value = "artifactSelector") + private String artifactSelector; + + /** + * Get the type property: Type of the source uploaded. + * + * @return the type value. + */ + public UserSourceType type() { + return this.type; + } + + /** + * Set the type property: Type of the source uploaded. + * + * @param type the type value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withType(UserSourceType type) { + this.type = type; + return this; + } + + /** + * Get the relativePath property: Relative path of the storage which stores the source. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Relative path of the storage which stores the source. + * + * @param relativePath the relativePath value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the version property: Version of the source. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the source. + * + * @param version the version value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the artifactSelector property: Selector for the artifact to be used for the deployment for multi-module + * projects. This should be the relative path to the target module/project. + * + * @return the artifactSelector value. + */ + public String artifactSelector() { + return this.artifactSelector; + } + + /** + * Set the artifactSelector property: Selector for the artifact to be used for the deployment for multi-module + * projects. This should be the relative path to the target module/project. + * + * @param artifactSelector the artifactSelector value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withArtifactSelector(String artifactSelector) { + this.artifactSelector = artifactSelector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java new file mode 100644 index 000000000000..95db47bca077 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UserSourceType. */ +public final class UserSourceType extends ExpandableStringEnum { + /** Static value Jar for UserSourceType. */ + public static final UserSourceType JAR = fromString("Jar"); + + /** Static value Source for UserSourceType. */ + public static final UserSourceType SOURCE = fromString("Source"); + + /** + * Creates or finds a UserSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserSourceType. + */ + @JsonCreator + public static UserSourceType fromString(String name) { + return fromString(name, UserSourceType.class); + } + + /** @return known UserSourceType values. */ + public static Collection values() { + return values(UserSourceType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java new file mode 100644 index 000000000000..12fc4282caf3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java @@ -0,0 +1,6 @@ +// 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 AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform.models; diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java new file mode 100644 index 000000000000..d3e4c42ab0c8 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java @@ -0,0 +1,6 @@ +// 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 AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform; diff --git a/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java new file mode 100644 index 000000000000..2a1f0a14aeb6 --- /dev/null +++ b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform; + +import com.azure.core.http.HttpPipeline; +import com.azure.resourcemanager.resources.core.TestBase; +import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; + +import java.io.IOException; + +public class AppPlatformTest extends TestBase { + protected AppPlatformManager appPlatformManager; + protected String rgName = ""; + + public AppPlatformTest() { + } + + AppPlatformTest(RunCondition runCondition) { + super(runCondition); + } + + @Override + protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) throws IOException { + rgName = generateRandomResourceName("rg", 20); + appPlatformManager = AppPlatformManager.authenticate(httpPipeline, profile); + } + + @Override + protected void cleanUpResources() { + try { + appPlatformManager.resourceManager().resourceGroups().beginDeleteByName(rgName); + } catch (Exception e) { } + } +} diff --git a/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java new file mode 100644 index 000000000000..86f1b70b83af --- /dev/null +++ b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform; + +import com.azure.resourcemanager.appplatform.models.RuntimeVersion; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.resources.fluentcore.arm.Region; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; +import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; +import org.apache.commons.compress.utils.IOUtils; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; + +public class SpringCloudTest extends AppPlatformTest { + + SpringCloudTest() { + super(RunCondition.LIVE_ONLY); // need storage data-plane and url check + } + + @Test + public void canCRUDSpringAppWithDeployment() throws IOException { + String serviceName = generateRandomResourceName("springsvc", 15); + String appName = "gateway"; + String deploymentName = generateRandomResourceName("deploy", 15); + String deploymentName1 = generateRandomResourceName("deploy", 15); + + SpringService service = appPlatformManager.springServices().define(serviceName) + .withRegion(Region.US_EAST) + .withNewResourceGroup(rgName) + .withSku("B0") + .create(); + + Assertions.assertEquals("B0", service.sku().name()); + + service.update() + .withSku("S0") + .apply(); + + Assertions.assertEquals("S0", service.sku().name()); + + service.update() + .withGitUri("https://github.com/Azure-Samples/piggymetrics-config") + .apply(); + Assertions.assertEquals("https://github.com/Azure-Samples/piggymetrics-config", service.serverProperties().configServer().gitProperty().uri()); + + File jarFile = new File("gateway.jar"); + if (!jarFile.exists()) { + HttpURLConnection connection = (HttpURLConnection) new URL("https://github.com/weidongxu-microsoft/azure-sdk-for-java-management-tests/raw/master/spring-cloud/gateway.jar").openConnection(); + connection.connect(); + try (InputStream inputStream = connection.getInputStream(); + OutputStream outputStream = new FileOutputStream(jarFile)) { + IOUtils.copy(inputStream, outputStream); + } + connection.disconnect(); + } + + SpringApp app = service.apps().define(appName) + .withPublicEndpoint() + .create(); + + Assertions.assertNotNull(app.url()); + Assertions.assertNotNull(app.activeDeployment()); + + Assertions.assertTrue(requestSuccess(app.url())); + + app.update() + .withoutDeployment(app.activeDeployment()) + .deployJar(deploymentName, jarFile) + .apply(); + + Assertions.assertNotNull(app.url()); + Assertions.assertEquals(deploymentName, app.activeDeployment()); + Assertions.assertEquals(1, app.deployments().list().stream().count()); + + Assertions.assertTrue(requestSuccess(app.url())); + + SpringAppDeployment deployment = app.deployments().getByName(app.activeDeployment()); + deployment.update() + .withCpu(2) + .withMemory(4) + .withRuntime(RuntimeVersion.JAVA_11) + .withInstance(2) + .apply(); + + Assertions.assertEquals(2, deployment.settings().cpu()); + Assertions.assertEquals(4, deployment.settings().memoryInGB()); + Assertions.assertEquals(RuntimeVersion.JAVA_11, deployment.settings().runtimeVersion()); + Assertions.assertEquals(2, deployment.instances().size()); + + File sourceCodeFolder = new File("piggymetrics"); + if (!sourceCodeFolder.exists() || sourceCodeFolder.isFile()) { + if (sourceCodeFolder.isFile()) { + sourceCodeFolder.delete(); + } + extraTarGzSource(sourceCodeFolder); + } + + deployment = app.deployments().define(deploymentName1) + .withSourceCodeFolder(sourceCodeFolder) + .withTargetModule("gateway") + .withSettingsFromActiveDeployment() + .withActivation() + .create(); + app.refresh(); + + Assertions.assertEquals(deploymentName1, app.activeDeployment()); + Assertions.assertEquals(2, deployment.settings().cpu()); + Assertions.assertNotNull(deployment.getLogFileUrl()); + + Assertions.assertTrue(requestSuccess(app.url())); + + app.update() + .withoutPublicEndpoint() + .apply(); + Assertions.assertFalse(app.isPublic()); + } + + private boolean requestSuccess(String url) throws IOException { + for (int i = 0; i < 60; ++i) { + HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); + try { + connection.connect(); + if (connection.getResponseCode() == 200) { + connection.getInputStream().close(); + return true; + } + System.out.printf("Do request to %s with response code %d%n", url, connection.getResponseCode()); + } finally { + connection.disconnect(); + SdkContext.sleep(5000); + } + } + return false; + } + + private void extraTarGzSource(File folder) throws IOException { + HttpURLConnection connection = (HttpURLConnection) new URL("https://github.com/weidongxu-microsoft/azure-sdk-for-java-management-tests/raw/master/spring-cloud/piggymetrics.tar.gz").openConnection(); + connection.connect(); + try (TarArchiveInputStream inputStream = new TarArchiveInputStream(new GzipCompressorInputStream(connection.getInputStream()))) { + TarArchiveEntry entry; + while ((entry = inputStream.getNextTarEntry()) != null) { + if (entry.isDirectory()) { + continue; + } + File file = new File(folder, entry.getName()); + File parent = file.getParentFile(); + if (!parent.exists()) { + parent.mkdirs(); + } + try (OutputStream outputStream = new FileOutputStream(file)) { + IOUtils.copy(inputStream, outputStream); + } + } + } + connection.disconnect(); + } +} diff --git a/sdk/management/api-specs.json b/sdk/management/api-specs.json index 7f9b79ac4079..349d24690be0 100644 --- a/sdk/management/api-specs.json +++ b/sdk/management/api-specs.json @@ -11,6 +11,12 @@ "package": "com.microsoft.azure.resourcemanager.apimanagement", "args": "--payload-flattening-threshold=1 --tag=package-2018-01" }, + "appplatform": { + "dir": "../appplatform/mgmt", + "source": "specification/appplatform/resource-manager/readme.md", + "package": "com.azure.resourcemanager.appplatform", + "args": "--payload-flattening-threshold=1 --tag=package-2019-05-01-preview --remove-inner=TestKeys,ResourceSku,ResourceUploadDefinition" + }, "appservice": { "dir": "../appservice/mgmt", "source": "specification/web/resource-manager/readme.md", diff --git a/sdk/management/azure/pom.xml b/sdk/management/azure/pom.xml index 1e4a730318a9..0fc16e5a2556 100644 --- a/sdk/management/azure/pom.xml +++ b/sdk/management/azure/pom.xml @@ -116,6 +116,11 @@ azure-resourcemanager-dns 2.0.0-SNAPSHOT + + com.azure.resourcemanager + azure-resourcemanager-appplatform + 2.0.0-SNAPSHOT + org.junit.jupiter junit-jupiter-engine diff --git a/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java b/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java index a5f753171e50..8e0c14d820db 100644 --- a/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java +++ b/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java @@ -6,13 +6,15 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.models.SpringServices; +import com.azure.resourcemanager.appservice.AppServiceManager; import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrders; import com.azure.resourcemanager.appservice.models.AppServiceCertificates; import com.azure.resourcemanager.appservice.models.AppServiceDomains; import com.azure.resourcemanager.appservice.models.AppServicePlans; import com.azure.resourcemanager.appservice.models.FunctionApps; import com.azure.resourcemanager.appservice.models.WebApps; -import com.azure.resourcemanager.appservice.AppServiceManager; import com.azure.resourcemanager.authorization.AuthorizationManager; import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications; import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups; @@ -41,19 +43,20 @@ import com.azure.resourcemanager.containerservice.models.KubernetesClusters; import com.azure.resourcemanager.cosmos.CosmosManager; import com.azure.resourcemanager.cosmos.models.CosmosDBAccounts; -import com.azure.resourcemanager.dns.models.DnsZones; import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.keyvault.models.Vaults; +import com.azure.resourcemanager.dns.models.DnsZones; import com.azure.resourcemanager.keyvault.KeyVaultManager; +import com.azure.resourcemanager.keyvault.models.Vaults; +import com.azure.resourcemanager.monitor.MonitorManager; import com.azure.resourcemanager.monitor.models.ActionGroups; import com.azure.resourcemanager.monitor.models.ActivityLogs; import com.azure.resourcemanager.monitor.models.AlertRules; import com.azure.resourcemanager.monitor.models.AutoscaleSettings; import com.azure.resourcemanager.monitor.models.DiagnosticSettings; import com.azure.resourcemanager.monitor.models.MetricDefinitions; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.msi.models.Identities; import com.azure.resourcemanager.msi.MSIManager; +import com.azure.resourcemanager.msi.models.Identities; +import com.azure.resourcemanager.network.NetworkManager; import com.azure.resourcemanager.network.models.ApplicationGateways; import com.azure.resourcemanager.network.models.ApplicationSecurityGroups; import com.azure.resourcemanager.network.models.DdosProtectionPlans; @@ -71,7 +74,6 @@ import com.azure.resourcemanager.network.models.RouteFilters; import com.azure.resourcemanager.network.models.RouteTables; import com.azure.resourcemanager.network.models.VirtualNetworkGateways; -import com.azure.resourcemanager.network.NetworkManager; import com.azure.resourcemanager.resources.ResourceManager; import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; @@ -124,6 +126,7 @@ public final class Azure { private final MSIManager msiManager; private final MonitorManager monitorManager; // private final EventHubManager eventHubManager; + private final AppPlatformManager appPlatformManager; private final String subscriptionId; private final Authenticated authenticated; private final SdkContext sdkContext; @@ -367,6 +370,7 @@ private Azure(HttpPipeline httpPipeline, AzureProfile profile, Authenticated aut this.msiManager = MSIManager.authenticate(httpPipeline, profile, sdkContext); this.monitorManager = MonitorManager.authenticate(httpPipeline, profile, sdkContext); // this.eventHubManager = EventHubManager.authenticate(restClient, subscriptionId, sdkContext); + this.appPlatformManager = AppPlatformManager.authenticate(httpPipeline, profile, sdkContext); this.subscriptionId = profile.subscriptionId(); this.authenticated = authenticated; } @@ -807,4 +811,9 @@ public BlobServices storageBlobServices() { public ManagementPolicies storageManagementPolicies() { return this.storageManager.managementPolicies(); } + + /** @return the spring service management API entry point */ + public SpringServices springServices() { + return this.appPlatformManager.springServices(); + } } diff --git a/sdk/management/pom.xml b/sdk/management/pom.xml index 676184d7d606..a290e23ca8e7 100644 --- a/sdk/management/pom.xml +++ b/sdk/management/pom.xml @@ -473,6 +473,7 @@ ./azure ../appservice/mgmt + ../appplatform/mgmt ../compute/mgmt ../dns/mgmt ../authorization/mgmt