Skip to content

Commit

Permalink
CodeGen from PR 18203 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 34d56cf69bd664f1605e6126e7d073b2f8de328a into 1cda8f7fe56ac1835ff31aa3b8ffe027c8f9c3ed
  • Loading branch information
SDKAuto committed Mar 14, 2022
1 parent f2dee34 commit 835873f
Show file tree
Hide file tree
Showing 134 changed files with 712 additions and 976 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-03-14)

- Azure Resource Manager ServiceFabric client library for Java. This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-servicefabric</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
161 changes: 59 additions & 102 deletions sdk/servicefabric/azure-resourcemanager-servicefabric/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand Down Expand Up @@ -41,6 +42,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/** Entry point to ServiceFabricManager. Service Fabric Management Client. */
public final class ServiceFabricManager {
Expand Down Expand Up @@ -96,7 +98,7 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
Expand Down Expand Up @@ -170,9 +172,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -194,7 +198,7 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil
.append("-")
.append("com.azure.resourcemanager.servicefabric")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -217,11 +221,24 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ApplicationTypeVersionResourceInner get(
* @throws com.azure.core.management.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 Service Fabric application type version resource created or in the process of being created in the
* Service Fabric application type name resource.
* Service Fabric application type name resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationTypeVersionResourceInner> getWithResponse(
Expand All @@ -63,9 +63,10 @@ Response<ApplicationTypeVersionResourceInner> getWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an application type version resource for the specified application type name resource.
* @return the {@link SyncPoller} for polling of an application type version resource for the specified application
* type name resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ApplicationTypeVersionResourceInner>, ApplicationTypeVersionResourceInner>
beginCreateOrUpdate(
String resourceGroupName,
Expand All @@ -86,9 +87,10 @@ Response<ApplicationTypeVersionResourceInner> getWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an application type version resource for the specified application type name resource.
* @return the {@link SyncPoller} for polling of an application type version resource for the specified application
* type name resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ApplicationTypeVersionResourceInner>, ApplicationTypeVersionResourceInner>
beginCreateOrUpdate(
String resourceGroupName,
Expand Down Expand Up @@ -152,9 +154,9 @@ ApplicationTypeVersionResourceInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String clusterName, String applicationTypeName, String version);

Expand All @@ -169,9 +171,9 @@ SyncPoller<PollResult<Void>, Void> beginDelete(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String clusterName, String applicationTypeName, String version, Context context);

Expand Down Expand Up @@ -234,7 +236,7 @@ ApplicationTypeVersionResourceListInner list(
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return all application type version resources created or in the process of being created in the Service Fabric
* application type name resource.
* application type name resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationTypeVersionResourceListInner> listWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface ApplicationTypesClient {
* @throws com.azure.core.management.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 Service Fabric application type name resource created or in the process of being created in the Service
* Fabric cluster resource.
* Fabric cluster resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationTypeResourceInner> getWithResponse(
Expand Down Expand Up @@ -79,7 +79,7 @@ ApplicationTypeResourceInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 application type name resource.
* @return the application type name resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationTypeResourceInner> createOrUpdateWithResponse(
Expand All @@ -98,9 +98,9 @@ Response<ApplicationTypeResourceInner> createOrUpdateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String clusterName, String applicationTypeName);

Expand All @@ -114,9 +114,9 @@ SyncPoller<PollResult<Void>, Void> beginDelete(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String clusterName, String applicationTypeName, Context context);

Expand Down Expand Up @@ -173,7 +173,7 @@ SyncPoller<PollResult<Void>, Void> beginDelete(
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return all application type name resources created or in the process of being created in the Service Fabric
* cluster resource.
* cluster resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationTypeResourceListInner> listWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public interface ApplicationsClient {
* @throws com.azure.core.management.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 Service Fabric application resource created or in the process of being created in the Service Fabric
* cluster resource.
* cluster resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationResourceInner> getWithResponse(
Expand All @@ -60,9 +60,9 @@ Response<ApplicationResourceInner> getWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 application resource.
* @return the {@link SyncPoller} for polling of the application resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ApplicationResourceInner>, ApplicationResourceInner> beginCreateOrUpdate(
String resourceGroupName, String clusterName, String applicationName, ApplicationResourceInner parameters);

Expand All @@ -77,9 +77,9 @@ SyncPoller<PollResult<ApplicationResourceInner>, ApplicationResourceInner> begin
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 application resource.
* @return the {@link SyncPoller} for polling of the application resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ApplicationResourceInner>, ApplicationResourceInner> beginCreateOrUpdate(
String resourceGroupName,
String clusterName,
Expand Down Expand Up @@ -134,9 +134,9 @@ ApplicationResourceInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 application resource.
* @return the {@link SyncPoller} for polling of the application resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ApplicationResourceInner>, ApplicationResourceInner> beginUpdate(
String resourceGroupName, String clusterName, String applicationName, ApplicationResourceUpdate parameters);

Expand All @@ -151,9 +151,9 @@ SyncPoller<PollResult<ApplicationResourceInner>, ApplicationResourceInner> begin
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 application resource.
* @return the {@link SyncPoller} for polling of the application resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<ApplicationResourceInner>, ApplicationResourceInner> beginUpdate(
String resourceGroupName,
String clusterName,
Expand Down Expand Up @@ -207,9 +207,9 @@ ApplicationResourceInner update(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String clusterName, String applicationName);

Expand All @@ -223,9 +223,9 @@ SyncPoller<PollResult<Void>, Void> beginDelete(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.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 completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String clusterName, String applicationName, Context context);

Expand Down Expand Up @@ -280,7 +280,7 @@ SyncPoller<PollResult<Void>, Void> beginDelete(
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return all application resources created or in the process of being created in the Service Fabric cluster
* resource.
* resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationResourceListInner> listWithResponse(
Expand Down
Loading

0 comments on commit 835873f

Please sign in to comment.