diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java
index d2ca08ad1a68..9cbf15306127 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/ServiceLinkerManager.java
@@ -25,10 +25,8 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.servicelinker.fluent.ServiceLinkerManagementClient;
import com.azure.resourcemanager.servicelinker.implementation.LinkersImpl;
-import com.azure.resourcemanager.servicelinker.implementation.OperationsImpl;
import com.azure.resourcemanager.servicelinker.implementation.ServiceLinkerManagementClientBuilder;
import com.azure.resourcemanager.servicelinker.models.Linkers;
-import com.azure.resourcemanager.servicelinker.models.Operations;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
@@ -36,28 +34,26 @@
import java.util.Objects;
import java.util.stream.Collectors;
-/** Entry point to ServiceLinkerManager. Microsoft.ServiceLinker provider. */
+/**
+ * Entry point to ServiceLinkerManager.
+ * Microsoft.ServiceLinker provider.
+ */
public final class ServiceLinkerManager {
private Linkers linkers;
- private Operations operations;
-
private final ServiceLinkerManagementClient clientObject;
private ServiceLinkerManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
- this.clientObject =
- new ServiceLinkerManagementClientBuilder()
- .pipeline(httpPipeline)
- .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
- .defaultPollInterval(defaultPollInterval)
- .buildClient();
+ this.clientObject = new ServiceLinkerManagementClientBuilder().pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).defaultPollInterval(defaultPollInterval)
+ .buildClient();
}
/**
* Creates an instance of ServiceLinker service API entry point.
- *
+ *
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the ServiceLinker service API instance.
@@ -70,7 +66,7 @@ public static ServiceLinkerManager authenticate(TokenCredential credential, Azur
/**
* Creates an instance of ServiceLinker service API entry point.
- *
+ *
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the ServiceLinker service API instance.
@@ -83,14 +79,16 @@ public static ServiceLinkerManager authenticate(HttpPipeline httpPipeline, Azure
/**
* Gets a Configurable instance that can be used to create ServiceLinkerManager with optional configuration.
- *
+ *
* @return the Configurable instance allowing configurations.
*/
public static Configurable configure() {
return new ServiceLinkerManager.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);
@@ -162,8 +160,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.
@@ -180,8 +178,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"));
@@ -201,21 +199,12 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil
Objects.requireNonNull(profile, "'profile' cannot be null.");
StringBuilder userAgentBuilder = new StringBuilder();
- userAgentBuilder
- .append("azsdk-java")
- .append("-")
- .append("com.azure.resourcemanager.servicelinker")
- .append("/")
- .append("1.0.0-beta.2");
+ userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.servicelinker")
+ .append("/").append("1.0.0-beta.1");
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)");
}
@@ -234,38 +223,25 @@ public ServiceLinkerManager authenticate(TokenCredential credential, AzureProfil
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 ServiceLinkerManager(httpPipeline, profile, defaultPollInterval);
}
}
/**
* Gets the resource collection API of Linkers. It manages LinkerResource.
- *
+ *
* @return Resource collection API of Linkers.
*/
public Linkers linkers() {
@@ -276,20 +252,10 @@ public Linkers linkers() {
}
/**
- * Gets the resource collection API of Operations.
- *
- * @return Resource collection API of Operations.
- */
- public Operations operations() {
- if (this.operations == null) {
- this.operations = new OperationsImpl(clientObject.getOperations(), this);
- }
- return operations;
- }
-
- /**
- * @return Wrapped service client ServiceLinkerManagementClient providing direct access to the underlying
- * auto-generated API implementation, based on Azure REST API.
+ * Gets wrapped service client ServiceLinkerManagementClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client ServiceLinkerManagementClient.
*/
public ServiceLinkerManagementClient serviceClient() {
return this.clientObject;
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java
index 5c11981acda7..355f514ac82e 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/LinkersClient.java
@@ -6,7 +6,6 @@
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;
@@ -16,63 +15,40 @@
import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner;
import com.azure.resourcemanager.servicelinker.models.LinkerPatch;
-/** An instance of this class provides access to all the operations defined in LinkersClient. */
+/**
+ * An instance of this class provides access to all the operations defined in LinkersClient.
+ */
public interface LinkersClient {
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(String resourceUri);
-
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @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 list of Linker as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(String resourceUri, Context context);
-
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
+ * @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 linker of source and target resource.
+ * @return linker of source and target resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- LinkerResourceInner get(String resourceUri, String linkerName);
+ Response getWithResponse(String resourceUri, String linkerName, Context context);
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
- * @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 linker of source and target resource along with {@link Response}.
+ * @return linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response getWithResponse(String resourceUri, String linkerName, Context context);
+ LinkerResourceInner get(String resourceUri, String linkerName);
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -82,12 +58,12 @@ public interface LinkersClient {
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, LinkerResourceInner> beginCreateOrUpdate(
- String resourceUri, String linkerName, LinkerResourceInner parameters);
+ SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri,
+ String linkerName, LinkerResourceInner parameters);
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -98,12 +74,12 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, LinkerResourceInner> beginCreateOrUpdate(
- String resourceUri, String linkerName, LinkerResourceInner parameters, Context context);
+ SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri,
+ String linkerName, LinkerResourceInner parameters, Context context);
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -117,7 +93,7 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -128,12 +104,12 @@ SyncPoller, LinkerResourceInner> beginCreateOrUp
* @return linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- LinkerResourceInner createOrUpdate(
- String resourceUri, String linkerName, LinkerResourceInner parameters, Context context);
+ LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters,
+ Context context);
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -146,7 +122,7 @@ LinkerResourceInner createOrUpdate(
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -160,7 +136,7 @@ LinkerResourceInner createOrUpdate(
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -172,7 +148,7 @@ LinkerResourceInner createOrUpdate(
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -185,7 +161,7 @@ LinkerResourceInner createOrUpdate(
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -195,12 +171,12 @@ LinkerResourceInner createOrUpdate(
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, LinkerResourceInner> beginUpdate(
- String resourceUri, String linkerName, LinkerPatch parameters);
+ SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri, String linkerName,
+ LinkerPatch parameters);
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -211,12 +187,12 @@ SyncPoller, LinkerResourceInner> beginUpdate(
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, LinkerResourceInner> beginUpdate(
- String resourceUri, String linkerName, LinkerPatch parameters, Context context);
+ SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri, String linkerName,
+ LinkerPatch parameters, Context context);
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -230,7 +206,7 @@ SyncPoller, LinkerResourceInner> beginUpdate(
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -245,7 +221,7 @@ SyncPoller, LinkerResourceInner> beginUpdate(
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -254,12 +230,12 @@ SyncPoller, LinkerResourceInner> beginUpdate(
* @return the {@link SyncPoller} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, ValidateOperationResultInner> beginValidate(
- String resourceUri, String linkerName);
+ SyncPoller, ValidateOperationResultInner> beginValidate(String resourceUri,
+ String linkerName);
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -269,12 +245,12 @@ SyncPoller, ValidateOperationResultInne
* @return the {@link SyncPoller} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, ValidateOperationResultInner> beginValidate(
- String resourceUri, String linkerName, Context context);
+ SyncPoller, ValidateOperationResultInner> beginValidate(String resourceUri,
+ String linkerName, Context context);
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -287,7 +263,7 @@ SyncPoller, ValidateOperationResultInne
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -301,30 +277,30 @@ SyncPoller, ValidateOperationResultInne
/**
* list source configurations for a linker.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
+ * @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 configurations for source resource, include appSettings, connectionString and serviceBindings.
+ * @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
+ * {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName);
+ Response listConfigurationsWithResponse(String resourceUri, String linkerName,
+ Context context);
/**
* list source configurations for a linker.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
- * @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 configurations for source resource, include appSettings, connectionString and serviceBindings along with
- * {@link Response}.
+ * @return configurations for source resource, include appSettings, connectionString and serviceBindings.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response listConfigurationsWithResponse(
- String resourceUri, String linkerName, Context context);
+ SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName);
}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java
deleted file mode 100644
index 3ab76039aba2..000000000000
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/OperationsClient.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.servicelinker.fluent;
-
-import com.azure.core.annotation.ReturnType;
-import com.azure.core.annotation.ServiceMethod;
-import com.azure.core.http.rest.PagedIterable;
-import com.azure.core.util.Context;
-import com.azure.resourcemanager.servicelinker.fluent.models.OperationInner;
-
-/** An instance of this class provides access to all the operations defined in OperationsClient. */
-public interface OperationsClient {
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list();
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(Context context);
-}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java
index 51e97f1c051c..978cade4bfee 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/ServiceLinkerManagementClient.java
@@ -7,47 +7,42 @@
import com.azure.core.http.HttpPipeline;
import java.time.Duration;
-/** The interface for ServiceLinkerManagementClient class. */
+/**
+ * The interface for ServiceLinkerManagementClient class.
+ */
public interface ServiceLinkerManagementClient {
/**
* 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 LinkersClient object to access its operations.
- *
+ *
* @return the LinkersClient object.
*/
LinkersClient getLinkers();
-
- /**
- * Gets the OperationsClient object to access its operations.
- *
- * @return the OperationsClient object.
- */
- OperationsClient getOperations();
}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java
index 44ef47e9ee44..56fdd1f29491 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerProperties.java
@@ -12,7 +12,9 @@
import com.azure.resourcemanager.servicelinker.models.VNetSolution;
import com.fasterxml.jackson.annotation.JsonProperty;
-/** The properties of the linker. */
+/**
+ * The properties of the linker.
+ */
@Fluent
public final class LinkerProperties {
/*
@@ -57,9 +59,15 @@ public final class LinkerProperties {
@JsonProperty(value = "scope")
private String scope;
+ /**
+ * Creates an instance of LinkerProperties class.
+ */
+ public LinkerProperties() {
+ }
+
/**
* Get the targetService property: The target service properties.
- *
+ *
* @return the targetService value.
*/
public TargetServiceBase targetService() {
@@ -68,7 +76,7 @@ public TargetServiceBase targetService() {
/**
* Set the targetService property: The target service properties.
- *
+ *
* @param targetService the targetService value to set.
* @return the LinkerProperties object itself.
*/
@@ -79,7 +87,7 @@ public LinkerProperties withTargetService(TargetServiceBase targetService) {
/**
* Get the authInfo property: The authentication type.
- *
+ *
* @return the authInfo value.
*/
public AuthInfoBase authInfo() {
@@ -88,7 +96,7 @@ public AuthInfoBase authInfo() {
/**
* Set the authInfo property: The authentication type.
- *
+ *
* @param authInfo the authInfo value to set.
* @return the LinkerProperties object itself.
*/
@@ -99,7 +107,7 @@ public LinkerProperties withAuthInfo(AuthInfoBase authInfo) {
/**
* Get the clientType property: The application client type.
- *
+ *
* @return the clientType value.
*/
public ClientType clientType() {
@@ -108,7 +116,7 @@ public ClientType clientType() {
/**
* Set the clientType property: The application client type.
- *
+ *
* @param clientType the clientType value to set.
* @return the LinkerProperties object itself.
*/
@@ -119,7 +127,7 @@ public LinkerProperties withClientType(ClientType clientType) {
/**
* Get the provisioningState property: The provisioning state.
- *
+ *
* @return the provisioningState value.
*/
public String provisioningState() {
@@ -128,7 +136,7 @@ public String provisioningState() {
/**
* Get the vNetSolution property: The VNet solution.
- *
+ *
* @return the vNetSolution value.
*/
public VNetSolution vNetSolution() {
@@ -137,7 +145,7 @@ public VNetSolution vNetSolution() {
/**
* Set the vNetSolution property: The VNet solution.
- *
+ *
* @param vNetSolution the vNetSolution value to set.
* @return the LinkerProperties object itself.
*/
@@ -148,7 +156,7 @@ public LinkerProperties withVNetSolution(VNetSolution vNetSolution) {
/**
* Get the secretStore property: An option to store secret value in secure place.
- *
+ *
* @return the secretStore value.
*/
public SecretStore secretStore() {
@@ -157,7 +165,7 @@ public SecretStore secretStore() {
/**
* Set the secretStore property: An option to store secret value in secure place.
- *
+ *
* @param secretStore the secretStore value to set.
* @return the LinkerProperties object itself.
*/
@@ -168,7 +176,7 @@ public LinkerProperties withSecretStore(SecretStore secretStore) {
/**
* Get the scope property: connection scope in source service.
- *
+ *
* @return the scope value.
*/
public String scope() {
@@ -177,7 +185,7 @@ public String scope() {
/**
* Set the scope property: connection scope in source service.
- *
+ *
* @param scope the scope value to set.
* @return the LinkerProperties object itself.
*/
@@ -188,7 +196,7 @@ public LinkerProperties withScope(String scope) {
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java
index 44f17614df63..d10795f1fa18 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/LinkerResourceInner.java
@@ -15,7 +15,9 @@
import com.azure.resourcemanager.servicelinker.models.VNetSolution;
import com.fasterxml.jackson.annotation.JsonProperty;
-/** Linker of source and target resource. */
+/**
+ * Linker of source and target resource.
+ */
@Fluent
public final class LinkerResourceInner extends ProxyResource {
/*
@@ -30,9 +32,15 @@ public final class LinkerResourceInner extends ProxyResource {
@JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
private SystemData systemData;
+ /**
+ * Creates an instance of LinkerResourceInner class.
+ */
+ public LinkerResourceInner() {
+ }
+
/**
* Get the innerProperties property: The properties of the linker.
- *
+ *
* @return the innerProperties value.
*/
private LinkerProperties innerProperties() {
@@ -41,7 +49,7 @@ private LinkerProperties innerProperties() {
/**
* Get the systemData property: The system data.
- *
+ *
* @return the systemData value.
*/
public SystemData systemData() {
@@ -50,7 +58,7 @@ public SystemData systemData() {
/**
* Get the targetService property: The target service properties.
- *
+ *
* @return the targetService value.
*/
public TargetServiceBase targetService() {
@@ -59,7 +67,7 @@ public TargetServiceBase targetService() {
/**
* Set the targetService property: The target service properties.
- *
+ *
* @param targetService the targetService value to set.
* @return the LinkerResourceInner object itself.
*/
@@ -73,7 +81,7 @@ public LinkerResourceInner withTargetService(TargetServiceBase targetService) {
/**
* Get the authInfo property: The authentication type.
- *
+ *
* @return the authInfo value.
*/
public AuthInfoBase authInfo() {
@@ -82,7 +90,7 @@ public AuthInfoBase authInfo() {
/**
* Set the authInfo property: The authentication type.
- *
+ *
* @param authInfo the authInfo value to set.
* @return the LinkerResourceInner object itself.
*/
@@ -96,7 +104,7 @@ public LinkerResourceInner withAuthInfo(AuthInfoBase authInfo) {
/**
* Get the clientType property: The application client type.
- *
+ *
* @return the clientType value.
*/
public ClientType clientType() {
@@ -105,7 +113,7 @@ public ClientType clientType() {
/**
* Set the clientType property: The application client type.
- *
+ *
* @param clientType the clientType value to set.
* @return the LinkerResourceInner object itself.
*/
@@ -119,7 +127,7 @@ public LinkerResourceInner withClientType(ClientType clientType) {
/**
* Get the provisioningState property: The provisioning state.
- *
+ *
* @return the provisioningState value.
*/
public String provisioningState() {
@@ -128,7 +136,7 @@ public String provisioningState() {
/**
* Get the vNetSolution property: The VNet solution.
- *
+ *
* @return the vNetSolution value.
*/
public VNetSolution vNetSolution() {
@@ -137,7 +145,7 @@ public VNetSolution vNetSolution() {
/**
* Set the vNetSolution property: The VNet solution.
- *
+ *
* @param vNetSolution the vNetSolution value to set.
* @return the LinkerResourceInner object itself.
*/
@@ -151,7 +159,7 @@ public LinkerResourceInner withVNetSolution(VNetSolution vNetSolution) {
/**
* Get the secretStore property: An option to store secret value in secure place.
- *
+ *
* @return the secretStore value.
*/
public SecretStore secretStore() {
@@ -160,7 +168,7 @@ public SecretStore secretStore() {
/**
* Set the secretStore property: An option to store secret value in secure place.
- *
+ *
* @param secretStore the secretStore value to set.
* @return the LinkerResourceInner object itself.
*/
@@ -174,7 +182,7 @@ public LinkerResourceInner withSecretStore(SecretStore secretStore) {
/**
* Get the scope property: connection scope in source service.
- *
+ *
* @return the scope value.
*/
public String scope() {
@@ -183,7 +191,7 @@ public String scope() {
/**
* Set the scope property: connection scope in source service.
- *
+ *
* @param scope the scope value to set.
* @return the LinkerResourceInner object itself.
*/
@@ -197,15 +205,13 @@ public LinkerResourceInner withScope(String scope) {
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- "Missing required property innerProperties in model LinkerResourceInner"));
+ throw LOGGER.logExceptionAsError(
+ new IllegalArgumentException("Missing required property innerProperties in model LinkerResourceInner"));
} else {
innerProperties().validate();
}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java
deleted file mode 100644
index 3d520cb77233..000000000000
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/OperationInner.java
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.servicelinker.fluent.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.resourcemanager.servicelinker.models.ActionType;
-import com.azure.resourcemanager.servicelinker.models.OperationDisplay;
-import com.azure.resourcemanager.servicelinker.models.Origin;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */
-@Fluent
-public final class OperationInner {
- /*
- * The name of the operation, as per Resource-Based Access Control (RBAC).
- * Examples: "Microsoft.Compute/virtualMachines/write",
- * "Microsoft.Compute/virtualMachines/capture/action"
- */
- @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
- private String name;
-
- /*
- * Whether the operation applies to data-plane. This is "true" for
- * data-plane operations and "false" for ARM/control-plane operations.
- */
- @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY)
- private Boolean isDataAction;
-
- /*
- * Localized display information for this particular operation.
- */
- @JsonProperty(value = "display")
- private OperationDisplay display;
-
- /*
- * The intended executor of the operation; as in Resource Based Access
- * Control (RBAC) and audit logs UX. Default value is "user,system"
- */
- @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
- private Origin origin;
-
- /*
- * Enum. Indicates the action type. "Internal" refers to actions that are
- * for internal only APIs.
- */
- @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY)
- private ActionType actionType;
-
- /**
- * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
- * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
- *
- * @return the name value.
- */
- public String name() {
- return this.name;
- }
-
- /**
- * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
- * operations and "false" for ARM/control-plane operations.
- *
- * @return the isDataAction value.
- */
- public Boolean isDataAction() {
- return this.isDataAction;
- }
-
- /**
- * Get the display property: Localized display information for this particular operation.
- *
- * @return the display value.
- */
- public OperationDisplay display() {
- return this.display;
- }
-
- /**
- * Set the display property: Localized display information for this particular operation.
- *
- * @param display the display value to set.
- * @return the OperationInner object itself.
- */
- public OperationInner withDisplay(OperationDisplay display) {
- this.display = display;
- return this;
- }
-
- /**
- * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
- * audit logs UX. Default value is "user,system".
- *
- * @return the origin value.
- */
- public Origin origin() {
- return this.origin;
- }
-
- /**
- * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
- * only APIs.
- *
- * @return the actionType value.
- */
- public ActionType actionType() {
- return this.actionType;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (display() != null) {
- display().validate();
- }
- }
-}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java
index aa517497546a..2f0a87d4493d 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/SourceConfigurationResultInner.java
@@ -9,7 +9,9 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
-/** Configurations for source resource, include appSettings, connectionString and serviceBindings. */
+/**
+ * Configurations for source resource, include appSettings, connectionString and serviceBindings.
+ */
@Fluent
public final class SourceConfigurationResultInner {
/*
@@ -18,9 +20,15 @@ public final class SourceConfigurationResultInner {
@JsonProperty(value = "configurations")
private List configurations;
+ /**
+ * Creates an instance of SourceConfigurationResultInner class.
+ */
+ public SourceConfigurationResultInner() {
+ }
+
/**
* Get the configurations property: The configuration properties for source resource.
- *
+ *
* @return the configurations value.
*/
public List configurations() {
@@ -29,7 +37,7 @@ public List configurations() {
/**
* Set the configurations property: The configuration properties for source resource.
- *
+ *
* @param configurations the configurations value to set.
* @return the SourceConfigurationResultInner object itself.
*/
@@ -40,7 +48,7 @@ public SourceConfigurationResultInner withConfigurations(List validationDetail() {
@@ -253,7 +261,7 @@ public List validationDetail() {
/**
* Set the validationDetail property: The detail of validation result.
- *
+ *
* @param validationDetail the validationDetail value to set.
* @return the ValidateOperationResultInner object itself.
*/
@@ -267,7 +275,7 @@ public ValidateOperationResultInner withValidationDetail(List validationDetail;
+ /**
+ * Creates an instance of ValidateResult class.
+ */
+ public ValidateResult() {
+ }
+
/**
* Get the linkerName property: The linker name.
- *
+ *
* @return the linkerName value.
*/
public String linkerName() {
@@ -73,7 +81,7 @@ public String linkerName() {
/**
* Set the linkerName property: The linker name.
- *
+ *
* @param linkerName the linkerName value to set.
* @return the ValidateResult object itself.
*/
@@ -84,7 +92,7 @@ public ValidateResult withLinkerName(String linkerName) {
/**
* Get the isConnectionAvailable property: A boolean value indicating whether the connection is available or not.
- *
+ *
* @return the isConnectionAvailable value.
*/
public Boolean isConnectionAvailable() {
@@ -93,7 +101,7 @@ public Boolean isConnectionAvailable() {
/**
* Set the isConnectionAvailable property: A boolean value indicating whether the connection is available or not.
- *
+ *
* @param isConnectionAvailable the isConnectionAvailable value to set.
* @return the ValidateResult object itself.
*/
@@ -104,7 +112,7 @@ public ValidateResult withIsConnectionAvailable(Boolean isConnectionAvailable) {
/**
* Get the reportStartTimeUtc property: The start time of the validation report.
- *
+ *
* @return the reportStartTimeUtc value.
*/
public OffsetDateTime reportStartTimeUtc() {
@@ -113,7 +121,7 @@ public OffsetDateTime reportStartTimeUtc() {
/**
* Set the reportStartTimeUtc property: The start time of the validation report.
- *
+ *
* @param reportStartTimeUtc the reportStartTimeUtc value to set.
* @return the ValidateResult object itself.
*/
@@ -124,7 +132,7 @@ public ValidateResult withReportStartTimeUtc(OffsetDateTime reportStartTimeUtc)
/**
* Get the reportEndTimeUtc property: The end time of the validation report.
- *
+ *
* @return the reportEndTimeUtc value.
*/
public OffsetDateTime reportEndTimeUtc() {
@@ -133,7 +141,7 @@ public OffsetDateTime reportEndTimeUtc() {
/**
* Set the reportEndTimeUtc property: The end time of the validation report.
- *
+ *
* @param reportEndTimeUtc the reportEndTimeUtc value to set.
* @return the ValidateResult object itself.
*/
@@ -144,7 +152,7 @@ public ValidateResult withReportEndTimeUtc(OffsetDateTime reportEndTimeUtc) {
/**
* Get the sourceId property: The resource id of the linker source application.
- *
+ *
* @return the sourceId value.
*/
public String sourceId() {
@@ -153,7 +161,7 @@ public String sourceId() {
/**
* Set the sourceId property: The resource id of the linker source application.
- *
+ *
* @param sourceId the sourceId value to set.
* @return the ValidateResult object itself.
*/
@@ -164,7 +172,7 @@ public ValidateResult withSourceId(String sourceId) {
/**
* Get the targetId property: The resource Id of target service.
- *
+ *
* @return the targetId value.
*/
public String targetId() {
@@ -173,7 +181,7 @@ public String targetId() {
/**
* Set the targetId property: The resource Id of target service.
- *
+ *
* @param targetId the targetId value to set.
* @return the ValidateResult object itself.
*/
@@ -184,7 +192,7 @@ public ValidateResult withTargetId(String targetId) {
/**
* Get the authType property: The authentication type.
- *
+ *
* @return the authType value.
*/
public AuthType authType() {
@@ -193,7 +201,7 @@ public AuthType authType() {
/**
* Set the authType property: The authentication type.
- *
+ *
* @param authType the authType value to set.
* @return the ValidateResult object itself.
*/
@@ -204,7 +212,7 @@ public ValidateResult withAuthType(AuthType authType) {
/**
* Get the validationDetail property: The detail of validation result.
- *
+ *
* @return the validationDetail value.
*/
public List validationDetail() {
@@ -213,7 +221,7 @@ public List validationDetail() {
/**
* Set the validationDetail property: The detail of validation result.
- *
+ *
* @param validationDetail the validationDetail value to set.
* @return the ValidateResult object itself.
*/
@@ -224,7 +232,7 @@ public ValidateResult withValidationDetail(List validation
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/package-info.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/package-info.java
index 12928aaba782..b70c4fc42301 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/models/package-info.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/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 ServiceLinkerManagementClient. Microsoft.ServiceLinker provider. */
+/**
+ * Package containing the inner data models for ServiceLinkerManagementClient.
+ * Microsoft.ServiceLinker provider.
+ */
package com.azure.resourcemanager.servicelinker.fluent.models;
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/package-info.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/package-info.java
index 3f6dd75b187a..1bb9daa17dfb 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/fluent/package-info.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/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 ServiceLinkerManagementClient. Microsoft.ServiceLinker provider. */
+/**
+ * Package containing the service clients for ServiceLinkerManagementClient.
+ * Microsoft.ServiceLinker provider.
+ */
package com.azure.resourcemanager.servicelinker.fluent;
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java
index c8fff03eab9a..72112307a241 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkerResourceImpl.java
@@ -87,20 +87,14 @@ public LinkerResourceImpl withExistingResourceUri(String resourceUri) {
}
public LinkerResource create() {
- this.innerObject =
- serviceManager
- .serviceClient()
- .getLinkers()
- .createOrUpdate(resourceUri, linkerName, this.innerModel(), Context.NONE);
+ this.innerObject = serviceManager.serviceClient().getLinkers().createOrUpdate(resourceUri, linkerName,
+ this.innerModel(), Context.NONE);
return this;
}
public LinkerResource create(Context context) {
- this.innerObject =
- serviceManager
- .serviceClient()
- .getLinkers()
- .createOrUpdate(resourceUri, linkerName, this.innerModel(), context);
+ this.innerObject = serviceManager.serviceClient().getLinkers().createOrUpdate(resourceUri, linkerName,
+ this.innerModel(), context);
return this;
}
@@ -116,48 +110,36 @@ public LinkerResourceImpl update() {
}
public LinkerResource apply() {
- this.innerObject =
- serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters, Context.NONE);
+ this.innerObject = serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters,
+ Context.NONE);
return this;
}
public LinkerResource apply(Context context) {
- this.innerObject =
- serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters, context);
+ this.innerObject
+ = serviceManager.serviceClient().getLinkers().update(resourceUri, linkerName, updateParameters, context);
return this;
}
- LinkerResourceImpl(
- LinkerResourceInner innerObject, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) {
+ LinkerResourceImpl(LinkerResourceInner innerObject,
+ com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
- this.resourceUri =
- Utils
- .getValueFromIdByParameterName(
- innerObject.id(),
- "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}",
- "resourceUri");
- this.linkerName =
- Utils
- .getValueFromIdByParameterName(
- innerObject.id(),
- "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}",
- "linkerName");
+ this.resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(),
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
+ this.linkerName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(),
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
}
public LinkerResource refresh() {
- this.innerObject =
- serviceManager
- .serviceClient()
- .getLinkers()
- .getWithResponse(resourceUri, linkerName, Context.NONE)
- .getValue();
+ this.innerObject = serviceManager.serviceClient().getLinkers()
+ .getWithResponse(resourceUri, linkerName, Context.NONE).getValue();
return this;
}
public LinkerResource refresh(Context context) {
- this.innerObject =
- serviceManager.serviceClient().getLinkers().getWithResponse(resourceUri, linkerName, context).getValue();
+ this.innerObject
+ = serviceManager.serviceClient().getLinkers().getWithResponse(resourceUri, linkerName, context).getValue();
return this;
}
@@ -169,14 +151,14 @@ public ValidateOperationResult validate(Context context) {
return serviceManager.linkers().validate(resourceUri, linkerName, context);
}
- public SourceConfigurationResult listConfigurations() {
- return serviceManager.linkers().listConfigurations(resourceUri, linkerName);
- }
-
public Response listConfigurationsWithResponse(Context context) {
return serviceManager.linkers().listConfigurationsWithResponse(resourceUri, linkerName, context);
}
+ public SourceConfigurationResult listConfigurations() {
+ return serviceManager.linkers().listConfigurations(resourceUri, linkerName);
+ }
+
public LinkerResourceImpl withTargetService(TargetServiceBase targetService) {
if (isInCreateMode()) {
this.innerModel().withTargetService(targetService);
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java
index 033bdccd2382..c8befc726da7 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersClientImpl.java
@@ -21,10 +21,6 @@
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;
@@ -37,23 +33,28 @@
import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner;
import com.azure.resourcemanager.servicelinker.fluent.models.SourceConfigurationResultInner;
import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner;
-import com.azure.resourcemanager.servicelinker.models.LinkerList;
import com.azure.resourcemanager.servicelinker.models.LinkerPatch;
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 LinkersClient. */
+/**
+ * An instance of this class provides access to all the operations defined in LinkersClient.
+ */
public final class LinkersClientImpl implements LinkersClient {
- /** The proxy service used to perform REST calls. */
+ /**
+ * The proxy service used to perform REST calls.
+ */
private final LinkersService service;
- /** The service client containing this operation class. */
+ /**
+ * The service client containing this operation class.
+ */
private final ServiceLinkerManagementClientImpl client;
/**
* Initializes an instance of LinkersClientImpl.
- *
+ *
* @param client the instance of the service client containing this operation class.
*/
LinkersClientImpl(ServiceLinkerManagementClientImpl client) {
@@ -67,253 +68,80 @@ public final class LinkersClientImpl implements LinkersClient {
*/
@Host("{$host}")
@ServiceInterface(name = "ServiceLinkerManagem")
- private interface LinkersService {
- @Headers({"Content-Type: application/json"})
- @Get("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> list(
- @HostParam("$host") String endpoint,
- @PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @HeaderParam("Accept") String accept,
- Context context);
-
- @Headers({"Content-Type: application/json"})
+ public interface LinkersService {
+ @Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}")
- @ExpectedResponses({200})
+ @ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> get(
- @HostParam("$host") String endpoint,
+ Mono> get(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @PathParam("linkerName") String linkerName,
- @HeaderParam("Accept") String accept,
- Context context);
+ @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
+ @HeaderParam("Accept") String accept, Context context);
- @Headers({"Content-Type: application/json"})
+ @Headers({ "Content-Type: application/json" })
@Put("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}")
- @ExpectedResponses({200, 201})
+ @ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> createOrUpdate(
- @HostParam("$host") String endpoint,
+ Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @PathParam("linkerName") String linkerName,
- @BodyParam("application/json") LinkerResourceInner parameters,
- @HeaderParam("Accept") String accept,
+ @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
+ @BodyParam("application/json") LinkerResourceInner parameters, @HeaderParam("Accept") String accept,
Context context);
- @Headers({"Content-Type: application/json"})
+ @Headers({ "Content-Type: application/json" })
@Delete("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}")
- @ExpectedResponses({200, 202, 204})
+ @ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> delete(
- @HostParam("$host") String endpoint,
+ Mono>> delete(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @PathParam("linkerName") String linkerName,
- @HeaderParam("Accept") String accept,
- Context context);
+ @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
+ @HeaderParam("Accept") String accept, Context context);
- @Headers({"Content-Type: application/json"})
+ @Headers({ "Content-Type: application/json" })
@Patch("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}")
- @ExpectedResponses({200, 201})
+ @ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> update(
- @HostParam("$host") String endpoint,
+ Mono>> update(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @PathParam("linkerName") String linkerName,
- @BodyParam("application/json") LinkerPatch parameters,
- @HeaderParam("Accept") String accept,
+ @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
+ @BodyParam("application/json") LinkerPatch parameters, @HeaderParam("Accept") String accept,
Context context);
- @Headers({"Content-Type: application/json"})
+ @Headers({ "Content-Type: application/json" })
@Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker")
- @ExpectedResponses({200, 202})
+ @ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> validate(
- @HostParam("$host") String endpoint,
+ Mono>> validate(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @PathParam("linkerName") String linkerName,
- @HeaderParam("Accept") String accept,
- Context context);
+ @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
+ @HeaderParam("Accept") String accept, Context context);
- @Headers({"Content-Type: application/json"})
+ @Headers({ "Content-Type: application/json" })
@Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations")
- @ExpectedResponses({200})
+ @ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listConfigurations(
- @HostParam("$host") String endpoint,
+ Mono> listConfigurations(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
- @QueryParam("api-version") String apiVersion,
- @PathParam("linkerName") String linkerName,
- @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 list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(String resourceUri) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(
- context ->
- service.list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(String resourceUri, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceUri == null) {
- return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .list(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)
- .map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null));
- }
-
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri) {
- return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink));
- }
-
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(String resourceUri, Context context) {
- return new PagedFlux<>(
- () -> listSinglePageAsync(resourceUri, context), nextLink -> listNextSinglePageAsync(nextLink, context));
- }
-
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable list(String resourceUri) {
- return new PagedIterable<>(listAsync(resourceUri));
- }
-
- /**
- * Returns list of Linkers which connects to the resource.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable list(String resourceUri, Context context) {
- return new PagedIterable<>(listAsync(resourceUri, context));
+ @QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response} on successful completion of {@link
- * Mono}.
+ * @return linker of source and target resource along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceUri, String linkerName) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -323,39 +151,29 @@ private Mono> getWithResponseAsync(String resource
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context ->
- service
- .get(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- accept,
- context))
+ .withContext(context -> service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(),
+ linkerName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response} on successful completion of {@link
- * Mono}.
+ * @return linker of source and target resource along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getWithResponseAsync(
- String resourceUri, String linkerName, Context context) {
+ private Mono> getWithResponseAsync(String resourceUri, String linkerName,
+ Context context) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -365,13 +183,13 @@ private Mono> getWithResponseAsync(
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service
- .get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, context);
+ return service.get(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept,
+ context);
}
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -386,55 +204,53 @@ private Mono getAsync(String resourceUri, String linkerName
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource.
+ * @return linker of source and target resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public LinkerResourceInner get(String resourceUri, String linkerName) {
- return getAsync(resourceUri, linkerName).block();
+ public Response getWithResponse(String resourceUri, String linkerName, Context context) {
+ return getWithResponseAsync(resourceUri, linkerName, context).block();
}
/**
* Returns Linker resource for a given name.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response}.
+ * @return linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getWithResponse(String resourceUri, String linkerName, Context context) {
- return getWithResponseAsync(resourceUri, linkerName, context).block();
+ public LinkerResourceInner get(String resourceUri, String linkerName) {
+ return getWithResponse(resourceUri, linkerName, Context.NONE).getValue();
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response} on successful completion of {@link
- * Mono}.
+ * @return linker of source and target resource along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> createOrUpdateWithResponseAsync(
- String resourceUri, String linkerName, LinkerResourceInner parameters) {
+ private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String linkerName,
+ LinkerResourceInner parameters) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -449,23 +265,14 @@ private Mono>> createOrUpdateWithResponseAsync(
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context ->
- service
- .createOrUpdate(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- parameters,
- accept,
- context))
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), linkerName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -473,17 +280,15 @@ private Mono>> createOrUpdateWithResponseAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response} on successful completion of {@link
- * Mono}.
+ * @return linker of source and target resource along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> createOrUpdateWithResponseAsync(
- String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) {
+ private Mono>> createOrUpdateWithResponseAsync(String resourceUri, String linkerName,
+ LinkerResourceInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -498,20 +303,13 @@ private Mono>> createOrUpdateWithResponseAsync(
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service
- .createOrUpdate(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- parameters,
- accept,
- context);
+ return service.createOrUpdate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName,
+ parameters, accept, context);
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -521,22 +319,16 @@ private Mono>> createOrUpdateWithResponseAsync(
* @return the {@link PollerFlux} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync(
- String resourceUri, String linkerName, LinkerResourceInner parameters) {
+ private PollerFlux, LinkerResourceInner>
+ beginCreateOrUpdateAsync(String resourceUri, String linkerName, LinkerResourceInner parameters) {
Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, linkerName, parameters);
- return this
- .client
- .getLroResult(
- mono,
- this.client.getHttpPipeline(),
- LinkerResourceInner.class,
- LinkerResourceInner.class,
- this.client.getContext());
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ LinkerResourceInner.class, LinkerResourceInner.class, this.client.getContext());
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -550,17 +342,15 @@ private PollerFlux, LinkerResourceInner> beginCr
private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync(
String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) {
context = this.client.mergeContext(context);
- Mono>> mono =
- createOrUpdateWithResponseAsync(resourceUri, linkerName, parameters, context);
- return this
- .client
- .getLroResult(
- mono, this.client.getHttpPipeline(), LinkerResourceInner.class, LinkerResourceInner.class, context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceUri, linkerName, parameters, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ LinkerResourceInner.class, LinkerResourceInner.class, context);
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -570,14 +360,14 @@ private PollerFlux, LinkerResourceInner> beginCr
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(
- String resourceUri, String linkerName, LinkerResourceInner parameters) {
- return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters).getSyncPoller();
+ public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri,
+ String linkerName, LinkerResourceInner parameters) {
+ return this.beginCreateOrUpdateAsync(resourceUri, linkerName, parameters).getSyncPoller();
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -588,14 +378,14 @@ public SyncPoller, LinkerResourceInner> beginCre
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(
- String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) {
- return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters, context).getSyncPoller();
+ public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String resourceUri,
+ String linkerName, LinkerResourceInner parameters, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceUri, linkerName, parameters, context).getSyncPoller();
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -605,16 +395,15 @@ public SyncPoller, LinkerResourceInner> beginCre
* @return linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono createOrUpdateAsync(
- String resourceUri, String linkerName, LinkerResourceInner parameters) {
- return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters)
- .last()
+ private Mono createOrUpdateAsync(String resourceUri, String linkerName,
+ LinkerResourceInner parameters) {
+ return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -625,16 +414,15 @@ private Mono createOrUpdateAsync(
* @return linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono createOrUpdateAsync(
- String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) {
- return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters, context)
- .last()
+ private Mono createOrUpdateAsync(String resourceUri, String linkerName,
+ LinkerResourceInner parameters, Context context) {
+ return beginCreateOrUpdateAsync(resourceUri, linkerName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -650,7 +438,7 @@ public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName,
/**
* Create or update linker resource.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -661,14 +449,14 @@ public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName,
* @return linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public LinkerResourceInner createOrUpdate(
- String resourceUri, String linkerName, LinkerResourceInner parameters, Context context) {
+ public LinkerResourceInner createOrUpdate(String resourceUri, String linkerName, LinkerResourceInner parameters,
+ Context context) {
return createOrUpdateAsync(resourceUri, linkerName, parameters, context).block();
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -679,10 +467,8 @@ public LinkerResourceInner createOrUpdate(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceUri, String linkerName) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -692,22 +478,14 @@ private Mono>> deleteWithResponseAsync(String resource
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context ->
- service
- .delete(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- accept,
- context))
+ .withContext(context -> service.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(),
+ linkerName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -717,13 +495,11 @@ private Mono>> deleteWithResponseAsync(String resource
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> deleteWithResponseAsync(
- String resourceUri, String linkerName, Context context) {
+ private Mono>> deleteWithResponseAsync(String resourceUri, String linkerName,
+ Context context) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -733,13 +509,13 @@ private Mono>> deleteWithResponseAsync(
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service
- .delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, context);
+ return service.delete(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept,
+ context);
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -750,15 +526,13 @@ private Mono>> deleteWithResponseAsync(
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceUri, String linkerName) {
Mono>> mono = deleteWithResponseAsync(resourceUri, linkerName);
- return this
- .client
- .getLroResult(
- mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -768,18 +542,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceUri,
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, Void> beginDeleteAsync(
- String resourceUri, String linkerName, Context context) {
+ private PollerFlux, Void> beginDeleteAsync(String resourceUri, String linkerName,
+ Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteWithResponseAsync(resourceUri, linkerName, context);
- return this
- .client
- .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -789,12 +562,12 @@ private PollerFlux, Void> beginDeleteAsync(
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceUri, String linkerName) {
- return beginDeleteAsync(resourceUri, linkerName).getSyncPoller();
+ return this.beginDeleteAsync(resourceUri, linkerName).getSyncPoller();
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -805,12 +578,12 @@ public SyncPoller, Void> beginDelete(String resourceUri, String
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceUri, String linkerName, Context context) {
- return beginDeleteAsync(resourceUri, linkerName, context).getSyncPoller();
+ return this.beginDeleteAsync(resourceUri, linkerName, context).getSyncPoller();
}
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -825,7 +598,7 @@ private Mono deleteAsync(String resourceUri, String linkerName) {
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -841,7 +614,7 @@ private Mono deleteAsync(String resourceUri, String linkerName, Context co
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -855,7 +628,7 @@ public void delete(String resourceUri, String linkerName) {
/**
* Delete a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -870,24 +643,22 @@ public void delete(String resourceUri, String linkerName, Context context) {
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response} on successful completion of {@link
- * Mono}.
+ * @return linker of source and target resource along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> updateWithResponseAsync(
- String resourceUri, String linkerName, LinkerPatch parameters) {
+ private Mono>> updateWithResponseAsync(String resourceUri, String linkerName,
+ LinkerPatch parameters) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -902,23 +673,14 @@ private Mono>> updateWithResponseAsync(
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context ->
- service
- .update(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- parameters,
- accept,
- context))
+ .withContext(context -> service.update(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(),
+ linkerName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -926,17 +688,15 @@ private Mono>> updateWithResponseAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return linker of source and target resource along with {@link Response} on successful completion of {@link
- * Mono}.
+ * @return linker of source and target resource along with {@link Response} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> updateWithResponseAsync(
- String resourceUri, String linkerName, LinkerPatch parameters, Context context) {
+ private Mono>> updateWithResponseAsync(String resourceUri, String linkerName,
+ LinkerPatch parameters, Context context) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -951,20 +711,13 @@ private Mono>> updateWithResponseAsync(
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service
- .update(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- parameters,
- accept,
- context);
+ return service.update(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName,
+ parameters, accept, context);
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -974,22 +727,16 @@ private Mono>> updateWithResponseAsync(
* @return the {@link PollerFlux} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, LinkerResourceInner> beginUpdateAsync(
- String resourceUri, String linkerName, LinkerPatch parameters) {
+ private PollerFlux, LinkerResourceInner> beginUpdateAsync(String resourceUri,
+ String linkerName, LinkerPatch parameters) {
Mono>> mono = updateWithResponseAsync(resourceUri, linkerName, parameters);
- return this
- .client
- .getLroResult(
- mono,
- this.client.getHttpPipeline(),
- LinkerResourceInner.class,
- LinkerResourceInner.class,
- this.client.getContext());
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ LinkerResourceInner.class, LinkerResourceInner.class, this.client.getContext());
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1000,19 +747,17 @@ private PollerFlux, LinkerResourceInner> beginUp
* @return the {@link PollerFlux} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, LinkerResourceInner> beginUpdateAsync(
- String resourceUri, String linkerName, LinkerPatch parameters, Context context) {
+ private PollerFlux, LinkerResourceInner> beginUpdateAsync(String resourceUri,
+ String linkerName, LinkerPatch parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateWithResponseAsync(resourceUri, linkerName, parameters, context);
- return this
- .client
- .getLroResult(
- mono, this.client.getHttpPipeline(), LinkerResourceInner.class, LinkerResourceInner.class, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ LinkerResourceInner.class, LinkerResourceInner.class, context);
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1022,14 +767,14 @@ private PollerFlux, LinkerResourceInner> beginUp
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, LinkerResourceInner> beginUpdate(
- String resourceUri, String linkerName, LinkerPatch parameters) {
- return beginUpdateAsync(resourceUri, linkerName, parameters).getSyncPoller();
+ public SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri,
+ String linkerName, LinkerPatch parameters) {
+ return this.beginUpdateAsync(resourceUri, linkerName, parameters).getSyncPoller();
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1040,14 +785,14 @@ public SyncPoller, LinkerResourceInner> beginUpd
* @return the {@link SyncPoller} for polling of linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, LinkerResourceInner> beginUpdate(
- String resourceUri, String linkerName, LinkerPatch parameters, Context context) {
- return beginUpdateAsync(resourceUri, linkerName, parameters, context).getSyncPoller();
+ public SyncPoller, LinkerResourceInner> beginUpdate(String resourceUri,
+ String linkerName, LinkerPatch parameters, Context context) {
+ return this.beginUpdateAsync(resourceUri, linkerName, parameters, context).getSyncPoller();
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1058,14 +803,13 @@ public SyncPoller, LinkerResourceInner> beginUpd
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceUri, String linkerName, LinkerPatch parameters) {
- return beginUpdateAsync(resourceUri, linkerName, parameters)
- .last()
+ return beginUpdateAsync(resourceUri, linkerName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1076,16 +820,15 @@ private Mono updateAsync(String resourceUri, String linkerN
* @return linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono updateAsync(
- String resourceUri, String linkerName, LinkerPatch parameters, Context context) {
- return beginUpdateAsync(resourceUri, linkerName, parameters, context)
- .last()
+ private Mono updateAsync(String resourceUri, String linkerName, LinkerPatch parameters,
+ Context context) {
+ return beginUpdateAsync(resourceUri, linkerName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1101,7 +844,7 @@ public LinkerResourceInner update(String resourceUri, String linkerName, LinkerP
/**
* Operation to update an existing link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Linker details.
@@ -1118,22 +861,20 @@ public LinkerResourceInner update(String resourceUri, String linkerName, LinkerP
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the validation operation result for a linker along with {@link Response} on successful completion of
- * {@link Mono}.
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> validateWithResponseAsync(String resourceUri, String linkerName) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -1143,22 +884,14 @@ private Mono>> validateWithResponseAsync(String resour
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context ->
- service
- .validate(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- accept,
- context))
+ .withContext(context -> service.validate(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), linkerName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1166,16 +899,14 @@ private Mono>> validateWithResponseAsync(String resour
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the validation operation result for a linker along with {@link Response} on successful completion of
- * {@link Mono}.
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> validateWithResponseAsync(
- String resourceUri, String linkerName, Context context) {
+ private Mono>> validateWithResponseAsync(String resourceUri, String linkerName,
+ Context context) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -1185,13 +916,13 @@ private Mono>> validateWithResponseAsync(
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service
- .validate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, context);
+ return service.validate(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept,
+ context);
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -1200,22 +931,17 @@ private Mono>> validateWithResponseAsync(
* @return the {@link PollerFlux} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, ValidateOperationResultInner> beginValidateAsync(
- String resourceUri, String linkerName) {
+ private PollerFlux, ValidateOperationResultInner>
+ beginValidateAsync(String resourceUri, String linkerName) {
Mono>> mono = validateWithResponseAsync(resourceUri, linkerName);
- return this
- .client
- .getLroResult(
- mono,
- this.client.getHttpPipeline(),
- ValidateOperationResultInner.class,
- ValidateOperationResultInner.class,
- this.client.getContext());
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class,
+ this.client.getContext());
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1225,23 +951,18 @@ private PollerFlux, ValidateOperationRe
* @return the {@link PollerFlux} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, ValidateOperationResultInner> beginValidateAsync(
- String resourceUri, String linkerName, Context context) {
+ private PollerFlux, ValidateOperationResultInner>
+ beginValidateAsync(String resourceUri, String linkerName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = validateWithResponseAsync(resourceUri, linkerName, context);
- return this
- .client
- .getLroResult(
- mono,
- this.client.getHttpPipeline(),
- ValidateOperationResultInner.class,
- ValidateOperationResultInner.class,
- context);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class,
+ context);
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -1250,14 +971,14 @@ private PollerFlux, ValidateOperationRe
* @return the {@link SyncPoller} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, ValidateOperationResultInner> beginValidate(
- String resourceUri, String linkerName) {
- return beginValidateAsync(resourceUri, linkerName).getSyncPoller();
+ public SyncPoller, ValidateOperationResultInner>
+ beginValidate(String resourceUri, String linkerName) {
+ return this.beginValidateAsync(resourceUri, linkerName).getSyncPoller();
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1267,14 +988,14 @@ public SyncPoller, ValidateOperationRes
* @return the {@link SyncPoller} for polling of the validation operation result for a linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, ValidateOperationResultInner> beginValidate(
- String resourceUri, String linkerName, Context context) {
- return beginValidateAsync(resourceUri, linkerName, context).getSyncPoller();
+ public SyncPoller, ValidateOperationResultInner>
+ beginValidate(String resourceUri, String linkerName, Context context) {
+ return this.beginValidateAsync(resourceUri, linkerName, context).getSyncPoller();
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -1289,7 +1010,7 @@ private Mono validateAsync(String resourceUri, Str
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1300,14 +1021,13 @@ private Mono validateAsync(String resourceUri, Str
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono validateAsync(String resourceUri, String linkerName, Context context) {
- return beginValidateAsync(resourceUri, linkerName, context)
- .last()
+ return beginValidateAsync(resourceUri, linkerName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -1322,7 +1042,7 @@ public ValidateOperationResultInner validate(String resourceUri, String linkerNa
/**
* Validate a link.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1338,23 +1058,21 @@ public ValidateOperationResultInner validate(String resourceUri, String linkerNa
/**
* list source configurations for a linker.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
- * {@link Response} on successful completion of {@link Mono}.
+ * {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listConfigurationsWithResponseAsync(
- String resourceUri, String linkerName) {
+ private Mono> listConfigurationsWithResponseAsync(String resourceUri,
+ String linkerName) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -1364,22 +1082,14 @@ private Mono> listConfigurationsWithRes
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context ->
- service
- .listConfigurations(
- this.client.getEndpoint(),
- resourceUri,
- this.client.getApiVersion(),
- linkerName,
- accept,
- context))
+ .withContext(context -> service.listConfigurations(this.client.getEndpoint(), resourceUri,
+ this.client.getApiVersion(), linkerName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* list source configurations for a linker.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1387,16 +1097,14 @@ private Mono> listConfigurationsWithRes
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
- * {@link Response} on successful completion of {@link Mono}.
+ * {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listConfigurationsWithResponseAsync(
- String resourceUri, String linkerName, Context context) {
+ private Mono> listConfigurationsWithResponseAsync(String resourceUri,
+ String linkerName, Context context) {
if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
@@ -1406,21 +1114,20 @@ private Mono> listConfigurationsWithRes
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service
- .listConfigurations(
- this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), linkerName, accept, context);
+ return service.listConfigurations(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(),
+ linkerName, accept, context);
}
/**
* list source configurations for a linker.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings on
- * successful completion of {@link Mono}.
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listConfigurationsAsync(String resourceUri, String linkerName) {
@@ -1430,22 +1137,7 @@ private Mono listConfigurationsAsync(String reso
/**
* list source configurations for a linker.
- *
- * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
- * @param linkerName The name Linker resource.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return configurations for source resource, include appSettings, connectionString and serviceBindings.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName) {
- return listConfigurationsAsync(resourceUri, linkerName).block();
- }
-
- /**
- * list source configurations for a linker.
- *
+ *
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param context The context to associate with this operation.
@@ -1453,82 +1145,26 @@ public SourceConfigurationResultInner listConfigurations(String resourceUri, Str
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
- * {@link Response}.
+ * {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response listConfigurationsWithResponse(
- String resourceUri, String linkerName, Context context) {
+ public Response listConfigurationsWithResponse(String resourceUri,
+ String linkerName, Context context) {
return listConfigurationsWithResponseAsync(resourceUri, linkerName, context).block();
}
/**
- * Get the next page of items.
- *
- * @param nextLink The nextLink parameter.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Get the next page of items.
- *
- * @param nextLink The nextLink parameter.
- * @param context The context to associate with this operation.
+ * list source configurations for a linker.
+ *
+ * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
+ * @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return configurations for source resource, include appSettings, connectionString and serviceBindings.
*/
@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));
+ public SourceConfigurationResultInner listConfigurations(String resourceUri, String linkerName) {
+ return listConfigurationsWithResponse(resourceUri, linkerName, Context.NONE).getValue();
}
}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java
index 75322fa6ef05..d44f10d94927 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/LinkersImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.servicelinker.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;
@@ -25,39 +24,26 @@ public final class LinkersImpl implements Linkers {
private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager;
- public LinkersImpl(
- LinkersClient innerClient, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) {
+ public LinkersImpl(LinkersClient innerClient,
+ com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
- public PagedIterable list(String resourceUri) {
- PagedIterable inner = this.serviceClient().list(resourceUri);
- return Utils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager()));
- }
-
- public PagedIterable list(String resourceUri, Context context) {
- PagedIterable inner = this.serviceClient().list(resourceUri, context);
- return Utils.mapPage(inner, inner1 -> new LinkerResourceImpl(inner1, this.manager()));
- }
-
- public LinkerResource get(String resourceUri, String linkerName) {
- LinkerResourceInner inner = this.serviceClient().get(resourceUri, linkerName);
+ public Response getWithResponse(String resourceUri, String linkerName, Context context) {
+ Response inner = this.serviceClient().getWithResponse(resourceUri, linkerName, context);
if (inner != null) {
- return new LinkerResourceImpl(inner, this.manager());
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new LinkerResourceImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
- public Response getWithResponse(String resourceUri, String linkerName, Context context) {
- Response inner = this.serviceClient().getWithResponse(resourceUri, linkerName, context);
+ public LinkerResource get(String resourceUri, String linkerName) {
+ LinkerResourceInner inner = this.serviceClient().get(resourceUri, linkerName);
if (inner != null) {
- return new SimpleResponse<>(
- inner.getRequest(),
- inner.getStatusCode(),
- inner.getHeaders(),
- new LinkerResourceImpl(inner.getValue(), this.manager()));
+ return new LinkerResourceImpl(inner, this.manager());
} else {
return null;
}
@@ -89,122 +75,87 @@ public ValidateOperationResult validate(String resourceUri, String linkerName, C
}
}
- public SourceConfigurationResult listConfigurations(String resourceUri, String linkerName) {
- SourceConfigurationResultInner inner = this.serviceClient().listConfigurations(resourceUri, linkerName);
+ public Response listConfigurationsWithResponse(String resourceUri, String linkerName,
+ Context context) {
+ Response inner
+ = this.serviceClient().listConfigurationsWithResponse(resourceUri, linkerName, context);
if (inner != null) {
- return new SourceConfigurationResultImpl(inner, this.manager());
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new SourceConfigurationResultImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
- public Response listConfigurationsWithResponse(
- String resourceUri, String linkerName, Context context) {
- Response inner =
- this.serviceClient().listConfigurationsWithResponse(resourceUri, linkerName, context);
+ public SourceConfigurationResult listConfigurations(String resourceUri, String linkerName) {
+ SourceConfigurationResultInner inner = this.serviceClient().listConfigurations(resourceUri, linkerName);
if (inner != null) {
- return new SimpleResponse<>(
- inner.getRequest(),
- inner.getStatusCode(),
- inner.getHeaders(),
- new SourceConfigurationResultImpl(inner.getValue(), this.manager()));
+ return new SourceConfigurationResultImpl(inner, this.manager());
} else {
return null;
}
}
public LinkerResource getById(String id) {
- String resourceUri =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
+ String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
if (resourceUri == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
}
- String linkerName =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
+ String linkerName = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
if (linkerName == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
}
return this.getWithResponse(resourceUri, linkerName, Context.NONE).getValue();
}
public Response getByIdWithResponse(String id, Context context) {
- String resourceUri =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
+ String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
if (resourceUri == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
}
- String linkerName =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
+ String linkerName = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
if (linkerName == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
}
return this.getWithResponse(resourceUri, linkerName, context);
}
public void deleteById(String id) {
- String resourceUri =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
+ String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
if (resourceUri == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
}
- String linkerName =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
+ String linkerName = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
if (linkerName == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
}
this.delete(resourceUri, linkerName, Context.NONE);
}
public void deleteByIdWithResponse(String id, Context context) {
- String resourceUri =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
+ String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "resourceUri");
if (resourceUri == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id)));
}
- String linkerName =
- Utils
- .getValueFromIdByParameterName(
- id, "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
+ String linkerName = ResourceManagerUtils.getValueFromIdByParameterName(id,
+ "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", "linkerName");
if (linkerName == null) {
- throw LOGGER
- .logExceptionAsError(
- new IllegalArgumentException(
- String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'linkers'.", id)));
}
this.delete(resourceUri, linkerName, context);
}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationImpl.java
deleted file mode 100644
index efdd8fc80cd2..000000000000
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.servicelinker.implementation;
-
-import com.azure.resourcemanager.servicelinker.fluent.models.OperationInner;
-import com.azure.resourcemanager.servicelinker.models.ActionType;
-import com.azure.resourcemanager.servicelinker.models.Operation;
-import com.azure.resourcemanager.servicelinker.models.OperationDisplay;
-import com.azure.resourcemanager.servicelinker.models.Origin;
-
-public final class OperationImpl implements Operation {
- private OperationInner innerObject;
-
- private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager;
-
- OperationImpl(
- OperationInner innerObject, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public String name() {
- return this.innerModel().name();
- }
-
- public Boolean isDataAction() {
- return this.innerModel().isDataAction();
- }
-
- public OperationDisplay display() {
- return this.innerModel().display();
- }
-
- public Origin origin() {
- return this.innerModel().origin();
- }
-
- public ActionType actionType() {
- return this.innerModel().actionType();
- }
-
- public OperationInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java
deleted file mode 100644
index fdd4c7907423..000000000000
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsClientImpl.java
+++ /dev/null
@@ -1,274 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.servicelinker.implementation;
-
-import com.azure.core.annotation.ExpectedResponses;
-import com.azure.core.annotation.Get;
-import com.azure.core.annotation.HeaderParam;
-import com.azure.core.annotation.Headers;
-import com.azure.core.annotation.Host;
-import com.azure.core.annotation.HostParam;
-import com.azure.core.annotation.PathParam;
-import com.azure.core.annotation.QueryParam;
-import com.azure.core.annotation.ReturnType;
-import com.azure.core.annotation.ServiceInterface;
-import com.azure.core.annotation.ServiceMethod;
-import com.azure.core.annotation.UnexpectedResponseExceptionType;
-import com.azure.core.http.rest.PagedFlux;
-import com.azure.core.http.rest.PagedIterable;
-import com.azure.core.http.rest.PagedResponse;
-import com.azure.core.http.rest.PagedResponseBase;
-import com.azure.core.http.rest.Response;
-import com.azure.core.http.rest.RestProxy;
-import com.azure.core.management.exception.ManagementException;
-import com.azure.core.util.Context;
-import com.azure.core.util.FluxUtil;
-import com.azure.resourcemanager.servicelinker.fluent.OperationsClient;
-import com.azure.resourcemanager.servicelinker.fluent.models.OperationInner;
-import com.azure.resourcemanager.servicelinker.models.OperationListResult;
-import reactor.core.publisher.Mono;
-
-/** An instance of this class provides access to all the operations defined in OperationsClient. */
-public final class OperationsClientImpl implements OperationsClient {
- /** The proxy service used to perform REST calls. */
- private final OperationsService service;
-
- /** The service client containing this operation class. */
- private final ServiceLinkerManagementClientImpl client;
-
- /**
- * Initializes an instance of OperationsClientImpl.
- *
- * @param client the instance of the service client containing this operation class.
- */
- OperationsClientImpl(ServiceLinkerManagementClientImpl client) {
- this.service =
- RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
- this.client = client;
- }
-
- /**
- * The interface defining all the services for ServiceLinkerManagementClientOperations to be used by the proxy
- * service to perform REST calls.
- */
- @Host("{$host}")
- @ServiceInterface(name = "ServiceLinkerManagem")
- private interface OperationsService {
- @Headers({"Content-Type: application/json"})
- @Get("/providers/Microsoft.ServiceLinker/operations")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> list(
- @HostParam("$host") String endpoint,
- @QueryParam("api-version") String apiVersion,
- @HeaderParam("Accept") String accept,
- Context context);
-
- @Headers({"Content-Type: application/json"})
- @Get("{nextLink}")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink,
- @HostParam("$host") String endpoint,
- @HeaderParam("Accept") String accept,
- Context context);
- }
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
- * successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync() {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(
- context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
- * successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
- .map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null));
- }
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync() {
- return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
- }
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(Context context) {
- return new PagedFlux<>(
- () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
- }
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable list() {
- return new PagedIterable<>(listAsync());
- }
-
- /**
- * Lists the available ServiceLinker REST API operations.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
- * PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable list(Context context) {
- return new PagedIterable<>(listAsync(context));
- }
-
- /**
- * Get the next page of items.
- *
- * @param nextLink The nextLink parameter.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
- * successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Get the next page of items.
- *
- * @param nextLink The nextLink parameter.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
- * successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink, Context context) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null));
- }
-}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsImpl.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsImpl.java
deleted file mode 100644
index f0c8895b3988..000000000000
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/OperationsImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.servicelinker.implementation;
-
-import com.azure.core.http.rest.PagedIterable;
-import com.azure.core.util.Context;
-import com.azure.core.util.logging.ClientLogger;
-import com.azure.resourcemanager.servicelinker.fluent.OperationsClient;
-import com.azure.resourcemanager.servicelinker.fluent.models.OperationInner;
-import com.azure.resourcemanager.servicelinker.models.Operation;
-import com.azure.resourcemanager.servicelinker.models.Operations;
-
-public final class OperationsImpl implements Operations {
- private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
-
- private final OperationsClient innerClient;
-
- private final com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager;
-
- public OperationsImpl(
- OperationsClient innerClient, com.azure.resourcemanager.servicelinker.ServiceLinkerManager serviceManager) {
- this.innerClient = innerClient;
- this.serviceManager = serviceManager;
- }
-
- public PagedIterable list() {
- PagedIterable inner = this.serviceClient().list();
- return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
- }
-
- public PagedIterable list(Context context) {
- PagedIterable inner = this.serviceClient().list(context);
- return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
- }
-
- private OperationsClient serviceClient() {
- return this.innerClient;
- }
-
- private com.azure.resourcemanager.servicelinker.ServiceLinkerManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/Utils.java b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ResourceManagerUtils.java
similarity index 79%
rename from sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/Utils.java
rename to sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ResourceManagerUtils.java
index 665bda23b8d0..ab62db30789e 100644
--- a/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/Utils.java
+++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/src/main/java/com/azure/resourcemanager/servicelinker/implementation/ResourceManagerUtils.java
@@ -19,7 +19,10 @@
import java.util.stream.Stream;
import reactor.core.publisher.Flux;
-final class Utils {
+final class ResourceManagerUtils {
+ private ResourceManagerUtils() {
+ }
+
static String getValueFromIdByName(String id, String name) {
if (id == null) {
return null;
@@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) {
}
}
return null;
+
}
static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
@@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri
segments.add(idSegment);
idItrReverted.forEachRemaining(segments::add);
Collections.reverse(segments);
- if (segments.size() > 0 && segments.get(0).isEmpty()) {
+ if (!segments.isEmpty() && segments.get(0).isEmpty()) {
segments.remove(0);
}
return String.join("/", segments);
@@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri
}
}
return null;
+
}
static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
- return new PagedIterableImpl(pageIterable, mapper);
+ return new PagedIterableImpl<>(pageIterable, mapper);
}
private static final class PagedIterableImpl extends PagedIterable {
@@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable {
private final Function, PagedResponse> pageMapper;
private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
- super(
- PagedFlux
- .create(
- () ->
- (continuationToken, pageSize) ->
- Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux
+ .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
this.pagedIterable = pagedIterable;
this.mapper = mapper;
this.pageMapper = getPageMapper(mapper);
}
private static Function, PagedResponse> getPageMapper(Function mapper) {
- return page ->
- new PagedResponseBase(
- page.getRequest(),
- page.getStatusCode(),
- page.getHeaders(),
- page.getElements().stream().map(mapper).collect(Collectors.toList()),
- page.getContinuationToken(),
- null);
+ return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(),
+ null);
}
@Override
@@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe
@Override
public Iterator iterator() {
- return new IteratorImpl(pagedIterable.iterator(), mapper);
+ return new IteratorImpl<>(pagedIterable.iterator(), mapper);
}
@Override
public Iterable> iterableByPage() {
- return new IterableImpl, PagedResponse