net.bytebuddy
byte-buddy
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java
index ae04b849e8534..a481734e0d7be 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java
@@ -24,11 +24,25 @@
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.apicenter.fluent.AzureApiCenter;
+import com.azure.resourcemanager.apicenter.implementation.ApiDefinitionsImpl;
+import com.azure.resourcemanager.apicenter.implementation.ApiVersionsImpl;
+import com.azure.resourcemanager.apicenter.implementation.ApisImpl;
import com.azure.resourcemanager.apicenter.implementation.AzureApiCenterBuilder;
+import com.azure.resourcemanager.apicenter.implementation.DeploymentsImpl;
+import com.azure.resourcemanager.apicenter.implementation.EnvironmentsImpl;
+import com.azure.resourcemanager.apicenter.implementation.MetadataSchemasImpl;
import com.azure.resourcemanager.apicenter.implementation.OperationsImpl;
import com.azure.resourcemanager.apicenter.implementation.ServicesImpl;
+import com.azure.resourcemanager.apicenter.implementation.WorkspacesImpl;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitions;
+import com.azure.resourcemanager.apicenter.models.ApiVersions;
+import com.azure.resourcemanager.apicenter.models.Apis;
+import com.azure.resourcemanager.apicenter.models.Deployments;
+import com.azure.resourcemanager.apicenter.models.Environments;
+import com.azure.resourcemanager.apicenter.models.MetadataSchemas;
import com.azure.resourcemanager.apicenter.models.Operations;
import com.azure.resourcemanager.apicenter.models.Services;
+import com.azure.resourcemanager.apicenter.models.Workspaces;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
@@ -36,29 +50,42 @@
import java.util.Objects;
import java.util.stream.Collectors;
-/** Entry point to ApiCenterManager. Azure API Center Resource Provider. */
+/**
+ * Entry point to ApiCenterManager.
+ * Azure API Center Resource Provider.
+ */
public final class ApiCenterManager {
private Operations operations;
private Services services;
+ private MetadataSchemas metadataSchemas;
+
+ private Workspaces workspaces;
+
+ private Apis apis;
+
+ private Deployments deployments;
+
+ private ApiVersions apiVersions;
+
+ private ApiDefinitions apiDefinitions;
+
+ private Environments environments;
+
private final AzureApiCenter clientObject;
private ApiCenterManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
- this.clientObject =
- new AzureApiCenterBuilder()
- .pipeline(httpPipeline)
- .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
- .subscriptionId(profile.getSubscriptionId())
- .defaultPollInterval(defaultPollInterval)
- .buildClient();
+ this.clientObject = new AzureApiCenterBuilder().pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval).buildClient();
}
/**
* Creates an instance of ApiCenter service API entry point.
- *
+ *
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the ApiCenter service API instance.
@@ -71,7 +98,7 @@ public static ApiCenterManager authenticate(TokenCredential credential, AzurePro
/**
* Creates an instance of ApiCenter service API entry point.
- *
+ *
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the ApiCenter service API instance.
@@ -84,14 +111,16 @@ public static ApiCenterManager authenticate(HttpPipeline httpPipeline, AzureProf
/**
* Gets a Configurable instance that can be used to create ApiCenterManager with optional configuration.
- *
+ *
* @return the Configurable instance allowing configurations.
*/
public static Configurable configure() {
return new ApiCenterManager.Configurable();
}
- /** The Configurable allowing configurations to be set. */
+ /**
+ * The Configurable allowing configurations to be set.
+ */
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
@@ -163,8 +192,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
/**
* Sets the retry options for the HTTP pipeline retry policy.
- *
- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
@@ -181,8 +210,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval =
- Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ this.defaultPollInterval
+ = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
@@ -202,21 +231,12 @@ public ApiCenterManager authenticate(TokenCredential credential, AzureProfile pr
Objects.requireNonNull(profile, "'profile' cannot be null.");
StringBuilder userAgentBuilder = new StringBuilder();
- userAgentBuilder
- .append("azsdk-java")
- .append("-")
- .append("com.azure.resourcemanager.apicenter")
- .append("/")
- .append("1.0.0-beta.1");
+ userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.apicenter").append("/")
+ .append("1.0.0");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
- userAgentBuilder
- .append(" (")
- .append(Configuration.getGlobalConfiguration().get("java.version"))
- .append("; ")
- .append(Configuration.getGlobalConfiguration().get("os.name"))
- .append("; ")
- .append(Configuration.getGlobalConfiguration().get("os.version"))
- .append("; auto-generated)");
+ userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)");
} else {
userAgentBuilder.append(" (auto-generated)");
}
@@ -235,38 +255,25 @@ public ApiCenterManager authenticate(TokenCredential credential, AzureProfile pr
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
- policies
- .addAll(
- this
- .policies
- .stream()
- .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
- .collect(Collectors.toList()));
+ policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
- policies
- .addAll(
- this
- .policies
- .stream()
- .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
- .collect(Collectors.toList()));
+ policies.addAll(this.policies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
- HttpPipeline httpPipeline =
- new HttpPipelineBuilder()
- .httpClient(httpClient)
- .policies(policies.toArray(new HttpPipelinePolicy[0]))
- .build();
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0])).build();
return new ApiCenterManager(httpPipeline, profile, defaultPollInterval);
}
}
/**
* Gets the resource collection API of Operations.
- *
+ *
* @return Resource collection API of Operations.
*/
public Operations operations() {
@@ -278,7 +285,7 @@ public Operations operations() {
/**
* Gets the resource collection API of Services. It manages Service.
- *
+ *
* @return Resource collection API of Services.
*/
public Services services() {
@@ -288,10 +295,94 @@ public Services services() {
return services;
}
+ /**
+ * Gets the resource collection API of MetadataSchemas. It manages MetadataSchema.
+ *
+ * @return Resource collection API of MetadataSchemas.
+ */
+ public MetadataSchemas metadataSchemas() {
+ if (this.metadataSchemas == null) {
+ this.metadataSchemas = new MetadataSchemasImpl(clientObject.getMetadataSchemas(), this);
+ }
+ return metadataSchemas;
+ }
+
+ /**
+ * Gets the resource collection API of Workspaces. It manages Workspace.
+ *
+ * @return Resource collection API of Workspaces.
+ */
+ public Workspaces workspaces() {
+ if (this.workspaces == null) {
+ this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this);
+ }
+ return workspaces;
+ }
+
+ /**
+ * Gets the resource collection API of Apis. It manages Api.
+ *
+ * @return Resource collection API of Apis.
+ */
+ public Apis apis() {
+ if (this.apis == null) {
+ this.apis = new ApisImpl(clientObject.getApis(), this);
+ }
+ return apis;
+ }
+
+ /**
+ * Gets the resource collection API of Deployments. It manages Deployment.
+ *
+ * @return Resource collection API of Deployments.
+ */
+ public Deployments deployments() {
+ if (this.deployments == null) {
+ this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this);
+ }
+ return deployments;
+ }
+
+ /**
+ * Gets the resource collection API of ApiVersions. It manages ApiVersion.
+ *
+ * @return Resource collection API of ApiVersions.
+ */
+ public ApiVersions apiVersions() {
+ if (this.apiVersions == null) {
+ this.apiVersions = new ApiVersionsImpl(clientObject.getApiVersions(), this);
+ }
+ return apiVersions;
+ }
+
+ /**
+ * Gets the resource collection API of ApiDefinitions. It manages ApiDefinition.
+ *
+ * @return Resource collection API of ApiDefinitions.
+ */
+ public ApiDefinitions apiDefinitions() {
+ if (this.apiDefinitions == null) {
+ this.apiDefinitions = new ApiDefinitionsImpl(clientObject.getApiDefinitions(), this);
+ }
+ return apiDefinitions;
+ }
+
+ /**
+ * Gets the resource collection API of Environments. It manages Environment.
+ *
+ * @return Resource collection API of Environments.
+ */
+ public Environments environments() {
+ if (this.environments == null) {
+ this.environments = new EnvironmentsImpl(clientObject.getEnvironments(), this);
+ }
+ return environments;
+ }
+
/**
* Gets wrapped service client AzureApiCenter providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
- *
+ *
* @return Wrapped service client AzureApiCenter.
*/
public AzureApiCenter serviceClient() {
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiDefinitionsClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiDefinitionsClient.java
new file mode 100644
index 0000000000000..36f533579fb72
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiDefinitionsClient.java
@@ -0,0 +1,361 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiDefinitionInner;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiSpecExportResultInner;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionsGetResponse;
+import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequest;
+
+/**
+ * An instance of this class provides access to all the operations defined in ApiDefinitionsClient.
+ */
+public interface ApiDefinitionsClient {
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a ApiDefinition list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName);
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a ApiDefinition list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String filter, Context context);
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiDefinitionsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context);
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiDefinitionInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName);
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiDefinitionsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiDefinitionInner resource,
+ Context context);
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiDefinitionInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, ApiDefinitionInner resource);
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context);
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName);
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, Context context);
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName);
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApiSpecExportResultInner> beginExportSpecification(
+ String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName);
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ApiSpecExportResultInner> beginExportSpecification(
+ String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName, Context context);
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiSpecExportResultInner exportSpecification(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName);
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiSpecExportResultInner exportSpecification(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context);
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginImportSpecification(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiSpecImportRequest body);
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginImportSpecification(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiSpecImportRequest body,
+ Context context);
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void importSpecification(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, ApiSpecImportRequest body);
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void importSpecification(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, ApiSpecImportRequest body, Context context);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiVersionsClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiVersionsClient.java
new file mode 100644
index 0000000000000..42a060f893343
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiVersionsClient.java
@@ -0,0 +1,191 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiVersionInner;
+import com.azure.resourcemanager.apicenter.models.ApiVersionsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.ApiVersionsGetResponse;
+
+/**
+ * An instance of this class provides access to all the operations defined in ApiVersionsClient.
+ */
+public interface ApiVersionsClient {
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a ApiVersion list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName);
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a ApiVersion list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context);
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiVersionsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context);
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiVersionInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName);
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiVersionsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, ApiVersionInner resource, Context context);
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiVersionInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, ApiVersionInner resource);
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context);
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName);
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, Context context);
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApisClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApisClient.java
new file mode 100644
index 0000000000000..0088bbc0299ed
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApisClient.java
@@ -0,0 +1,179 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiInner;
+import com.azure.resourcemanager.apicenter.models.ApisCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.ApisGetResponse;
+
+/**
+ * An instance of this class provides access to all the operations defined in ApisClient.
+ */
+public interface ApisClient {
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Api list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName);
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a Api list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName, String filter,
+ Context context);
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApisGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ Context context);
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName);
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApisCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, ApiInner resource, Context context);
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ApiInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ ApiInner resource);
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context);
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName);
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ Context context);
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String workspaceName, String apiName);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java
index 7f3105526efa5..cf61cbe99d7cf 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java
@@ -7,54 +7,105 @@
import com.azure.core.http.HttpPipeline;
import java.time.Duration;
-/** The interface for AzureApiCenter class. */
+/**
+ * The interface for AzureApiCenter class.
+ */
public interface AzureApiCenter {
/**
- * Gets The ID of the target subscription.
- *
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
* @return the subscriptionId value.
*/
String getSubscriptionId();
/**
* Gets server parameter.
- *
+ *
* @return the endpoint value.
*/
String getEndpoint();
/**
* Gets Api Version.
- *
+ *
* @return the apiVersion value.
*/
String getApiVersion();
/**
* Gets The HTTP pipeline to send requests through.
- *
+ *
* @return the httpPipeline value.
*/
HttpPipeline getHttpPipeline();
/**
* Gets The default poll interval for long-running operation.
- *
+ *
* @return the defaultPollInterval value.
*/
Duration getDefaultPollInterval();
/**
* Gets the OperationsClient object to access its operations.
- *
+ *
* @return the OperationsClient object.
*/
OperationsClient getOperations();
/**
* Gets the ServicesClient object to access its operations.
- *
+ *
* @return the ServicesClient object.
*/
ServicesClient getServices();
+
+ /**
+ * Gets the MetadataSchemasClient object to access its operations.
+ *
+ * @return the MetadataSchemasClient object.
+ */
+ MetadataSchemasClient getMetadataSchemas();
+
+ /**
+ * Gets the WorkspacesClient object to access its operations.
+ *
+ * @return the WorkspacesClient object.
+ */
+ WorkspacesClient getWorkspaces();
+
+ /**
+ * Gets the ApisClient object to access its operations.
+ *
+ * @return the ApisClient object.
+ */
+ ApisClient getApis();
+
+ /**
+ * Gets the DeploymentsClient object to access its operations.
+ *
+ * @return the DeploymentsClient object.
+ */
+ DeploymentsClient getDeployments();
+
+ /**
+ * Gets the ApiVersionsClient object to access its operations.
+ *
+ * @return the ApiVersionsClient object.
+ */
+ ApiVersionsClient getApiVersions();
+
+ /**
+ * Gets the ApiDefinitionsClient object to access its operations.
+ *
+ * @return the ApiDefinitionsClient object.
+ */
+ ApiDefinitionsClient getApiDefinitions();
+
+ /**
+ * Gets the EnvironmentsClient object to access its operations.
+ *
+ * @return the EnvironmentsClient object.
+ */
+ EnvironmentsClient getEnvironments();
}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/DeploymentsClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/DeploymentsClient.java
new file mode 100644
index 0000000000000..3072c2f0a18d0
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/DeploymentsClient.java
@@ -0,0 +1,193 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.DeploymentInner;
+import com.azure.resourcemanager.apicenter.models.DeploymentsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.DeploymentsGetResponse;
+
+/**
+ * An instance of this class provides access to all the operations defined in DeploymentsClient.
+ */
+public interface DeploymentsClient {
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a Deployment list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName);
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a Deployment list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context);
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DeploymentsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context);
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DeploymentInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName);
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DeploymentsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String deploymentName, DeploymentInner resource, Context context);
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DeploymentInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName, DeploymentInner resource);
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context);
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName);
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName, Context context);
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/EnvironmentsClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/EnvironmentsClient.java
new file mode 100644
index 0000000000000..121bd28a18071
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/EnvironmentsClient.java
@@ -0,0 +1,179 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.EnvironmentInner;
+import com.azure.resourcemanager.apicenter.models.EnvironmentsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.EnvironmentsGetResponse;
+
+/**
+ * An instance of this class provides access to all the operations defined in EnvironmentsClient.
+ */
+public interface EnvironmentsClient {
+ /**
+ * Returns a collection of environments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Environment list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName);
+
+ /**
+ * Returns a collection of environments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a Environment list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String filter, Context context);
+
+ /**
+ * Returns details of the environment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return environment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EnvironmentsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String environmentName, Context context);
+
+ /**
+ * Returns details of the environment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return environment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EnvironmentInner get(String resourceGroupName, String serviceName, String workspaceName, String environmentName);
+
+ /**
+ * Creates new or updates existing environment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return environment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EnvironmentsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String environmentName, EnvironmentInner resource, Context context);
+
+ /**
+ * Creates new or updates existing environment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return environment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EnvironmentInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName,
+ String environmentName, EnvironmentInner resource);
+
+ /**
+ * Deletes the environment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String environmentName, Context context);
+
+ /**
+ * Deletes the environment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String workspaceName, String environmentName);
+
+ /**
+ * Checks if specified environment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String environmentName, Context context);
+
+ /**
+ * Checks if specified environment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param environmentName The name of the environment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String workspaceName, String environmentName);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/MetadataSchemasClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/MetadataSchemasClient.java
new file mode 100644
index 0000000000000..2525a3851db02
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/MetadataSchemasClient.java
@@ -0,0 +1,169 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.MetadataSchemaInner;
+import com.azure.resourcemanager.apicenter.models.MetadataSchemasCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.MetadataSchemasGetResponse;
+
+/**
+ * An instance of this class provides access to all the operations defined in MetadataSchemasClient.
+ */
+public interface MetadataSchemasClient {
+ /**
+ * Returns a collection of metadata schemas.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a MetadataSchema list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName);
+
+ /**
+ * Returns a collection of metadata schemas.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a MetadataSchema list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String filter,
+ Context context);
+
+ /**
+ * Returns details of the metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metadata schema entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetadataSchemasGetResponse getWithResponse(String resourceGroupName, String serviceName, String metadataSchemaName,
+ Context context);
+
+ /**
+ * Returns details of the metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metadata schema entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetadataSchemaInner get(String resourceGroupName, String serviceName, String metadataSchemaName);
+
+ /**
+ * Creates new or updates existing metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metadata schema entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetadataSchemasCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String metadataSchemaName, MetadataSchemaInner resource, Context context);
+
+ /**
+ * Creates new or updates existing metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metadata schema entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetadataSchemaInner createOrUpdate(String resourceGroupName, String serviceName, String metadataSchemaName,
+ MetadataSchemaInner resource);
+
+ /**
+ * Deletes specified metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String metadataSchemaName,
+ Context context);
+
+ /**
+ * Deletes specified metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String metadataSchemaName);
+
+ /**
+ * Checks if specified metadata schema exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String metadataSchemaName,
+ Context context);
+
+ /**
+ * Checks if specified metadata schema exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param metadataSchemaName The name of the metadata schema.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String metadataSchemaName);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/OperationsClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/OperationsClient.java
index 902461a5dad42..989013175b1b1 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/OperationsClient.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/OperationsClient.java
@@ -10,28 +10,30 @@
import com.azure.core.util.Context;
import com.azure.resourcemanager.apicenter.fluent.models.OperationInner;
-/** An instance of this class provides access to all the operations defined in OperationsClient. */
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
public interface OperationsClient {
/**
* List the operations for the provider.
- *
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedIterable}.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
/**
* List the operations for the provider.
- *
+ *
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedIterable}.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ServicesClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ServicesClient.java
index db5e2f5e31006..feb8a8f2dca34 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ServicesClient.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ServicesClient.java
@@ -8,15 +8,21 @@
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.apicenter.fluent.models.MetadataSchemaExportResultInner;
import com.azure.resourcemanager.apicenter.fluent.models.ServiceInner;
+import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportRequest;
import com.azure.resourcemanager.apicenter.models.ServiceUpdate;
-/** An instance of this class provides access to all the operations defined in ServicesClient. */
+/**
+ * An instance of this class provides access to all the operations defined in ServicesClient.
+ */
public interface ServicesClient {
/**
* Lists services within an Azure subscription.
- *
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a Service list operation as paginated response with {@link PagedIterable}.
@@ -26,7 +32,7 @@ public interface ServicesClient {
/**
* Lists services within an Azure subscription.
- *
+ *
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -37,8 +43,8 @@ public interface ServicesClient {
PagedIterable list(Context context);
/**
- * Lists services within a resource group.
- *
+ * Returns a collection of services within the resource group.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -49,8 +55,8 @@ public interface ServicesClient {
PagedIterable listByResourceGroup(String resourceGroupName);
/**
- * Lists services within a resource group.
- *
+ * Returns a collection of services within the resource group.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -62,39 +68,39 @@ public interface ServicesClient {
PagedIterable listByResourceGroup(String resourceGroupName, Context context);
/**
- * Get service.
- *
+ * Returns details of the service.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
+ * @param serviceName The name of Azure API Center service.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.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 along with {@link Response}.
+ * @return the service entity along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response getByResourceGroupWithResponse(
- String resourceGroupName, String serviceName, Context context);
+ Response getByResourceGroupWithResponse(String resourceGroupName, String serviceName,
+ Context context);
/**
- * Get service.
- *
+ * Returns details of the service.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
+ * @param serviceName The name of Azure API Center service.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.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.
+ * @return the service entity.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
ServiceInner getByResourceGroup(String resourceGroupName, String serviceName);
/**
- * Create or update service.
- *
+ * Creates new or updates existing API.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
- * @param resource The service entity.
+ * @param serviceName The name of Azure API Center service.
+ * @param resource Resource create parameters.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -102,28 +108,29 @@ Response getByResourceGroupWithResponse(
* @return the service entity along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response createOrUpdateWithResponse(
- String resourceGroupName, String serviceName, ServiceInner resource, Context context);
+ Response createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ ServiceInner resource, Context context);
/**
- * Create or update service.
- *
+ * Creates new or updates existing API.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
+ * @param serviceName The name of Azure API Center service.
+ * @param resource Resource create parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the service entity.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- ServiceInner createOrUpdate(String resourceGroupName, String serviceName);
+ ServiceInner createOrUpdate(String resourceGroupName, String serviceName, ServiceInner resource);
/**
- * Update service.
- *
+ * Updates existing service.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
- * @param parameters The service properties to be updated.
+ * @param serviceName The name of Azure API Center service.
+ * @param properties The resource properties to be updated.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -131,27 +138,28 @@ Response createOrUpdateWithResponse(
* @return the service entity along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response updateWithResponse(
- String resourceGroupName, String serviceName, ServiceUpdate parameters, Context context);
+ Response updateWithResponse(String resourceGroupName, String serviceName, ServiceUpdate properties,
+ Context context);
/**
- * Update service.
- *
+ * Updates existing service.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
+ * @param serviceName The name of Azure API Center service.
+ * @param properties The resource properties to be updated.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the service entity.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- ServiceInner update(String resourceGroupName, String serviceName);
+ ServiceInner update(String resourceGroupName, String serviceName, ServiceUpdate properties);
/**
- * Delete service.
- *
+ * Deletes specified service.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
+ * @param serviceName The name of Azure API Center service.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -162,14 +170,76 @@ Response updateWithResponse(
Response deleteWithResponse(String resourceGroupName, String serviceName, Context context);
/**
- * Delete service.
- *
+ * Deletes specified service.
+ *
* @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param serviceName Service name.
+ * @param serviceName The name of Azure API Center service.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String resourceGroupName, String serviceName);
+
+ /**
+ * Exports the effective metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the metadata schema export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MetadataSchemaExportResultInner>
+ beginExportMetadataSchema(String resourceGroupName, String serviceName, MetadataSchemaExportRequest body);
+
+ /**
+ * Exports the effective metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the metadata schema export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MetadataSchemaExportResultInner> beginExportMetadataSchema(
+ String resourceGroupName, String serviceName, MetadataSchemaExportRequest body, Context context);
+
+ /**
+ * Exports the effective metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the metadata schema export result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetadataSchemaExportResultInner exportMetadataSchema(String resourceGroupName, String serviceName,
+ MetadataSchemaExportRequest body);
+
+ /**
+ * Exports the effective metadata schema.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the metadata schema export result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetadataSchemaExportResultInner exportMetadataSchema(String resourceGroupName, String serviceName,
+ MetadataSchemaExportRequest body, Context context);
}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/WorkspacesClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/WorkspacesClient.java
new file mode 100644
index 0000000000000..7804c5c215861
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/WorkspacesClient.java
@@ -0,0 +1,168 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.WorkspaceInner;
+import com.azure.resourcemanager.apicenter.models.WorkspacesCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.WorkspacesGetResponse;
+
+/**
+ * An instance of this class provides access to all the operations defined in WorkspacesClient.
+ */
+public interface WorkspacesClient {
+ /**
+ * Returns a collection of workspaces.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a Workspace list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName);
+
+ /**
+ * Returns a collection of workspaces.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param filter OData filter parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException 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 of a Workspace list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String serviceName, String filter, Context context);
+
+ /**
+ * Returns details of the workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return workspace entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkspacesGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ Context context);
+
+ /**
+ * Returns details of the workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return workspace entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkspaceInner get(String resourceGroupName, String serviceName, String workspaceName);
+
+ /**
+ * Creates new or updates existing workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return workspace entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkspacesCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, WorkspaceInner resource, Context context);
+
+ /**
+ * Creates new or updates existing workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return workspace entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkspaceInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName,
+ WorkspaceInner resource);
+
+ /**
+ * Deletes specified workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ Context context);
+
+ /**
+ * Deletes specified workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String serviceName, String workspaceName);
+
+ /**
+ * Checks if specified workspace exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ Context context);
+
+ /**
+ * Checks if specified workspace exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void head(String resourceGroupName, String serviceName, String workspaceName);
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiDefinitionInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiDefinitionInner.java
new file mode 100644
index 0000000000000..ccedf7e7ced9d
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiDefinitionInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * API definition entity.
+ */
+@Fluent
+public final class ApiDefinitionInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private ApiDefinitionProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of ApiDefinitionInner class.
+ */
+ public ApiDefinitionInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public ApiDefinitionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ApiDefinitionInner object itself.
+ */
+ public ApiDefinitionInner withProperties(ApiDefinitionProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiInner.java
new file mode 100644
index 0000000000000..881f13910ca9e
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.ApiProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * API entity.
+ */
+@Fluent
+public final class ApiInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private ApiProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of ApiInner class.
+ */
+ public ApiInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public ApiProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ApiInner object itself.
+ */
+ public ApiInner withProperties(ApiProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiSpecExportResultInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiSpecExportResultInner.java
new file mode 100644
index 0000000000000..406821d4e5d8c
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiSpecExportResultInner.java
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.apicenter.models.ApiSpecExportResultFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The API specification export result.
+ */
+@Fluent
+public final class ApiSpecExportResultInner {
+ /*
+ * The format of exported result
+ */
+ @JsonProperty(value = "format")
+ private ApiSpecExportResultFormat format;
+
+ /*
+ * The result of the export operation.
+ */
+ @JsonProperty(value = "value")
+ private String value;
+
+ /**
+ * Creates an instance of ApiSpecExportResultInner class.
+ */
+ public ApiSpecExportResultInner() {
+ }
+
+ /**
+ * Get the format property: The format of exported result.
+ *
+ * @return the format value.
+ */
+ public ApiSpecExportResultFormat format() {
+ return this.format;
+ }
+
+ /**
+ * Set the format property: The format of exported result.
+ *
+ * @param format the format value to set.
+ * @return the ApiSpecExportResultInner object itself.
+ */
+ public ApiSpecExportResultInner withFormat(ApiSpecExportResultFormat format) {
+ this.format = format;
+ return this;
+ }
+
+ /**
+ * Get the value property: The result of the export operation.
+ *
+ * @return the value value.
+ */
+ public String value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: The result of the export operation.
+ *
+ * @param value the value value to set.
+ * @return the ApiSpecExportResultInner object itself.
+ */
+ public ApiSpecExportResultInner 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/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiVersionInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiVersionInner.java
new file mode 100644
index 0000000000000..9ac2ea192d34e
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiVersionInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.ApiVersionProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * API version entity.
+ */
+@Fluent
+public final class ApiVersionInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private ApiVersionProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of ApiVersionInner class.
+ */
+ public ApiVersionInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public ApiVersionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ApiVersionInner object itself.
+ */
+ public ApiVersionInner withProperties(ApiVersionProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/DeploymentInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/DeploymentInner.java
new file mode 100644
index 0000000000000..53484849b0e6b
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/DeploymentInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.DeploymentProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * API deployment entity.
+ */
+@Fluent
+public final class DeploymentInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private DeploymentProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of DeploymentInner class.
+ */
+ public DeploymentInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public DeploymentProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the DeploymentInner object itself.
+ */
+ public DeploymentInner withProperties(DeploymentProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/EnvironmentInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/EnvironmentInner.java
new file mode 100644
index 0000000000000..c5110f1e2147f
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/EnvironmentInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.EnvironmentProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Environment entity.
+ */
+@Fluent
+public final class EnvironmentInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private EnvironmentProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of EnvironmentInner class.
+ */
+ public EnvironmentInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public EnvironmentProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the EnvironmentInner object itself.
+ */
+ public EnvironmentInner withProperties(EnvironmentProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/MetadataSchemaExportResultInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/MetadataSchemaExportResultInner.java
new file mode 100644
index 0000000000000..1e6627912cbf6
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/MetadataSchemaExportResultInner.java
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The metadata schema export result.
+ */
+@Fluent
+public final class MetadataSchemaExportResultInner {
+ /*
+ * The export format for the schema
+ */
+ @JsonProperty(value = "format")
+ private MetadataSchemaExportFormat format;
+
+ /*
+ * The result of the export operation.
+ */
+ @JsonProperty(value = "value")
+ private String value;
+
+ /**
+ * Creates an instance of MetadataSchemaExportResultInner class.
+ */
+ public MetadataSchemaExportResultInner() {
+ }
+
+ /**
+ * Get the format property: The export format for the schema.
+ *
+ * @return the format value.
+ */
+ public MetadataSchemaExportFormat format() {
+ return this.format;
+ }
+
+ /**
+ * Set the format property: The export format for the schema.
+ *
+ * @param format the format value to set.
+ * @return the MetadataSchemaExportResultInner object itself.
+ */
+ public MetadataSchemaExportResultInner withFormat(MetadataSchemaExportFormat format) {
+ this.format = format;
+ return this;
+ }
+
+ /**
+ * Get the value property: The result of the export operation.
+ *
+ * @return the value value.
+ */
+ public String value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: The result of the export operation.
+ *
+ * @param value the value value to set.
+ * @return the MetadataSchemaExportResultInner object itself.
+ */
+ public MetadataSchemaExportResultInner 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/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/MetadataSchemaInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/MetadataSchemaInner.java
new file mode 100644
index 0000000000000..384bddb2697ab
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/MetadataSchemaInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.MetadataSchemaProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Metadata schema entity. Used to define metadata for the entities in API catalog.
+ */
+@Fluent
+public final class MetadataSchemaInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private MetadataSchemaProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of MetadataSchemaInner class.
+ */
+ public MetadataSchemaInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public MetadataSchemaProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the MetadataSchemaInner object itself.
+ */
+ public MetadataSchemaInner withProperties(MetadataSchemaProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/OperationInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/OperationInner.java
index 423f2d203426e..a2940ca607fed 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/OperationInner.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/OperationInner.java
@@ -12,8 +12,8 @@
/**
* REST API Operation
- *
- * Details of a REST API operation, returned from the Resource Provider Operations API.
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
*/
@Fluent
public final class OperationInner {
@@ -50,14 +50,16 @@ public final class OperationInner {
@JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY)
private ActionType actionType;
- /** Creates an instance of OperationInner class. */
+ /**
+ * Creates an instance of OperationInner class.
+ */
public OperationInner() {
}
/**
* Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
* "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
- *
+ *
* @return the name value.
*/
public String name() {
@@ -67,7 +69,7 @@ public String name() {
/**
* Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
* operations and "false" for ARM/control-plane operations.
- *
+ *
* @return the isDataAction value.
*/
public Boolean isDataAction() {
@@ -76,7 +78,7 @@ public Boolean isDataAction() {
/**
* Get the display property: Localized display information for this particular operation.
- *
+ *
* @return the display value.
*/
public OperationDisplay display() {
@@ -85,7 +87,7 @@ public OperationDisplay display() {
/**
* Set the display property: Localized display information for this particular operation.
- *
+ *
* @param display the display value to set.
* @return the OperationInner object itself.
*/
@@ -97,7 +99,7 @@ public OperationInner withDisplay(OperationDisplay display) {
/**
* Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
* audit logs UX. Default value is "user,system".
- *
+ *
* @return the origin value.
*/
public Origin origin() {
@@ -107,7 +109,7 @@ public Origin origin() {
/**
* Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
* only APIs.
- *
+ *
* @return the actionType value.
*/
public ActionType actionType() {
@@ -116,7 +118,7 @@ public ActionType actionType() {
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ServiceInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ServiceInner.java
index 7e7ca4c0ac3df..3e05eccabec8b 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ServiceInner.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ServiceInner.java
@@ -8,21 +8,23 @@
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentity;
-import com.azure.resourcemanager.apicenter.models.ProvisioningState;
+import com.azure.resourcemanager.apicenter.models.ServiceProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
-/** The service entity. */
+/**
+ * The service entity.
+ */
@Fluent
public final class ServiceInner extends Resource {
/*
- * The properties of the service.
+ * The resource-specific properties for this resource.
*/
@JsonProperty(value = "properties")
- private ServiceProperties innerProperties;
+ private ServiceProperties properties;
/*
- * The identity of the service.
+ * The managed service identities assigned to this resource.
*/
@JsonProperty(value = "identity")
private ManagedServiceIdentity identity;
@@ -33,22 +35,35 @@ public final class ServiceInner extends Resource {
@JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;
- /** Creates an instance of ServiceInner class. */
+ /**
+ * Creates an instance of ServiceInner class.
+ */
public ServiceInner() {
}
/**
- * Get the innerProperties property: The properties of the service.
- *
- * @return the innerProperties value.
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public ServiceProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ServiceInner object itself.
*/
- private ServiceProperties innerProperties() {
- return this.innerProperties;
+ public ServiceInner withProperties(ServiceProperties properties) {
+ this.properties = properties;
+ return this;
}
/**
- * Get the identity property: The identity of the service.
- *
+ * Get the identity property: The managed service identities assigned to this resource.
+ *
* @return the identity value.
*/
public ManagedServiceIdentity identity() {
@@ -56,8 +71,8 @@ public ManagedServiceIdentity identity() {
}
/**
- * Set the identity property: The identity of the service.
- *
+ * Set the identity property: The managed service identities assigned to this resource.
+ *
* @param identity the identity value to set.
* @return the ServiceInner object itself.
*/
@@ -68,44 +83,39 @@ public ServiceInner withIdentity(ManagedServiceIdentity identity) {
/**
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
- *
+ *
* @return the systemData value.
*/
public SystemData systemData() {
return this.systemData;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@Override
public ServiceInner withLocation(String location) {
super.withLocation(location);
return this;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@Override
public ServiceInner withTags(Map tags) {
super.withTags(tags);
return this;
}
- /**
- * Get the provisioningState property: The status of the last operation.
- *
- * @return the provisioningState value.
- */
- public ProvisioningState provisioningState() {
- return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
- }
-
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
- if (innerProperties() != null) {
- innerProperties().validate();
+ if (properties() != null) {
+ properties().validate();
}
if (identity() != null) {
identity().validate();
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/WorkspaceInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/WorkspaceInner.java
new file mode 100644
index 0000000000000..f49bf28e8e43a
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/WorkspaceInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.apicenter.models.WorkspaceProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Workspace entity.
+ */
+@Fluent
+public final class WorkspaceInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private WorkspaceProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of WorkspaceInner class.
+ */
+ public WorkspaceInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public WorkspaceProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the WorkspaceInner object itself.
+ */
+ public WorkspaceInner withProperties(WorkspaceProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/package-info.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/package-info.java
index 3a0ef29d83369..0435c3e8d2125 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/package-info.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/package-info.java
@@ -2,5 +2,8 @@
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
-/** Package containing the inner data models for AzureApiCenter. Azure API Center Resource Provider. */
+/**
+ * Package containing the inner data models for AzureApiCenter.
+ * Azure API Center Resource Provider.
+ */
package com.azure.resourcemanager.apicenter.fluent.models;
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/package-info.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/package-info.java
index 1aa2615ea9496..5eba4426c44a7 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/package-info.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/package-info.java
@@ -2,5 +2,8 @@
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
-/** Package containing the service clients for AzureApiCenter. Azure API Center Resource Provider. */
+/**
+ * Package containing the service clients for AzureApiCenter.
+ * Azure API Center Resource Provider.
+ */
package com.azure.resourcemanager.apicenter.fluent;
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionImpl.java
new file mode 100644
index 0000000000000..5d1c5d3b3a9e9
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionImpl.java
@@ -0,0 +1,164 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiDefinitionInner;
+import com.azure.resourcemanager.apicenter.models.ApiDefinition;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionProperties;
+import com.azure.resourcemanager.apicenter.models.ApiSpecExportResult;
+import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequest;
+
+public final class ApiDefinitionImpl implements ApiDefinition, ApiDefinition.Definition, ApiDefinition.Update {
+ private ApiDefinitionInner innerObject;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public ApiDefinitionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public ApiDefinitionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String serviceName;
+
+ private String workspaceName;
+
+ private String apiName;
+
+ private String versionName;
+
+ private String definitionName;
+
+ public ApiDefinitionImpl withExistingVersion(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName) {
+ this.resourceGroupName = resourceGroupName;
+ this.serviceName = serviceName;
+ this.workspaceName = workspaceName;
+ this.apiName = apiName;
+ this.versionName = versionName;
+ return this;
+ }
+
+ public ApiDefinition create() {
+ this.innerObject = serviceManager.serviceClient().getApiDefinitions()
+ .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ApiDefinition create(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApiDefinitions()
+ .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ ApiDefinitionImpl(String name, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = new ApiDefinitionInner();
+ this.serviceManager = serviceManager;
+ this.definitionName = name;
+ }
+
+ public ApiDefinitionImpl update() {
+ return this;
+ }
+
+ public ApiDefinition apply() {
+ this.innerObject = serviceManager.serviceClient().getApiDefinitions()
+ .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ApiDefinition apply(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApiDefinitions()
+ .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ ApiDefinitionImpl(ApiDefinitionInner innerObject,
+ com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.serviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "services");
+ this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces");
+ this.apiName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apis");
+ this.versionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions");
+ this.definitionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "definitions");
+ }
+
+ public ApiDefinition refresh() {
+ this.innerObject = serviceManager.serviceClient().getApiDefinitions().getWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, versionName, definitionName, Context.NONE).getValue();
+ return this;
+ }
+
+ public ApiDefinition refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApiDefinitions().getWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, versionName, definitionName, context).getValue();
+ return this;
+ }
+
+ public ApiSpecExportResult exportSpecification() {
+ return serviceManager.apiDefinitions().exportSpecification(resourceGroupName, serviceName, workspaceName,
+ apiName, versionName, definitionName);
+ }
+
+ public ApiSpecExportResult exportSpecification(Context context) {
+ return serviceManager.apiDefinitions().exportSpecification(resourceGroupName, serviceName, workspaceName,
+ apiName, versionName, definitionName, context);
+ }
+
+ public void importSpecification(ApiSpecImportRequest body) {
+ serviceManager.apiDefinitions().importSpecification(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, definitionName, body);
+ }
+
+ public void importSpecification(ApiSpecImportRequest body, Context context) {
+ serviceManager.apiDefinitions().importSpecification(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, definitionName, body, context);
+ }
+
+ public ApiDefinitionImpl withProperties(ApiDefinitionProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionsClientImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionsClientImpl.java
new file mode 100644
index 0000000000000..3f8e857fa15d9
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionsClientImpl.java
@@ -0,0 +1,1711 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.Head;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.apicenter.fluent.ApiDefinitionsClient;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiDefinitionInner;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiSpecExportResultInner;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionListResult;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionsGetResponse;
+import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequest;
+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 ApiDefinitionsClient.
+ */
+public final class ApiDefinitionsClientImpl implements ApiDefinitionsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ApiDefinitionsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AzureApiCenterImpl client;
+
+ /**
+ * Initializes an instance of ApiDefinitionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ApiDefinitionsClientImpl(AzureApiCenterImpl client) {
+ this.service
+ = RestProxy.create(ApiDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureApiCenterApiDefinitions to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureApiCenterApiDef")
+ public interface ApiDefinitionsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @PathParam("definitionName") String definitionName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @PathParam("definitionName") String definitionName,
+ @BodyParam("application/json") ApiDefinitionInner resource, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @PathParam("definitionName") String definitionName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Head("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> head(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
+ @PathParam("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @PathParam("definitionName") String definitionName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}/exportSpecification")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> exportSpecification(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
+ @PathParam("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @PathParam("definitionName") String definitionName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}/importSpecification")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> importSpecification(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
+ @PathParam("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @PathParam("definitionName") String definitionName,
+ @BodyParam("application/json") ApiSpecImportRequest body, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param filter OData filter 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 of a ApiDefinition list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ filter, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param filter OData filter 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 of a ApiDefinition list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, filter, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param filter OData filter 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 of a ApiDefinition list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String filter) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 of a ApiDefinition list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName) {
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param filter OData filter 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 of a ApiDefinition list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String filter, Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 of a ApiDefinition list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName) {
+ final String filter = null;
+ return new PagedIterable<>(
+ listAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, filter));
+ }
+
+ /**
+ * Returns a collection of API definitions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param filter OData filter 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 of a ApiDefinition list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String filter, Context context) {
+ return new PagedIterable<>(
+ listAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, filter, context));
+ }
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName, accept, context);
+ }
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiDefinitionsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ context).block();
+ }
+
+ /**
+ * Returns details of the API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiDefinitionInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ return getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ Context.NONE).getValue();
+ }
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ ApiDefinitionInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName 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();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ ApiDefinitionInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName 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();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, resource, accept, context);
+ }
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiDefinitionInner resource) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, resource).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiDefinitionsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiDefinitionInner resource,
+ Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, resource, context).block();
+ }
+
+ /**
+ * Creates new or updates existing API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI definition entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiDefinitionInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, ApiDefinitionInner resource) {
+ return createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, resource, Context.NONE).getValue();
+ }
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName, accept, context);
+ }
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, context).block();
+ }
+
+ /**
+ * Deletes specified API definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ Context.NONE);
+ }
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.head(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.head(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName, accept, context);
+ }
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono headAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, context).block();
+ }
+
+ /**
+ * Checks if specified API definition exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ headWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ Context.NONE);
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> exportSpecificationWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.exportSpecification(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> exportSpecificationWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.exportSpecification(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, accept, context);
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ApiSpecExportResultInner> beginExportSpecificationAsync(
+ String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName) {
+ Mono>> mono = exportSpecificationWithResponseAsync(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), ApiSpecExportResultInner.class, ApiSpecExportResultInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ApiSpecExportResultInner> beginExportSpecificationAsync(
+ String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = exportSpecificationWithResponseAsync(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName, context);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), ApiSpecExportResultInner.class, ApiSpecExportResultInner.class, context);
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ApiSpecExportResultInner> beginExportSpecification(
+ String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName) {
+ return this.beginExportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName).getSyncPoller();
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ApiSpecExportResultInner> beginExportSpecification(
+ String resourceGroupName, String serviceName, String workspaceName, String apiName, String versionName,
+ String definitionName, Context context) {
+ return this.beginExportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, context).getSyncPoller();
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono exportSpecificationAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName) {
+ return beginExportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono exportSpecificationAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, Context context) {
+ return beginExportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, context).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiSpecExportResultInner exportSpecification(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName) {
+ return exportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName).block();
+ }
+
+ /**
+ * Exports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the API specification export result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiSpecExportResultInner exportSpecification(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, Context context) {
+ return exportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, context).block();
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> importSpecificationWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ ApiSpecImportRequest body) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.importSpecification(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> importSpecificationWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ ApiSpecImportRequest body, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ if (definitionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter definitionName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.importSpecification(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body, accept, context);
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginImportSpecificationAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ ApiSpecImportRequest body) {
+ Mono>> mono = importSpecificationWithResponseAsync(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginImportSpecificationAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, String definitionName,
+ ApiSpecImportRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = importSpecificationWithResponseAsync(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName, body, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginImportSpecification(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiSpecImportRequest body) {
+ return this.beginImportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body).getSyncPoller();
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginImportSpecification(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, String definitionName, ApiSpecImportRequest body,
+ Context context) {
+ return this.beginImportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body, context).getSyncPoller();
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono importSpecificationAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, ApiSpecImportRequest body) {
+ return beginImportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono importSpecificationAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, ApiSpecImportRequest body, Context context) {
+ return beginImportSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body, context).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void importSpecification(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, ApiSpecImportRequest body) {
+ importSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ body).block();
+ }
+
+ /**
+ * Imports the API specification.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param definitionName The name of the API definition.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void importSpecification(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, ApiSpecImportRequest body, Context context) {
+ importSpecificationAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ body, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a ApiDefinition list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a ApiDefinition list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionsImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionsImpl.java
new file mode 100644
index 0000000000000..74ebca1107d27
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiDefinitionsImpl.java
@@ -0,0 +1,279 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.apicenter.fluent.ApiDefinitionsClient;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiDefinitionInner;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiSpecExportResultInner;
+import com.azure.resourcemanager.apicenter.models.ApiDefinition;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitions;
+import com.azure.resourcemanager.apicenter.models.ApiDefinitionsGetResponse;
+import com.azure.resourcemanager.apicenter.models.ApiSpecExportResult;
+import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequest;
+
+public final class ApiDefinitionsImpl implements ApiDefinitions {
+ private static final ClientLogger LOGGER = new ClientLogger(ApiDefinitionsImpl.class);
+
+ private final ApiDefinitionsClient innerClient;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public ApiDefinitionsImpl(ApiDefinitionsClient innerClient,
+ com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName) {
+ PagedIterable inner
+ = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, apiName, versionName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String filter, Context context) {
+ PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, filter, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiDefinitionImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ ApiDefinitionsGetResponse inner = this.serviceClient().getWithResponse(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ApiDefinitionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ApiDefinition get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ ApiDefinitionInner inner = this.serviceClient().get(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, definitionName);
+ if (inner != null) {
+ return new ApiDefinitionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, definitionName, context);
+ }
+
+ public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ this.serviceClient().delete(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName);
+ }
+
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ return this.serviceClient().headWithResponse(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, definitionName, context);
+ }
+
+ public void head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName) {
+ this.serviceClient().head(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName);
+ }
+
+ public ApiSpecExportResult exportSpecification(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName) {
+ ApiSpecExportResultInner inner = this.serviceClient().exportSpecification(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName);
+ if (inner != null) {
+ return new ApiSpecExportResultImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public ApiSpecExportResult exportSpecification(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, String definitionName, Context context) {
+ ApiSpecExportResultInner inner = this.serviceClient().exportSpecification(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, definitionName, context);
+ if (inner != null) {
+ return new ApiSpecExportResultImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void importSpecification(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, ApiSpecImportRequest body) {
+ this.serviceClient().importSpecification(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body);
+ }
+
+ public void importSpecification(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName, String definitionName, ApiSpecImportRequest body, Context context) {
+ this.serviceClient().importSpecification(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, body, context);
+ }
+
+ public ApiDefinition getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ String definitionName = ResourceManagerUtils.getValueFromIdByName(id, "definitions");
+ if (definitionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'definitions'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ String definitionName = ResourceManagerUtils.getValueFromIdByName(id, "definitions");
+ if (definitionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'definitions'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ String definitionName = ResourceManagerUtils.getValueFromIdByName(id, "definitions");
+ if (definitionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'definitions'.", id)));
+ }
+ this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, definitionName,
+ Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ String definitionName = ResourceManagerUtils.getValueFromIdByName(id, "definitions");
+ if (definitionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'definitions'.", id)));
+ }
+ return this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ definitionName, context);
+ }
+
+ private ApiDefinitionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ public ApiDefinitionImpl define(String name) {
+ return new ApiDefinitionImpl(name, this.manager());
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiImpl.java
new file mode 100644
index 0000000000000..b078a43214fa5
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiImpl.java
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiInner;
+import com.azure.resourcemanager.apicenter.models.Api;
+import com.azure.resourcemanager.apicenter.models.ApiProperties;
+
+public final class ApiImpl implements Api, Api.Definition, Api.Update {
+ private ApiInner innerObject;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public ApiProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public ApiInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String serviceName;
+
+ private String workspaceName;
+
+ private String apiName;
+
+ public ApiImpl withExistingWorkspace(String resourceGroupName, String serviceName, String workspaceName) {
+ this.resourceGroupName = resourceGroupName;
+ this.serviceName = serviceName;
+ this.workspaceName = workspaceName;
+ return this;
+ }
+
+ public Api create() {
+ this.innerObject = serviceManager.serviceClient().getApis().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, this.innerModel(), Context.NONE).getValue();
+ return this;
+ }
+
+ public Api create(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApis().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, this.innerModel(), context).getValue();
+ return this;
+ }
+
+ ApiImpl(String name, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = new ApiInner();
+ this.serviceManager = serviceManager;
+ this.apiName = name;
+ }
+
+ public ApiImpl update() {
+ return this;
+ }
+
+ public Api apply() {
+ this.innerObject = serviceManager.serviceClient().getApis().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, this.innerModel(), Context.NONE).getValue();
+ return this;
+ }
+
+ public Api apply(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApis().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, this.innerModel(), context).getValue();
+ return this;
+ }
+
+ ApiImpl(ApiInner innerObject, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.serviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "services");
+ this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces");
+ this.apiName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apis");
+ }
+
+ public Api refresh() {
+ this.innerObject = serviceManager.serviceClient().getApis()
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, Context.NONE).getValue();
+ return this;
+ }
+
+ public Api refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApis()
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, context).getValue();
+ return this;
+ }
+
+ public ApiImpl withProperties(ApiProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSpecExportResultImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSpecExportResultImpl.java
new file mode 100644
index 0000000000000..e7fea655b6f2d
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSpecExportResultImpl.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.apicenter.implementation;
+
+import com.azure.resourcemanager.apicenter.fluent.models.ApiSpecExportResultInner;
+import com.azure.resourcemanager.apicenter.models.ApiSpecExportResult;
+import com.azure.resourcemanager.apicenter.models.ApiSpecExportResultFormat;
+
+public final class ApiSpecExportResultImpl implements ApiSpecExportResult {
+ private ApiSpecExportResultInner innerObject;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ ApiSpecExportResultImpl(ApiSpecExportResultInner innerObject,
+ com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public ApiSpecExportResultFormat format() {
+ return this.innerModel().format();
+ }
+
+ public String value() {
+ return this.innerModel().value();
+ }
+
+ public ApiSpecExportResultInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionImpl.java
new file mode 100644
index 0000000000000..6ae67df630dd8
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionImpl.java
@@ -0,0 +1,130 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiVersionInner;
+import com.azure.resourcemanager.apicenter.models.ApiVersion;
+import com.azure.resourcemanager.apicenter.models.ApiVersionProperties;
+
+public final class ApiVersionImpl implements ApiVersion, ApiVersion.Definition, ApiVersion.Update {
+ private ApiVersionInner innerObject;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public ApiVersionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public ApiVersionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String serviceName;
+
+ private String workspaceName;
+
+ private String apiName;
+
+ private String versionName;
+
+ public ApiVersionImpl withExistingApi(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ this.resourceGroupName = resourceGroupName;
+ this.serviceName = serviceName;
+ this.workspaceName = workspaceName;
+ this.apiName = apiName;
+ return this;
+ }
+
+ public ApiVersion create() {
+ this.innerObject = serviceManager.serviceClient().getApiVersions().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, versionName, this.innerModel(), Context.NONE).getValue();
+ return this;
+ }
+
+ public ApiVersion create(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApiVersions().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, versionName, this.innerModel(), context).getValue();
+ return this;
+ }
+
+ ApiVersionImpl(String name, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = new ApiVersionInner();
+ this.serviceManager = serviceManager;
+ this.versionName = name;
+ }
+
+ public ApiVersionImpl update() {
+ return this;
+ }
+
+ public ApiVersion apply() {
+ this.innerObject = serviceManager.serviceClient().getApiVersions().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, versionName, this.innerModel(), Context.NONE).getValue();
+ return this;
+ }
+
+ public ApiVersion apply(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApiVersions().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, versionName, this.innerModel(), context).getValue();
+ return this;
+ }
+
+ ApiVersionImpl(ApiVersionInner innerObject, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.serviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "services");
+ this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces");
+ this.apiName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apis");
+ this.versionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions");
+ }
+
+ public ApiVersion refresh() {
+ this.innerObject = serviceManager.serviceClient().getApiVersions()
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ApiVersion refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient().getApiVersions()
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, context).getValue();
+ return this;
+ }
+
+ public ApiVersionImpl withProperties(ApiVersionProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionsClientImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionsClientImpl.java
new file mode 100644
index 0000000000000..24dbba883e4ad
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionsClientImpl.java
@@ -0,0 +1,1022 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.Head;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.apicenter.fluent.ApiVersionsClient;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiVersionInner;
+import com.azure.resourcemanager.apicenter.models.ApiVersionListResult;
+import com.azure.resourcemanager.apicenter.models.ApiVersionsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.ApiVersionsGetResponse;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in ApiVersionsClient.
+ */
+public final class ApiVersionsClientImpl implements ApiVersionsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ApiVersionsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AzureApiCenterImpl client;
+
+ /**
+ * Initializes an instance of ApiVersionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ApiVersionsClientImpl(AzureApiCenterImpl client) {
+ this.service
+ = RestProxy.create(ApiVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureApiCenterApiVersions to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureApiCenterApiVer")
+ public interface ApiVersionsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @BodyParam("application/json") ApiVersionInner resource,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Head("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> head(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
+ @PathParam("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("versionName") String versionName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a ApiVersion list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, filter, accept,
+ context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a ApiVersion list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, filter, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a ApiVersion list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 of a ApiVersion list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a ApiVersion list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, filter, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 of a ApiVersion list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, apiName, filter));
+ }
+
+ /**
+ * Returns a collection of API versions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a ApiVersion list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, apiName, filter, context));
+ }
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, accept, context);
+ }
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiVersionsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, context)
+ .block();
+ }
+
+ /**
+ * Returns details of the API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiVersionInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ return getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, ApiVersionInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName 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();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String versionName, ApiVersionInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName 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();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ resource, accept, context);
+ }
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, ApiVersionInner resource) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ resource).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiVersionsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, ApiVersionInner resource, Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ resource, context).block();
+ }
+
+ /**
+ * Creates new or updates existing API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI version entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiVersionInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, ApiVersionInner resource) {
+ return createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, resource,
+ Context.NONE).getValue();
+ }
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, accept, context);
+ }
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, context)
+ .block();
+ }
+
+ /**
+ * Deletes specified API version.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 workspaceName, String apiName,
+ String versionName) {
+ deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, Context.NONE);
+ }
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.head(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, versionName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String versionName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (versionName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter versionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.head(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, versionName, accept, context);
+ }
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono headAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, versionName, context)
+ .block();
+ }
+
+ /**
+ * Checks if specified API version exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param versionName The name of the API version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ headWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a ApiVersion list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a ApiVersion list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionsImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionsImpl.java
new file mode 100644
index 0000000000000..7f672b0dc65a3
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiVersionsImpl.java
@@ -0,0 +1,218 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.apicenter.fluent.ApiVersionsClient;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiVersionInner;
+import com.azure.resourcemanager.apicenter.models.ApiVersion;
+import com.azure.resourcemanager.apicenter.models.ApiVersions;
+import com.azure.resourcemanager.apicenter.models.ApiVersionsGetResponse;
+
+public final class ApiVersionsImpl implements ApiVersions {
+ private static final ClientLogger LOGGER = new ClientLogger(ApiVersionsImpl.class);
+
+ private final ApiVersionsClient innerClient;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public ApiVersionsImpl(ApiVersionsClient innerClient,
+ com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ PagedIterable inner
+ = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, apiName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiVersionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context) {
+ PagedIterable inner
+ = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, apiName, filter, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiVersionImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context) {
+ ApiVersionsGetResponse inner = this.serviceClient().getWithResponse(resourceGroupName, serviceName,
+ workspaceName, apiName, versionName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ApiVersionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ApiVersion get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ ApiVersionInner inner
+ = this.serviceClient().get(resourceGroupName, serviceName, workspaceName, apiName, versionName);
+ if (inner != null) {
+ return new ApiVersionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, context);
+ }
+
+ public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ this.serviceClient().delete(resourceGroupName, serviceName, workspaceName, apiName, versionName);
+ }
+
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String versionName, Context context) {
+ return this.serviceClient().headWithResponse(resourceGroupName, serviceName, workspaceName, apiName,
+ versionName, context);
+ }
+
+ public void head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String versionName) {
+ this.serviceClient().head(resourceGroupName, serviceName, workspaceName, apiName, versionName);
+ }
+
+ public ApiVersion getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, Context.NONE)
+ .getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions");
+ if (versionName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id)));
+ }
+ return this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, versionName, context);
+ }
+
+ private ApiVersionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ public ApiVersionImpl define(String name) {
+ return new ApiVersionImpl(name, this.manager());
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApisClientImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApisClientImpl.java
new file mode 100644
index 0000000000000..d56a027c11db8
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApisClientImpl.java
@@ -0,0 +1,941 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.Head;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.apicenter.fluent.ApisClient;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiInner;
+import com.azure.resourcemanager.apicenter.models.ApiListResult;
+import com.azure.resourcemanager.apicenter.models.ApisCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.ApisGetResponse;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in ApisClient.
+ */
+public final class ApisClientImpl implements ApisClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ApisService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AzureApiCenterImpl client;
+
+ /**
+ * Initializes an instance of ApisClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ApisClientImpl(AzureApiCenterImpl client) {
+ this.service = RestProxy.create(ApisService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureApiCenterApis to be used by the proxy service to perform REST
+ * calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureApiCenterApis")
+ public interface ApisService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis")
+ @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("workspaceName") String workspaceName, @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @BodyParam("application/json") ApiInner resource, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}")
+ @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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Head("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> head(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
+ @PathParam("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter 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 of a Api list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, filter, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter 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 of a Api list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, filter, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter 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 of a Api list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String filter) {
+ return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Api list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName) {
+ final String filter = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter 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 of a Api list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, filter, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Api list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName) {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, filter));
+ }
+
+ /**
+ * Returns a collection of APIs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param filter OData filter 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 of a Api list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String filter, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, filter, context));
+ }
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, accept, context);
+ }
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApisGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, context).block();
+ }
+
+ /**
+ * Returns details of the API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ return getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, Context.NONE).getValue();
+ }
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, ApiInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName 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();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, resource,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, ApiInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName 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();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, resource, accept,
+ context);
+ }
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, ApiInner resource) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, resource)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApisCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, ApiInner resource, Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, resource,
+ context).block();
+ }
+
+ /**
+ * Creates new or updates existing API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ApiInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ ApiInner resource) {
+ return createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, resource,
+ Context.NONE).getValue();
+ }
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, accept, context);
+ }
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, context).block();
+ }
+
+ /**
+ * Deletes specified API.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 workspaceName, String apiName) {
+ deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, Context.NONE);
+ }
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.head(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.head(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, accept, context);
+ }
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono headAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, context).block();
+ }
+
+ /**
+ * Checks if specified API exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 head(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ headWithResponse(resourceGroupName, serviceName, workspaceName, apiName, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a Api list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a Api list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApisImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApisImpl.java
new file mode 100644
index 0000000000000..544dff866de76
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApisImpl.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.apicenter.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.apicenter.fluent.ApisClient;
+import com.azure.resourcemanager.apicenter.fluent.models.ApiInner;
+import com.azure.resourcemanager.apicenter.models.Api;
+import com.azure.resourcemanager.apicenter.models.Apis;
+import com.azure.resourcemanager.apicenter.models.ApisGetResponse;
+
+public final class ApisImpl implements Apis {
+ private static final ClientLogger LOGGER = new ClientLogger(ApisImpl.class);
+
+ private final ApisClient innerClient;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public ApisImpl(ApisClient innerClient, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName) {
+ PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, workspaceName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName, String filter,
+ Context context) {
+ PagedIterable inner
+ = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, filter, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context) {
+ ApisGetResponse inner
+ = this.serviceClient().getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ApiImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Api get(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ ApiInner inner = this.serviceClient().get(resourceGroupName, serviceName, workspaceName, apiName);
+ if (inner != null) {
+ return new ApiImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, context);
+ }
+
+ public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ this.serviceClient().delete(resourceGroupName, serviceName, workspaceName, apiName);
+ }
+
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, Context context) {
+ return this.serviceClient().headWithResponse(resourceGroupName, serviceName, workspaceName, apiName, context);
+ }
+
+ public void head(String resourceGroupName, String serviceName, String workspaceName, String apiName) {
+ this.serviceClient().head(resourceGroupName, serviceName, workspaceName, apiName);
+ }
+
+ public Api getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ return this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, context);
+ }
+
+ private ApisClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ public ApiImpl define(String name) {
+ return new ApiImpl(name, this.manager());
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterBuilder.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterBuilder.java
index 1c85178c872ea..124ff2f3fd04b 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterBuilder.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterBuilder.java
@@ -14,17 +14,19 @@
import com.azure.core.util.serializer.SerializerAdapter;
import java.time.Duration;
-/** A builder for creating a new instance of the AzureApiCenterImpl type. */
-@ServiceClientBuilder(serviceClients = {AzureApiCenterImpl.class})
+/**
+ * A builder for creating a new instance of the AzureApiCenterImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { AzureApiCenterImpl.class })
public final class AzureApiCenterBuilder {
/*
- * The ID of the target subscription.
+ * The ID of the target subscription. The value must be an UUID.
*/
private String subscriptionId;
/**
- * Sets The ID of the target subscription.
- *
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
* @param subscriptionId the subscriptionId value.
* @return the AzureApiCenterBuilder.
*/
@@ -40,7 +42,7 @@ public AzureApiCenterBuilder subscriptionId(String subscriptionId) {
/**
* Sets server parameter.
- *
+ *
* @param endpoint the endpoint value.
* @return the AzureApiCenterBuilder.
*/
@@ -56,7 +58,7 @@ public AzureApiCenterBuilder endpoint(String endpoint) {
/**
* Sets The environment to connect to.
- *
+ *
* @param environment the environment value.
* @return the AzureApiCenterBuilder.
*/
@@ -72,7 +74,7 @@ public AzureApiCenterBuilder environment(AzureEnvironment environment) {
/**
* Sets The HTTP pipeline to send requests through.
- *
+ *
* @param pipeline the pipeline value.
* @return the AzureApiCenterBuilder.
*/
@@ -88,7 +90,7 @@ public AzureApiCenterBuilder pipeline(HttpPipeline pipeline) {
/**
* Sets The default poll interval for long-running operation.
- *
+ *
* @param defaultPollInterval the defaultPollInterval value.
* @return the AzureApiCenterBuilder.
*/
@@ -104,7 +106,7 @@ public AzureApiCenterBuilder defaultPollInterval(Duration defaultPollInterval) {
/**
* Sets The serializer to serialize an object into a string.
- *
+ *
* @param serializerAdapter the serializerAdapter value.
* @return the AzureApiCenterBuilder.
*/
@@ -115,30 +117,20 @@ public AzureApiCenterBuilder serializerAdapter(SerializerAdapter serializerAdapt
/**
* Builds an instance of AzureApiCenterImpl with the provided parameters.
- *
+ *
* @return an instance of AzureApiCenterImpl.
*/
public AzureApiCenterImpl buildClient() {
String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
- HttpPipeline localPipeline =
- (pipeline != null)
- ? pipeline
- : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
- Duration localDefaultPollInterval =
- (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
- SerializerAdapter localSerializerAdapter =
- (serializerAdapter != null)
- ? serializerAdapter
- : SerializerFactory.createDefaultManagementSerializerAdapter();
- AzureApiCenterImpl client =
- new AzureApiCenterImpl(
- localPipeline,
- localSerializerAdapter,
- localDefaultPollInterval,
- localEnvironment,
- this.subscriptionId,
- localEndpoint);
+ HttpPipeline localPipeline = (pipeline != null) ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval
+ = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ AzureApiCenterImpl client = new AzureApiCenterImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);
return client;
}
}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java
index 320e51224d57a..fed6213bed51b 100644
--- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java
@@ -22,9 +22,16 @@
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.apicenter.fluent.ApiDefinitionsClient;
+import com.azure.resourcemanager.apicenter.fluent.ApiVersionsClient;
+import com.azure.resourcemanager.apicenter.fluent.ApisClient;
import com.azure.resourcemanager.apicenter.fluent.AzureApiCenter;
+import com.azure.resourcemanager.apicenter.fluent.DeploymentsClient;
+import com.azure.resourcemanager.apicenter.fluent.EnvironmentsClient;
+import com.azure.resourcemanager.apicenter.fluent.MetadataSchemasClient;
import com.azure.resourcemanager.apicenter.fluent.OperationsClient;
import com.azure.resourcemanager.apicenter.fluent.ServicesClient;
+import com.azure.resourcemanager.apicenter.fluent.WorkspacesClient;
import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.ByteBuffer;
@@ -34,135 +41,253 @@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
-/** Initializes a new instance of the AzureApiCenterImpl type. */
+/**
+ * Initializes a new instance of the AzureApiCenterImpl type.
+ */
@ServiceClient(builder = AzureApiCenterBuilder.class)
public final class AzureApiCenterImpl implements AzureApiCenter {
- /** The ID of the target subscription. */
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
private final String subscriptionId;
/**
- * Gets The ID of the target subscription.
- *
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
* @return the subscriptionId value.
*/
public String getSubscriptionId() {
return this.subscriptionId;
}
- /** server parameter. */
+ /**
+ * server parameter.
+ */
private final String endpoint;
/**
* Gets server parameter.
- *
+ *
* @return the endpoint value.
*/
public String getEndpoint() {
return this.endpoint;
}
- /** Api Version. */
+ /**
+ * 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. */
+ /**
+ * The HTTP pipeline to send requests through.
+ */
private final HttpPipeline httpPipeline;
/**
* Gets The HTTP pipeline to send requests through.
- *
+ *
* @return the httpPipeline value.
*/
public HttpPipeline getHttpPipeline() {
return this.httpPipeline;
}
- /** The serializer to serialize an object into a string. */
+ /**
+ * The serializer to serialize an object into a string.
+ */
private final SerializerAdapter serializerAdapter;
/**
* Gets The serializer to serialize an object into a string.
- *
+ *
* @return the serializerAdapter value.
*/
SerializerAdapter getSerializerAdapter() {
return this.serializerAdapter;
}
- /** The default poll interval for long-running operation. */
+ /**
+ * The default poll interval for long-running operation.
+ */
private final Duration defaultPollInterval;
/**
* Gets The default poll interval for long-running operation.
- *
+ *
* @return the defaultPollInterval value.
*/
public Duration getDefaultPollInterval() {
return this.defaultPollInterval;
}
- /** The OperationsClient object to access its operations. */
+ /**
+ * 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 ServicesClient object to access its operations. */
+ /**
+ * 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 MetadataSchemasClient object to access its operations.
+ */
+ private final MetadataSchemasClient metadataSchemas;
+
+ /**
+ * Gets the MetadataSchemasClient object to access its operations.
+ *
+ * @return the MetadataSchemasClient object.
+ */
+ public MetadataSchemasClient getMetadataSchemas() {
+ return this.metadataSchemas;
+ }
+
+ /**
+ * The WorkspacesClient object to access its operations.
+ */
+ private final WorkspacesClient workspaces;
+
+ /**
+ * Gets the WorkspacesClient object to access its operations.
+ *
+ * @return the WorkspacesClient object.
+ */
+ public WorkspacesClient getWorkspaces() {
+ return this.workspaces;
+ }
+
+ /**
+ * The ApisClient object to access its operations.
+ */
+ private final ApisClient apis;
+
+ /**
+ * Gets the ApisClient object to access its operations.
+ *
+ * @return the ApisClient object.
+ */
+ public ApisClient getApis() {
+ return this.apis;
+ }
+
+ /**
+ * 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 ApiVersionsClient object to access its operations.
+ */
+ private final ApiVersionsClient apiVersions;
+
+ /**
+ * Gets the ApiVersionsClient object to access its operations.
+ *
+ * @return the ApiVersionsClient object.
+ */
+ public ApiVersionsClient getApiVersions() {
+ return this.apiVersions;
+ }
+
+ /**
+ * The ApiDefinitionsClient object to access its operations.
+ */
+ private final ApiDefinitionsClient apiDefinitions;
+
+ /**
+ * Gets the ApiDefinitionsClient object to access its operations.
+ *
+ * @return the ApiDefinitionsClient object.
+ */
+ public ApiDefinitionsClient getApiDefinitions() {
+ return this.apiDefinitions;
+ }
+
+ /**
+ * The EnvironmentsClient object to access its operations.
+ */
+ private final EnvironmentsClient environments;
+
+ /**
+ * Gets the EnvironmentsClient object to access its operations.
+ *
+ * @return the EnvironmentsClient object.
+ */
+ public EnvironmentsClient getEnvironments() {
+ return this.environments;
+ }
+
/**
* Initializes an instance of AzureApiCenter client.
- *
+ *
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param defaultPollInterval The default poll interval for long-running operation.
* @param environment The Azure environment.
- * @param subscriptionId The ID of the target subscription.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
* @param endpoint server parameter.
*/
- AzureApiCenterImpl(
- HttpPipeline httpPipeline,
- SerializerAdapter serializerAdapter,
- Duration defaultPollInterval,
- AzureEnvironment environment,
- String subscriptionId,
- String endpoint) {
+ AzureApiCenterImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval,
+ AzureEnvironment environment, String subscriptionId, String endpoint) {
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
- this.apiVersion = "2023-07-01-preview";
+ this.apiVersion = "2024-03-01";
this.operations = new OperationsClientImpl(this);
this.services = new ServicesClientImpl(this);
+ this.metadataSchemas = new MetadataSchemasClientImpl(this);
+ this.workspaces = new WorkspacesClientImpl(this);
+ this.apis = new ApisClientImpl(this);
+ this.deployments = new DeploymentsClientImpl(this);
+ this.apiVersions = new ApiVersionsClientImpl(this);
+ this.apiDefinitions = new ApiDefinitionsClientImpl(this);
+ this.environments = new EnvironmentsClientImpl(this);
}
/**
* Gets default client context.
- *
+ *
* @return the default client context.
*/
public Context getContext() {
@@ -171,7 +296,7 @@ public Context getContext() {
/**
* Merges default client context with provided context.
- *
+ *
* @param context the context to be merged with default client context.
* @return the merged context.
*/
@@ -181,7 +306,7 @@ public Context mergeContext(Context context) {
/**
* Gets long running operation result.
- *
+ *
* @param activationResponse the response of activation operation.
* @param httpPipeline the http pipeline.
* @param pollResultType type of poll result.
@@ -191,26 +316,15 @@ public Context mergeContext(Context context) {
* @param type of final result.
* @return poller flux for poll result and final result.
*/
- public PollerFlux, U> getLroResult(
- Mono>> activationResponse,
- HttpPipeline httpPipeline,
- Type pollResultType,
- Type finalResultType,
- Context context) {
- return PollerFactory
- .create(
- serializerAdapter,
- httpPipeline,
- pollResultType,
- finalResultType,
- defaultPollInterval,
- activationResponse,
- context);
+ public PollerFlux, U> getLroResult(Mono>> activationResponse,
+ HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) {
+ return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, activationResponse, context);
}
/**
* Gets the final result, or an error, based on last async poll response.
- *
+ *
* @param response the last async poll response.
* @param type of poll result.
* @param type of final result.
@@ -223,19 +337,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse,
HttpResponse errorResponse = null;
PollResult.Error lroError = response.getValue().getError();
if (lroError != null) {
- errorResponse =
- new HttpResponseImpl(
- lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody());
+ errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(),
+ lroError.getResponseBody());
errorMessage = response.getValue().getError().getMessage();
String errorBody = response.getValue().getError().getResponseBody();
if (errorBody != null) {
// try to deserialize error body to ManagementError
try {
- managementError =
- this
- .getSerializerAdapter()
- .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class,
+ SerializerEncoding.JSON);
if (managementError.getCode() == null || managementError.getMessage() == null) {
managementError = null;
}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentImpl.java
new file mode 100644
index 0000000000000..be9cbf61e83ed
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentImpl.java
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.apicenter.fluent.models.DeploymentInner;
+import com.azure.resourcemanager.apicenter.models.Deployment;
+import com.azure.resourcemanager.apicenter.models.DeploymentProperties;
+
+public final class DeploymentImpl implements Deployment, Deployment.Definition, Deployment.Update {
+ private DeploymentInner innerObject;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public DeploymentProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public DeploymentInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.apicenter.ApiCenterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String serviceName;
+
+ private String workspaceName;
+
+ private String apiName;
+
+ private String deploymentName;
+
+ public DeploymentImpl withExistingApi(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ this.resourceGroupName = resourceGroupName;
+ this.serviceName = serviceName;
+ this.workspaceName = workspaceName;
+ this.apiName = apiName;
+ return this;
+ }
+
+ public Deployment create() {
+ this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, deploymentName, this.innerModel(), Context.NONE).getValue();
+ return this;
+ }
+
+ public Deployment create(Context context) {
+ this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, deploymentName, this.innerModel(), context).getValue();
+ return this;
+ }
+
+ DeploymentImpl(String name, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = new DeploymentInner();
+ this.serviceManager = serviceManager;
+ this.deploymentName = name;
+ }
+
+ public DeploymentImpl update() {
+ return this;
+ }
+
+ public Deployment apply() {
+ this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, deploymentName, this.innerModel(), Context.NONE).getValue();
+ return this;
+ }
+
+ public Deployment apply(Context context) {
+ this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdateWithResponse(resourceGroupName,
+ serviceName, workspaceName, apiName, deploymentName, this.innerModel(), context).getValue();
+ return this;
+ }
+
+ DeploymentImpl(DeploymentInner innerObject, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.serviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "services");
+ this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces");
+ this.apiName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apis");
+ this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deployments");
+ }
+
+ public Deployment refresh() {
+ this.innerObject = serviceManager.serviceClient().getDeployments()
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Deployment refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient().getDeployments()
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, context)
+ .getValue();
+ return this;
+ }
+
+ public DeploymentImpl withProperties(DeploymentProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentsClientImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentsClientImpl.java
new file mode 100644
index 0000000000000..cc8b1534c4558
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentsClientImpl.java
@@ -0,0 +1,1022 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.apicenter.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.Head;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.apicenter.fluent.DeploymentsClient;
+import com.azure.resourcemanager.apicenter.fluent.models.DeploymentInner;
+import com.azure.resourcemanager.apicenter.models.DeploymentListResult;
+import com.azure.resourcemanager.apicenter.models.DeploymentsCreateOrUpdateResponse;
+import com.azure.resourcemanager.apicenter.models.DeploymentsGetResponse;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in DeploymentsClient.
+ */
+public final class DeploymentsClientImpl implements DeploymentsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DeploymentsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AzureApiCenterImpl client;
+
+ /**
+ * Initializes an instance of DeploymentsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DeploymentsClientImpl(AzureApiCenterImpl client) {
+ this.service
+ = RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureApiCenterDeployments to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureApiCenterDeploy")
+ public interface DeploymentsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("deploymentName") String deploymentName, @BodyParam("application/json") DeploymentInner resource,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/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("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Head("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/deployments/{deploymentName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> head(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
+ @PathParam("workspaceName") String workspaceName, @PathParam("apiName") String apiName,
+ @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, filter, accept,
+ context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serviceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, filter, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a Deployment list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 of a Deployment list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a Deployment list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, apiName, filter, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 of a Deployment list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, apiName, filter));
+ }
+
+ /**
+ * Returns a collection of API deployments.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param filter OData filter 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 of a Deployment list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, apiName, filter, context));
+ }
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, deploymentName, accept, context);
+ }
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DeploymentsGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context) {
+ return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, context)
+ .block();
+ }
+
+ /**
+ * Returns details of the API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DeploymentInner get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ return getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String deploymentName, DeploymentInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName 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();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateWithResponseAsync(String resourceGroupName,
+ String serviceName, String workspaceName, String apiName, String deploymentName, DeploymentInner 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName 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();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ resource, accept, context);
+ }
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String deploymentName, DeploymentInner resource) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ resource).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DeploymentsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, String deploymentName, DeploymentInner resource, Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ resource, context).block();
+ }
+
+ /**
+ * Creates new or updates existing API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return aPI deployment entity.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DeploymentInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, DeploymentInner resource) {
+ return createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ resource, Context.NONE).getValue();
+ }
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, deploymentName, accept, context);
+ }
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, context)
+ .block();
+ }
+
+ /**
+ * Deletes API deployment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 workspaceName, String apiName,
+ String deploymentName) {
+ deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, Context.NONE);
+ }
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.head(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiName, deploymentName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> headWithResponseAsync(String resourceGroupName, String serviceName,
+ String workspaceName, String apiName, 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 (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ if (apiName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null."));
+ }
+ if (deploymentName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.head(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, serviceName, workspaceName, apiName, deploymentName, accept, context);
+ }
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono headAsync(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context) {
+ return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, context)
+ .block();
+ }
+
+ /**
+ * Checks if specified API deployment exists.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serviceName The name of Azure API Center service.
+ * @param workspaceName The name of the workspace.
+ * @param apiName The name of the API.
+ * @param deploymentName The name of the API deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ headWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * 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 of a Deployment list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentsImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentsImpl.java
new file mode 100644
index 0000000000000..0428095c2d1a7
--- /dev/null
+++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeploymentsImpl.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.apicenter.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.apicenter.fluent.DeploymentsClient;
+import com.azure.resourcemanager.apicenter.fluent.models.DeploymentInner;
+import com.azure.resourcemanager.apicenter.models.Deployment;
+import com.azure.resourcemanager.apicenter.models.Deployments;
+import com.azure.resourcemanager.apicenter.models.DeploymentsGetResponse;
+
+public final class DeploymentsImpl implements Deployments {
+ private static final ClientLogger LOGGER = new ClientLogger(DeploymentsImpl.class);
+
+ private final DeploymentsClient innerClient;
+
+ private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager;
+
+ public DeploymentsImpl(DeploymentsClient innerClient,
+ com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName) {
+ PagedIterable inner
+ = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, apiName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String filter, Context context) {
+ PagedIterable inner
+ = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, apiName, filter, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context) {
+ DeploymentsGetResponse inner = this.serviceClient().getWithResponse(resourceGroupName, serviceName,
+ workspaceName, apiName, deploymentName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new DeploymentImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Deployment get(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ DeploymentInner inner
+ = this.serviceClient().get(resourceGroupName, serviceName, workspaceName, apiName, deploymentName);
+ if (inner != null) {
+ return new DeploymentImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiName,
+ deploymentName, context);
+ }
+
+ public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ this.serviceClient().delete(resourceGroupName, serviceName, workspaceName, apiName, deploymentName);
+ }
+
+ public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName,
+ String apiName, String deploymentName, Context context) {
+ return this.serviceClient().headWithResponse(resourceGroupName, serviceName, workspaceName, apiName,
+ deploymentName, context);
+ }
+
+ public void head(String resourceGroupName, String serviceName, String workspaceName, String apiName,
+ String deploymentName) {
+ this.serviceClient().head(resourceGroupName, serviceName, workspaceName, apiName, deploymentName);
+ }
+
+ public Deployment getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services");
+ if (serviceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));
+ }
+ String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces");
+ if (workspaceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
+ }
+ String apiName = ResourceManagerUtils.getValueFromIdByName(id, "apis");
+ if (apiName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));
+ }
+ String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments");
+ if (deploymentName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id)));
+ }
+ return this
+ .getWithResponse(resourceGroupName, serviceName, workspaceName, apiName, deploymentName, Context.NONE)
+ .getValue();
+ }
+
+ public Response