Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgmt regen codes #13977

Merged
merged 12 commits into from
Aug 12, 2020
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions sdk/resourcemanager/api-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"dir": "azure-resourcemanager-cosmos",
"source": "specification/cosmos-db/resource-manager/readme.md",
"package": "com.azure.resourcemanager.cosmos",
"args": "--payload-flattening-threshold=1 --tag=package-2019-08-preview"
"args": "--payload-flattening-threshold=0 --tag=package-2019-08-preview"
},
"customerinsights": {
"dir": "azure-resourcemanager-customerinsights",
Expand Down Expand Up @@ -224,7 +224,7 @@
"dir": "azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
"args": "--payload-flattening-threshold=1 --tag=package-policy-2019-09"
"args": "--payload-flattening-threshold=1 --tag=package-policy-2019-09"
},
"powerbi": {
"dir": "azure-resourcemanager-powerbi",
Expand Down Expand Up @@ -326,7 +326,7 @@
"dir": "azure-resourcemanager-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.azure.resourcemanager.resources",
"args": "--tag=package-subscriptions-2020-01"
"args": "--tag=package-subscriptions-2020-01 --name-for-ungrouped-operations=ResourceName"
},
"trafficmanager": {
"dir": "azure-resourcemanager-trafficmanager",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.azure.core.http.HttpPipeline;
import com.azure.core.management.AzureEnvironment;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient;
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.resourcemanager.appplatform.fluent.AppsClient;
import com.azure.resourcemanager.appplatform.fluent.BindingsClient;
import com.azure.resourcemanager.appplatform.fluent.CertificatesClient;
Expand All @@ -17,6 +17,8 @@
import com.azure.resourcemanager.appplatform.fluent.OperationsClient;
import com.azure.resourcemanager.appplatform.fluent.ServicesClient;
import com.azure.resourcemanager.appplatform.fluent.SkusClient;
import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient;
import java.time.Duration;

/** Initializes a new instance of the AppPlatformManagementClient type. */
@ServiceClient(builder = AppPlatformManagementClientBuilder.class)
Expand Down Expand Up @@ -75,6 +77,30 @@ public HttpPipeline getHttpPipeline() {
return this.httpPipeline;
}

/** The serializer to serialize an object into a string. */
private final SerializerAdapter serializerAdapter;

/**
* Gets The serializer to serialize an object into a string.
*
* @return the serializerAdapter value.
*/
public SerializerAdapter getSerializerAdapter() {
return this.serializerAdapter;
}

/** The default poll interval for long-running operation. */
private final Duration defaultPollInterval;

/**
* Gets The default poll interval for long-running operation.
*
* @return the defaultPollInterval value.
*/
public Duration getDefaultPollInterval() {
return this.defaultPollInterval;
}

/** The ServicesClient object to access its operations. */
private final ServicesClient services;

Expand Down Expand Up @@ -175,12 +201,21 @@ public SkusClient getSkus() {
* Initializes an instance of AppPlatformManagementClient client.
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param defaultPollInterval The default poll interval for long-running operation.
* @param environment The Azure environment.
*/
AppPlatformManagementClient(
HttpPipeline httpPipeline, AzureEnvironment environment, String subscriptionId, String endpoint) {
super(httpPipeline, environment);
HttpPipeline httpPipeline,
SerializerAdapter serializerAdapter,
Duration defaultPollInterval,
AzureEnvironment environment,
String subscriptionId,
String endpoint) {
super(httpPipeline, serializerAdapter, environment);
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
this.apiVersion = "2019-05-01-preview";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.AzureEnvironment;
import com.azure.core.management.serializer.AzureJacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import java.time.Duration;

/** A builder for creating a new instance of the AppPlatformManagementClient type. */
@ServiceClientBuilder(serviceClients = {AppPlatformManagementClient.class})
Expand Down Expand Up @@ -82,6 +85,38 @@ public AppPlatformManagementClientBuilder pipeline(HttpPipeline pipeline) {
return this;
}

/*
* The serializer to serialize an object into a string
*/
private SerializerAdapter serializerAdapter;

/**
* Sets The serializer to serialize an object into a string.
*
* @param serializerAdapter the serializerAdapter value.
* @return the AppPlatformManagementClientBuilder.
*/
public AppPlatformManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
this.serializerAdapter = serializerAdapter;
return this;
}

/*
* The default poll interval for long-running operation
*/
private Duration defaultPollInterval;

/**
* Sets The default poll interval for long-running operation.
*
* @param defaultPollInterval the defaultPollInterval value.
* @return the AppPlatformManagementClientBuilder.
*/
public AppPlatformManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = defaultPollInterval;
return this;
}

/**
* Builds an instance of AppPlatformManagementClient with the provided parameters.
*
Expand All @@ -100,8 +135,15 @@ public AppPlatformManagementClient buildClient() {
.policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
.build();
}
if (serializerAdapter == null) {
this.serializerAdapter = new AzureJacksonAdapter();
}
if (defaultPollInterval == null) {
this.defaultPollInterval = Duration.ofSeconds(30);
}
AppPlatformManagementClient client =
new AppPlatformManagementClient(pipeline, environment, subscriptionId, endpoint);
new AppPlatformManagementClient(
pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
return client;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public Mono<Response<AppResourceInner>> getWithResponseAsync(
if (appName == null) {
return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.get(
this.client.getEndpoint(),
Expand Down Expand Up @@ -515,6 +516,7 @@ public Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(
} else {
appResource.validate();
}
context = this.client.mergeContext(context);
return service
.createOrUpdate(
this.client.getEndpoint(),
Expand Down Expand Up @@ -547,8 +549,8 @@ public PollerFlux<PollResult<AppResourceInner>, AppResourceInner> beginCreateOrU
createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource);
return this
.client
.<AppResourceInner, AppResourceInner>getLroResultAsync(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class);
.<AppResourceInner, AppResourceInner>getLroResult(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, Context.NONE);
}

/**
Expand All @@ -568,12 +570,13 @@ public PollerFlux<PollResult<AppResourceInner>, AppResourceInner> beginCreateOrU
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<AppResourceInner>, AppResourceInner> beginCreateOrUpdateAsync(
String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context);
return this
.client
.<AppResourceInner, AppResourceInner>getLroResultAsync(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class);
.<AppResourceInner, AppResourceInner>getLroResult(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, context);
}

/**
Expand Down Expand Up @@ -786,6 +789,7 @@ public Mono<Response<Void>> deleteWithResponseAsync(
if (appName == null) {
return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
Expand Down Expand Up @@ -970,6 +974,7 @@ public Mono<Response<Flux<ByteBuffer>>> updateWithResponseAsync(
} else {
appResource.validate();
}
context = this.client.mergeContext(context);
return service
.update(
this.client.getEndpoint(),
Expand Down Expand Up @@ -1002,8 +1007,8 @@ public PollerFlux<PollResult<AppResourceInner>, AppResourceInner> beginUpdateAsy
updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource);
return this
.client
.<AppResourceInner, AppResourceInner>getLroResultAsync(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class);
.<AppResourceInner, AppResourceInner>getLroResult(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, Context.NONE);
}

/**
Expand All @@ -1023,12 +1028,13 @@ public PollerFlux<PollResult<AppResourceInner>, AppResourceInner> beginUpdateAsy
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<AppResourceInner>, AppResourceInner> beginUpdateAsync(
String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context);
return this
.client
.<AppResourceInner, AppResourceInner>getLroResultAsync(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class);
.<AppResourceInner, AppResourceInner>getLroResult(
mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, context);
}

/**
Expand Down Expand Up @@ -1241,6 +1247,7 @@ public Mono<PagedResponse<AppResourceInner>> listSinglePageAsync(
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.list(
this.client.getEndpoint(),
Expand Down Expand Up @@ -1293,7 +1300,7 @@ public PagedFlux<AppResourceInner> listAsync(String resourceGroupName, String se
public PagedFlux<AppResourceInner> listAsync(String resourceGroupName, String serviceName, Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(resourceGroupName, serviceName, context),
nextLink -> listNextSinglePageAsync(nextLink));
nextLink -> listNextSinglePageAsync(nextLink, context));
}

/**
Expand Down Expand Up @@ -1419,6 +1426,7 @@ public Mono<Response<ResourceUploadDefinition>> getResourceUploadUrlWithResponse
if (appName == null) {
return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.getResourceUploadUrl(
this.client.getEndpoint(),
Expand Down Expand Up @@ -1562,6 +1570,7 @@ public Mono<PagedResponse<AppResourceInner>> listNextSinglePageAsync(String next
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.listNext(nextLink, context)
.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ public Mono<Response<BindingResourceInner>> getWithResponseAsync(
if (bindingName == null) {
return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.get(
this.client.getEndpoint(),
Expand Down Expand Up @@ -476,6 +477,7 @@ public Mono<Response<BindingResourceInner>> createOrUpdateWithResponseAsync(
}
BindingResourceInner bindingResource = new BindingResourceInner();
bindingResource.withProperties(properties);
context = this.client.mergeContext(context);
return service
.createOrUpdate(
this.client.getEndpoint(),
Expand Down Expand Up @@ -705,6 +707,7 @@ public Mono<Response<Void>> deleteWithResponseAsync(
if (bindingName == null) {
return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
Expand Down Expand Up @@ -914,6 +917,7 @@ public Mono<Response<BindingResourceInner>> updateWithResponseAsync(
}
BindingResourceInner bindingResource = new BindingResourceInner();
bindingResource.withProperties(properties);
context = this.client.mergeContext(context);
return service
.update(
this.client.getEndpoint(),
Expand Down Expand Up @@ -1142,6 +1146,7 @@ public Mono<PagedResponse<BindingResourceInner>> listSinglePageAsync(
if (appName == null) {
return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.list(
this.client.getEndpoint(),
Expand Down Expand Up @@ -1199,7 +1204,7 @@ public PagedFlux<BindingResourceInner> listAsync(
String resourceGroupName, String serviceName, String appName, Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(resourceGroupName, serviceName, appName, context),
nextLink -> listNextSinglePageAsync(nextLink));
nextLink -> listNextSinglePageAsync(nextLink, context));
}

/**
Expand Down Expand Up @@ -1281,6 +1286,7 @@ public Mono<PagedResponse<BindingResourceInner>> listNextSinglePageAsync(String
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.listNext(nextLink, context)
.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public Mono<Response<CertificateResourceInner>> getWithResponseAsync(
return Mono
.error(new IllegalArgumentException("Parameter certificateName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.get(
this.client.getEndpoint(),
Expand Down Expand Up @@ -431,6 +432,7 @@ public Mono<Response<CertificateResourceInner>> createOrUpdateWithResponseAsync(
}
CertificateResourceInner certificateResource = new CertificateResourceInner();
certificateResource.withProperties(properties);
context = this.client.mergeContext(context);
return service
.createOrUpdate(
this.client.getEndpoint(),
Expand Down Expand Up @@ -637,6 +639,7 @@ public Mono<Response<Void>> deleteWithResponseAsync(
return Mono
.error(new IllegalArgumentException("Parameter certificateName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
Expand Down Expand Up @@ -809,6 +812,7 @@ public Mono<PagedResponse<CertificateResourceInner>> listSinglePageAsync(
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.list(
this.client.getEndpoint(),
Expand Down Expand Up @@ -862,7 +866,7 @@ public PagedFlux<CertificateResourceInner> listAsync(
String resourceGroupName, String serviceName, Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(resourceGroupName, serviceName, context),
nextLink -> listNextSinglePageAsync(nextLink));
nextLink -> listNextSinglePageAsync(nextLink, context));
}

/**
Expand Down Expand Up @@ -941,6 +945,7 @@ public Mono<PagedResponse<CertificateResourceInner>> listNextSinglePageAsync(Str
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service
.listNext(nextLink, context)
.map(
Expand Down
Loading