From c87a201132b88d14d4a217a18250313619a9cd5d Mon Sep 17 00:00:00 2001 From: xccc-msft Date: Mon, 3 Feb 2020 14:58:18 +0800 Subject: [PATCH] EventGrid: regenerate package 2020-04-preview --- .../mgmt-v2020_04_01_preview/pom.xml | 2 +- .../eventgrid/v2020_04_01_preview/Domain.java | 52 +--- .../DomainUpdateParameters.java | 55 +++++ .../eventgrid/v2020_04_01_preview/Topic.java | 54 +---- .../v2020_04_01_preview/TopicTypes.java | 2 +- .../TopicUpdateParameters.java | 55 +++++ .../implementation/DomainImpl.java | 55 +++-- .../implementation/DomainInner.java | 13 +- .../implementation/DomainsInner.java | 224 +++--------------- .../implementation/TopicImpl.java | 55 +++-- .../implementation/TopicInner.java | 13 +- .../implementation/TopicTypesInner.java | 8 +- .../implementation/TopicsInner.java | 224 +++--------------- 13 files changed, 265 insertions(+), 547 deletions(-) diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml b/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml index a2016ab56fe8a..74a7b6b798e62 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml @@ -15,7 +15,7 @@ ../../../pom.management.xml azure-mgmt-eventgrid - 1.0.0-beta + 1.0.0-beta-1 jar Microsoft Azure SDK for EventGrid Management This package contains Microsoft EventGrid Management SDK. diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Domain.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Domain.java index 3355ee2afec09..42a06ecccfd43 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Domain.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Domain.java @@ -130,30 +130,18 @@ interface WithInputSchemaMapping { WithCreate withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); } - /** - * The stage of the domain definition allowing to specify MetricResourceId. - */ - interface WithMetricResourceId { - /** - * Specifies metricResourceId. - * @param metricResourceId Metric resource id for the domain - * @return the next definition stage - */ - WithCreate withMetricResourceId(String metricResourceId); - } - /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowTrafficFromAllIPs, DefinitionStages.WithInboundIpRules, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithMetricResourceId { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowTrafficFromAllIPs, DefinitionStages.WithInboundIpRules, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping { } } /** * The template for a Domain update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowTrafficFromAllIPs, UpdateStages.WithInboundIpRules, UpdateStages.WithInputSchema, UpdateStages.WithInputSchemaMapping, UpdateStages.WithMetricResourceId { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowTrafficFromAllIPs, UpdateStages.WithInboundIpRules { } /** @@ -184,41 +172,5 @@ interface WithInboundIpRules { Update withInboundIpRules(List inboundIpRules); } - /** - * The stage of the domain update allowing to specify InputSchema. - */ - interface WithInputSchema { - /** - * Specifies inputSchema. - * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the domain. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0' - * @return the next update stage - */ - Update withInputSchema(InputSchema inputSchema); - } - - /** - * The stage of the domain update allowing to specify InputSchemaMapping. - */ - interface WithInputSchemaMapping { - /** - * Specifies inputSchemaMapping. - * @param inputSchemaMapping Information about the InputSchemaMapping which specified the info about mapping event payload - * @return the next update stage - */ - Update withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); - } - - /** - * The stage of the domain update allowing to specify MetricResourceId. - */ - interface WithMetricResourceId { - /** - * Specifies metricResourceId. - * @param metricResourceId Metric resource id for the domain - * @return the next update stage - */ - Update withMetricResourceId(String metricResourceId); - } - } } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/DomainUpdateParameters.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/DomainUpdateParameters.java index 7810d7e50efab..35b2c0f766ea7 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/DomainUpdateParameters.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/DomainUpdateParameters.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.eventgrid.v2020_04_01_preview; import java.util.Map; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -21,6 +22,20 @@ public class DomainUpdateParameters { @JsonProperty(value = "tags") private Map tags; + /** + * This determines if IP filtering rules ought to be evaluated or not. By + * default it will not evaluate and will allow traffic from all IPs. + */ + @JsonProperty(value = "allowTrafficFromAllIPs") + private Boolean allowTrafficFromAllIPs; + + /** + * This determines the IP filtering rules that ought be applied when events + * are received on this domain. + */ + @JsonProperty(value = "inboundIpRules") + private List inboundIpRules; + /** * Get tags of the domains resource. * @@ -41,4 +56,44 @@ public DomainUpdateParameters withTags(Map tags) { return this; } + /** + * Get this determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. + * + * @return the allowTrafficFromAllIPs value + */ + public Boolean allowTrafficFromAllIPs() { + return this.allowTrafficFromAllIPs; + } + + /** + * Set this determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. + * + * @param allowTrafficFromAllIPs the allowTrafficFromAllIPs value to set + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withAllowTrafficFromAllIPs(Boolean allowTrafficFromAllIPs) { + this.allowTrafficFromAllIPs = allowTrafficFromAllIPs; + return this; + } + + /** + * Get this determines the IP filtering rules that ought be applied when events are received on this domain. + * + * @return the inboundIpRules value + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set this determines the IP filtering rules that ought be applied when events are received on this domain. + * + * @param inboundIpRules the inboundIpRules value to set + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java index 53ad9a525a8ce..6849266c60389 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java @@ -130,30 +130,18 @@ interface WithInputSchemaMapping { WithCreate withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); } - /** - * The stage of the topic definition allowing to specify MetricResourceId. - */ - interface WithMetricResourceId { - /** - * Specifies metricResourceId. - * @param metricResourceId Metric resource id for the topic - * @return the next definition stage - */ - WithCreate withMetricResourceId(String metricResourceId); - } - /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowTrafficFromAllIPs, DefinitionStages.WithInboundIpRules, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithMetricResourceId { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAllowTrafficFromAllIPs, DefinitionStages.WithInboundIpRules, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping { } } /** * The template for a Topic update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowTrafficFromAllIPs, UpdateStages.WithInboundIpRules, UpdateStages.WithInputSchema, UpdateStages.WithInputSchemaMapping, UpdateStages.WithMetricResourceId { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAllowTrafficFromAllIPs, UpdateStages.WithInboundIpRules { } /** @@ -178,47 +166,11 @@ interface WithAllowTrafficFromAllIPs { interface WithInboundIpRules { /** * Specifies inboundIpRules. - * @param inboundIpRules This determines the IP filtering rules that ought to be applied when events are received on this topic + * @param inboundIpRules This determines the IP filtering rules that ought be applied when events are received on this domain * @return the next update stage */ Update withInboundIpRules(List inboundIpRules); } - /** - * The stage of the topic update allowing to specify InputSchema. - */ - interface WithInputSchema { - /** - * Specifies inputSchema. - * @param inputSchema This determines the format that Event Grid should expect for incoming events published to the topic. Possible values include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventSchemaV1_0' - * @return the next update stage - */ - Update withInputSchema(InputSchema inputSchema); - } - - /** - * The stage of the topic update allowing to specify InputSchemaMapping. - */ - interface WithInputSchemaMapping { - /** - * Specifies inputSchemaMapping. - * @param inputSchemaMapping This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema - * @return the next update stage - */ - Update withInputSchemaMapping(InputSchemaMapping inputSchemaMapping); - } - - /** - * The stage of the topic update allowing to specify MetricResourceId. - */ - interface WithMetricResourceId { - /** - * Specifies metricResourceId. - * @param metricResourceId Metric resource id for the topic - * @return the next update stage - */ - Update withMetricResourceId(String metricResourceId); - } - } } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicTypes.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicTypes.java index 936c401200cfe..348e090251039 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicTypes.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicTypes.java @@ -20,7 +20,7 @@ public interface TopicTypes extends HasInner { * List event types. * List event types for a topic type. * - * @param topicTypeName Name of the topic type + * @param topicTypeName Name of the topic type. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicUpdateParameters.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicUpdateParameters.java index b07ad06c63d43..aac3fdff28dae 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicUpdateParameters.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/TopicUpdateParameters.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.eventgrid.v2020_04_01_preview; import java.util.Map; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -21,6 +22,20 @@ public class TopicUpdateParameters { @JsonProperty(value = "tags") private Map tags; + /** + * This determines if IP filtering rules ought to be evaluated or not. By + * default it will not evaluate and will allow traffic from all IPs. + */ + @JsonProperty(value = "allowTrafficFromAllIPs") + private Boolean allowTrafficFromAllIPs; + + /** + * This determines the IP filtering rules that ought be applied when events + * are received on this domain. + */ + @JsonProperty(value = "inboundIpRules") + private List inboundIpRules; + /** * Get tags of the resource. * @@ -41,4 +56,44 @@ public TopicUpdateParameters withTags(Map tags) { return this; } + /** + * Get this determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. + * + * @return the allowTrafficFromAllIPs value + */ + public Boolean allowTrafficFromAllIPs() { + return this.allowTrafficFromAllIPs; + } + + /** + * Set this determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. + * + * @param allowTrafficFromAllIPs the allowTrafficFromAllIPs value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withAllowTrafficFromAllIPs(Boolean allowTrafficFromAllIPs) { + this.allowTrafficFromAllIPs = allowTrafficFromAllIPs; + return this; + } + + /** + * Get this determines the IP filtering rules that ought be applied when events are received on this domain. + * + * @return the inboundIpRules value + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set this determines the IP filtering rules that ought be applied when events are received on this domain. + * + * @param inboundIpRules the inboundIpRules value to set + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainImpl.java index 101059d85195f..0b6059adda174 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainImpl.java @@ -11,28 +11,46 @@ import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Domain; import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.DomainUpdateParameters; +import java.util.List; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.DomainProvisioningState; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.InputSchema; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.InputSchemaMapping; -import java.util.List; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.InboundIpRule; +import rx.functions.Func1; class DomainImpl extends GroupableResourceCoreImpl implements Domain, Domain.Definition, Domain.Update { + private DomainUpdateParameters updateParameter; DomainImpl(String name, DomainInner inner, EventGridManager manager) { super(name, inner, manager); + this.updateParameter = new DomainUpdateParameters(); } @Override public Observable createResourceAsync() { DomainsInner client = this.manager().inner().domains(); return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public DomainInner call(DomainInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { DomainsInner client = this.manager().inner().domains(); - return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DomainInner call(DomainInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @@ -47,6 +65,9 @@ public boolean isInCreateMode() { return this.inner().id() == null; } + private void resetCreateUpdateParameters() { + this.updateParameter = new DomainUpdateParameters(); + } @Override public Boolean allowTrafficFromAllIPs() { @@ -83,18 +104,6 @@ public DomainProvisioningState provisioningState() { return this.inner().provisioningState(); } - @Override - public DomainImpl withAllowTrafficFromAllIPs(Boolean allowTrafficFromAllIPs) { - this.inner().withAllowTrafficFromAllIPs(allowTrafficFromAllIPs); - return this; - } - - @Override - public DomainImpl withInboundIpRules(List inboundIpRules) { - this.inner().withInboundIpRules(inboundIpRules); - return this; - } - @Override public DomainImpl withInputSchema(InputSchema inputSchema) { this.inner().withInputSchema(inputSchema); @@ -108,8 +117,22 @@ public DomainImpl withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) } @Override - public DomainImpl withMetricResourceId(String metricResourceId) { - this.inner().withMetricResourceId(metricResourceId); + public DomainImpl withAllowTrafficFromAllIPs(Boolean allowTrafficFromAllIPs) { + if (isInCreateMode()) { + this.inner().withAllowTrafficFromAllIPs(allowTrafficFromAllIPs); + } else { + this.updateParameter.withAllowTrafficFromAllIPs(allowTrafficFromAllIPs); + } + return this; + } + + @Override + public DomainImpl withInboundIpRules(List inboundIpRules) { + if (isInCreateMode()) { + this.inner().withInboundIpRules(inboundIpRules); + } else { + this.updateParameter.withInboundIpRules(inboundIpRules); + } return this; } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainInner.java index 0d16a3e7c7de3..839a9ab846c76 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainInner.java @@ -53,7 +53,7 @@ public class DomainInner extends Resource { /** * Metric resource id for the domain. */ - @JsonProperty(value = "properties.metricResourceId") + @JsonProperty(value = "properties.metricResourceId", access = JsonProperty.Access.WRITE_ONLY) private String metricResourceId; /** @@ -137,17 +137,6 @@ public String metricResourceId() { return this.metricResourceId; } - /** - * Set metric resource id for the domain. - * - * @param metricResourceId the metricResourceId value to set - * @return the DomainInner object itself. - */ - public DomainInner withMetricResourceId(String metricResourceId) { - this.metricResourceId = metricResourceId; - return this; - } - /** * Get this determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. * diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainsInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainsInner.java index 4481a83b7acae..7af3223fc33e7 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainsInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/DomainsInner.java @@ -26,7 +26,6 @@ import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; -import java.util.Map; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -91,11 +90,11 @@ interface DomainsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Domains update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DomainUpdateParameters domainUpdateParameters, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainUpdateParameters domainUpdateParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Domains beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DomainUpdateParameters domainUpdateParameters, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Body DomainUpdateParameters domainUpdateParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Domains list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains") @@ -560,13 +559,14 @@ private ServiceResponse beginDeleteDelegate(Response respons * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainInner object if successful. */ - public DomainInner update(String resourceGroupName, String domainName) { - return updateWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().last().body(); + public DomainInner update(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).toBlocking().last().body(); } /** @@ -575,12 +575,13 @@ public DomainInner update(String resourceGroupName, String domainName) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters), serviceCallback); } /** @@ -589,11 +590,12 @@ public ServiceFuture updateAsync(String resourceGroupName, String d * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String domainName) { - return updateWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + public Observable updateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).map(new Func1, DomainInner>() { @Override public DomainInner call(ServiceResponse response) { return response.body(); @@ -607,10 +609,11 @@ public DomainInner call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String domainName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -620,92 +623,14 @@ public Observable> updateWithServiceResponseAsync(S if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Map tags = null; - DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); - domainUpdateParameters.withTags(null); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DomainInner object if successful. - */ - public DomainInner update(String resourceGroupName, String domainName, Map tags) { - return updateWithServiceResponseAsync(resourceGroupName, domainName, tags).toBlocking().last().body(); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String domainName, Map tags, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, domainName, tags), serviceCallback); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String domainName, Map tags) { - return updateWithServiceResponseAsync(resourceGroupName, domainName, tags).map(new Func1, DomainInner>() { - @Override - public DomainInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String domainName, Map tags) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (domainName == null) { - throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + if (domainUpdateParameters == null) { + throw new IllegalArgumentException("Parameter domainUpdateParameters is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(tags); - DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); - domainUpdateParameters.withTags(tags); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, this.client.userAgent()); + Validator.validate(domainUpdateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, domainName, domainUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -715,13 +640,14 @@ public Observable> updateWithServiceResponseAsync(S * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DomainInner object if successful. */ - public DomainInner beginUpdate(String resourceGroupName, String domainName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); + public DomainInner beginUpdate(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).toBlocking().single().body(); } /** @@ -730,12 +656,13 @@ public DomainInner beginUpdate(String resourceGroupName, String domainName) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters), serviceCallback); } /** @@ -744,11 +671,12 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String domainName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainUpdateParameters).map(new Func1, DomainInner>() { @Override public DomainInner call(ServiceResponse response) { return response.body(); @@ -762,10 +690,11 @@ public DomainInner call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param domainName Name of the domain. + * @param domainUpdateParameters Domain update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DomainInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String domainName) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, DomainUpdateParameters domainUpdateParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -775,103 +704,14 @@ public Observable> beginUpdateWithServiceResponseAs if (domainName == null) { throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Map tags = null; - DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); - domainUpdateParameters.withTags(null); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DomainInner object if successful. - */ - public DomainInner beginUpdate(String resourceGroupName, String domainName, Map tags) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags).toBlocking().single().body(); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String domainName, Map tags, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags), serviceCallback); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DomainInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String domainName, Map tags) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags).map(new Func1, DomainInner>() { - @Override - public DomainInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a domain. - * Asynchronously updates a domain with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param domainName Name of the domain. - * @param tags Tags of the domains resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DomainInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String domainName, Map tags) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (domainName == null) { - throw new IllegalArgumentException("Parameter domainName is required and cannot be null."); + if (domainUpdateParameters == null) { + throw new IllegalArgumentException("Parameter domainUpdateParameters is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(tags); - DomainUpdateParameters domainUpdateParameters = new DomainUpdateParameters(); - domainUpdateParameters.withTags(tags); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, domainName, this.client.apiVersion(), this.client.acceptLanguage(), domainUpdateParameters, this.client.userAgent()) + Validator.validate(domainUpdateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, domainName, domainUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicImpl.java index 6da691ec74d0d..93d5c6d3148e6 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicImpl.java @@ -11,28 +11,46 @@ import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Topic; import rx.Observable; +import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.TopicUpdateParameters; +import java.util.List; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.TopicProvisioningState; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.InputSchema; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.InputSchemaMapping; -import java.util.List; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.InboundIpRule; +import rx.functions.Func1; class TopicImpl extends GroupableResourceCoreImpl implements Topic, Topic.Definition, Topic.Update { + private TopicUpdateParameters updateParameter; TopicImpl(String name, TopicInner inner, EventGridManager manager) { super(name, inner, manager); + this.updateParameter = new TopicUpdateParameters(); } @Override public Observable createResourceAsync() { TopicsInner client = this.manager().inner().topics(); return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public TopicInner call(TopicInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { TopicsInner client = this.manager().inner().topics(); - return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public TopicInner call(TopicInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) .map(innerToFluentMap(this)); } @@ -47,6 +65,9 @@ public boolean isInCreateMode() { return this.inner().id() == null; } + private void resetCreateUpdateParameters() { + this.updateParameter = new TopicUpdateParameters(); + } @Override public Boolean allowTrafficFromAllIPs() { @@ -83,18 +104,6 @@ public TopicProvisioningState provisioningState() { return this.inner().provisioningState(); } - @Override - public TopicImpl withAllowTrafficFromAllIPs(Boolean allowTrafficFromAllIPs) { - this.inner().withAllowTrafficFromAllIPs(allowTrafficFromAllIPs); - return this; - } - - @Override - public TopicImpl withInboundIpRules(List inboundIpRules) { - this.inner().withInboundIpRules(inboundIpRules); - return this; - } - @Override public TopicImpl withInputSchema(InputSchema inputSchema) { this.inner().withInputSchema(inputSchema); @@ -108,8 +117,22 @@ public TopicImpl withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { } @Override - public TopicImpl withMetricResourceId(String metricResourceId) { - this.inner().withMetricResourceId(metricResourceId); + public TopicImpl withAllowTrafficFromAllIPs(Boolean allowTrafficFromAllIPs) { + if (isInCreateMode()) { + this.inner().withAllowTrafficFromAllIPs(allowTrafficFromAllIPs); + } else { + this.updateParameter.withAllowTrafficFromAllIPs(allowTrafficFromAllIPs); + } + return this; + } + + @Override + public TopicImpl withInboundIpRules(List inboundIpRules) { + if (isInCreateMode()) { + this.inner().withInboundIpRules(inboundIpRules); + } else { + this.updateParameter.withInboundIpRules(inboundIpRules); + } return this; } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java index 47403202967f0..24a2cc76c1a6f 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java @@ -55,7 +55,7 @@ public class TopicInner extends Resource { /** * Metric resource id for the topic. */ - @JsonProperty(value = "properties.metricResourceId") + @JsonProperty(value = "properties.metricResourceId", access = JsonProperty.Access.WRITE_ONLY) private String metricResourceId; /** @@ -139,17 +139,6 @@ public String metricResourceId() { return this.metricResourceId; } - /** - * Set metric resource id for the topic. - * - * @param metricResourceId the metricResourceId value to set - * @return the TopicInner object itself. - */ - public TopicInner withMetricResourceId(String metricResourceId) { - this.metricResourceId = metricResourceId; - return this; - } - /** * Get this determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. * diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicTypesInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicTypesInner.java index 3a945775e312b..d4b8f04070ec3 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicTypesInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicTypesInner.java @@ -228,7 +228,7 @@ private ServiceResponse getDelegate(Response r * List event types. * List event types for a topic type. * - * @param topicTypeName Name of the topic type + * @param topicTypeName Name of the topic type. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -242,7 +242,7 @@ public List listEventTypes(String topicTypeName) { * List event types. * List event types for a topic type. * - * @param topicTypeName Name of the topic type + * @param topicTypeName Name of the topic type. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -255,7 +255,7 @@ public ServiceFuture> listEventTypesAsync(String topicTypeN * List event types. * List event types for a topic type. * - * @param topicTypeName Name of the topic type + * @param topicTypeName Name of the topic type. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<EventTypeInner> object */ @@ -272,7 +272,7 @@ public List call(ServiceResponse> response) * List event types. * List event types for a topic type. * - * @param topicTypeName Name of the topic type + * @param topicTypeName Name of the topic type. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<EventTypeInner> object */ diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicsInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicsInner.java index 34dfbfc53cc2c..de4a2d60faf41 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicsInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicsInner.java @@ -26,7 +26,6 @@ import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; -import java.util.Map; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -91,11 +90,11 @@ interface TopicsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Topics update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicUpdateParameters topicUpdateParameters, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicUpdateParameters topicUpdateParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Topics beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TopicUpdateParameters topicUpdateParameters, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicName") String topicName, @Body TopicUpdateParameters topicUpdateParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.Topics list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics") @@ -564,13 +563,14 @@ private ServiceResponse beginDeleteDelegate(Response respons * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TopicInner object if successful. */ - public TopicInner update(String resourceGroupName, String topicName) { - return updateWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().last().body(); + public TopicInner update(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).toBlocking().last().body(); } /** @@ -579,12 +579,13 @@ public TopicInner update(String resourceGroupName, String topicName) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters), serviceCallback); } /** @@ -593,11 +594,12 @@ public ServiceFuture updateAsync(String resourceGroupName, String to * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String topicName) { - return updateWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, TopicInner>() { + public Observable updateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).map(new Func1, TopicInner>() { @Override public TopicInner call(ServiceResponse response) { return response.body(); @@ -611,10 +613,11 @@ public TopicInner call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String topicName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -624,92 +627,14 @@ public Observable> updateWithServiceResponseAsync(St if (topicName == null) { throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Map tags = null; - TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); - topicUpdateParameters.withTags(null); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the TopicInner object if successful. - */ - public TopicInner update(String resourceGroupName, String topicName, Map tags) { - return updateWithServiceResponseAsync(resourceGroupName, topicName, tags).toBlocking().last().body(); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String topicName, Map tags, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, topicName, tags), serviceCallback); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String topicName, Map tags) { - return updateWithServiceResponseAsync(resourceGroupName, topicName, tags).map(new Func1, TopicInner>() { - @Override - public TopicInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String topicName, Map tags) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (topicName == null) { - throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + if (topicUpdateParameters == null) { + throw new IllegalArgumentException("Parameter topicUpdateParameters is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(tags); - TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); - topicUpdateParameters.withTags(tags); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, this.client.userAgent()); + Validator.validate(topicUpdateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, topicName, topicUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -719,13 +644,14 @@ public Observable> updateWithServiceResponseAsync(St * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TopicInner object if successful. */ - public TopicInner beginUpdate(String resourceGroupName, String topicName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); + public TopicInner beginUpdate(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).toBlocking().single().body(); } /** @@ -734,12 +660,13 @@ public TopicInner beginUpdate(String resourceGroupName, String topicName) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String topicName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, topicName), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters), serviceCallback); } /** @@ -748,11 +675,12 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TopicInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String topicName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1, TopicInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicUpdateParameters).map(new Func1, TopicInner>() { @Override public TopicInner call(ServiceResponse response) { return response.body(); @@ -766,10 +694,11 @@ public TopicInner call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. + * @param topicUpdateParameters Topic update information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TopicInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String topicName) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, TopicUpdateParameters topicUpdateParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -779,103 +708,14 @@ public Observable> beginUpdateWithServiceResponseAsy if (topicName == null) { throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final Map tags = null; - TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); - topicUpdateParameters.withTags(null); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the TopicInner object if successful. - */ - public TopicInner beginUpdate(String resourceGroupName, String topicName, Map tags) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags).toBlocking().single().body(); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String topicName, Map tags, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags), serviceCallback); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TopicInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String topicName, Map tags) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, topicName, tags).map(new Func1, TopicInner>() { - @Override - public TopicInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a topic. - * Asynchronously updates a topic with the specified parameters. - * - * @param resourceGroupName The name of the resource group within the user's subscription. - * @param topicName Name of the topic. - * @param tags Tags of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the TopicInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String topicName, Map tags) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (topicName == null) { - throw new IllegalArgumentException("Parameter topicName is required and cannot be null."); + if (topicUpdateParameters == null) { + throw new IllegalArgumentException("Parameter topicUpdateParameters is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(tags); - TopicUpdateParameters topicUpdateParameters = new TopicUpdateParameters(); - topicUpdateParameters.withTags(tags); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, topicName, this.client.apiVersion(), this.client.acceptLanguage(), topicUpdateParameters, this.client.userAgent()) + Validator.validate(topicUpdateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, topicName, topicUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {