Skip to content

Commit f0e4665

Browse files
authored
Regenerating Service Bus administration client (Azure#34230)
* Update README to point at new swagger.json * Add customization class. * Regenerate administration.model enum classes. * Regenerate ServiceBusManagementError classes. * Rename to *Impl for consistency. * EntityAvailabilityStatus is an ExpandableStringEnum now. * Adding re-generated files with no code changes. (Whitespace only.) * True/False filter regenerated as Fluent classes. * Renaming classes to use Impl classes. * Fix EntityServiceBusExceptionTestHelperTest with Impl classes. * Add DefaultRule to SubscriptionDescriptionImpl * Change corresponding properties to long. * Fix sizeof in tests from Integer to Long. * Fix customizations and specify version of autorest to use. * Fix build breaks in Management clients. * Remove unused imports. * Remove unused static field. * Fix build breaks adding Impl to titles. * Regenerate Models. * Regenerate DescriptionEntryImpl and FeedImpls. Their namespaces were updated. * Regenerate Clients with newest autorest and swagger. * Adding back regenerated models in public API. * Fixing build breaks from rename to Impl. * adding back package-info that was regenerated. * Updating URL to input-file. * Adding Xml namespace import. * Adding customization for AuthorizationRule namespace. * Regenerating where modelAsString == true * Add customization to remove public modifier fr9om NamespaceProperties. * Update README * Fixing generation of EntityAvailabilityStatusImpl * Fix names on README * Update customization to add noarg constructor. * Add QueueDescriptionImpl with no-arg constructor in AuthorizationRuleWrapper * Fixing naming violation. * Add test for title deserialization errors. * Updating title from string -> object. * Changing titles back to Object. * Revert changes in ManagementSerializerTest for entry titles.
1 parent 30c45ab commit f0e4665

File tree

82 files changed

+4564
-4926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+4564
-4926
lines changed

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/ServiceBusAdministrationAsyncClient.java

Lines changed: 46 additions & 44 deletions
Large diffs are not rendered by default.

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/ServiceBusAdministrationClient.java

Lines changed: 64 additions & 64 deletions
Large diffs are not rendered by default.

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/implementation/EntitiesImpl.java

Lines changed: 82 additions & 202 deletions
Large diffs are not rendered by default.

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/implementation/EntityHelper.java

Lines changed: 91 additions & 86 deletions
Large diffs are not rendered by default.

sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/implementation/NamespacesImpl.java

Lines changed: 20 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.azure.core.http.rest.RestProxy;
1919
import com.azure.core.util.Context;
2020
import com.azure.core.util.FluxUtil;
21-
import com.azure.messaging.servicebus.administration.implementation.models.NamespacePropertiesEntry;
21+
import com.azure.messaging.servicebus.administration.implementation.models.NamespacePropertiesEntryImpl;
2222
import com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementErrorException;
2323
import reactor.core.publisher.Mono;
2424

@@ -37,7 +37,7 @@ public final class NamespacesImpl {
3737
*/
3838
NamespacesImpl(ServiceBusManagementClientImpl client) {
3939
this.service =
40-
RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
40+
RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
4141
this.client = client;
4242
}
4343

@@ -51,20 +51,20 @@ public interface NamespacesService {
5151
@Get("/$namespaceinfo")
5252
@ExpectedResponses({200})
5353
@UnexpectedResponseExceptionType(ServiceBusManagementErrorException.class)
54-
Mono<Response<NamespacePropertiesEntry>> get(
55-
@HostParam("endpoint") String endpoint,
56-
@QueryParam("api-version") String apiVersion,
57-
@HeaderParam("Accept") String accept,
58-
Context context);
54+
Mono<Response<NamespacePropertiesEntryImpl>> get(
55+
@HostParam("endpoint") String endpoint,
56+
@QueryParam("api-version") String apiVersion,
57+
@HeaderParam("Accept") String accept,
58+
Context context);
5959

6060
@Get("/$namespaceinfo")
6161
@ExpectedResponses({200})
6262
@UnexpectedResponseExceptionType(ServiceBusManagementErrorException.class)
63-
Response<NamespacePropertiesEntry> getSync(
64-
@HostParam("endpoint") String endpoint,
65-
@QueryParam("api-version") String apiVersion,
66-
@HeaderParam("Accept") String accept,
67-
Context context);
63+
Response<NamespacePropertiesEntryImpl> getSync(
64+
@HostParam("endpoint") String endpoint,
65+
@QueryParam("api-version") String apiVersion,
66+
@HeaderParam("Accept") String accept,
67+
Context context);
6868
}
6969

7070
/**
@@ -78,10 +78,10 @@ Response<NamespacePropertiesEntry> getSync(
7878
* {@link Mono}.
7979
*/
8080
@ServiceMethod(returns = ReturnType.SINGLE)
81-
public Mono<Response<NamespacePropertiesEntry>> getWithResponseAsync() {
81+
public Mono<Response<NamespacePropertiesEntryImpl>> getWithResponseAsync() {
8282
final String accept = "application/xml, application/atom+xml";
8383
return FluxUtil.withContext(
84-
context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context));
84+
context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context));
8585
}
8686

8787
/**
@@ -97,7 +97,7 @@ public Mono<Response<NamespacePropertiesEntry>> getWithResponseAsync() {
9797
* {@link Mono}.
9898
*/
9999
@ServiceMethod(returns = ReturnType.SINGLE)
100-
public Mono<Response<NamespacePropertiesEntry>> getWithResponseAsync(Context context) {
100+
public Mono<Response<NamespacePropertiesEntryImpl>> getWithResponseAsync(Context context) {
101101
final String accept = "application/xml, application/atom+xml";
102102
return service.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
103103
}
@@ -112,7 +112,7 @@ public Mono<Response<NamespacePropertiesEntry>> getWithResponseAsync(Context con
112112
* @return the details about the Service Bus namespace on successful completion of {@link Mono}.
113113
*/
114114
@ServiceMethod(returns = ReturnType.SINGLE)
115-
public Mono<NamespacePropertiesEntry> getAsync() {
115+
public Mono<NamespacePropertiesEntryImpl> getAsync() {
116116
return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
117117
}
118118

@@ -128,25 +128,10 @@ public Mono<NamespacePropertiesEntry> getAsync() {
128128
* @return the details about the Service Bus namespace on successful completion of {@link Mono}.
129129
*/
130130
@ServiceMethod(returns = ReturnType.SINGLE)
131-
public Mono<NamespacePropertiesEntry> getAsync(Context context) {
131+
public Mono<NamespacePropertiesEntryImpl> getAsync(Context context) {
132132
return getWithResponseAsync(context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
133133
}
134134

135-
/**
136-
* Get Namespace Properties
137-
*
138-
* <p>Get the details about the Service Bus namespace.
139-
*
140-
* @throws ServiceBusManagementErrorException thrown if the request is rejected by server.
141-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
142-
* @return the details about the Service Bus namespace along with {@link Response}.
143-
*/
144-
@ServiceMethod(returns = ReturnType.SINGLE)
145-
public Response<NamespacePropertiesEntry> getSyncWithResponse() {
146-
final String accept = "application/xml, application/atom+xml";
147-
return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE);
148-
}
149-
150135
/**
151136
* Get Namespace Properties
152137
*
@@ -159,7 +144,7 @@ public Response<NamespacePropertiesEntry> getSyncWithResponse() {
159144
* @return the details about the Service Bus namespace along with {@link Response}.
160145
*/
161146
@ServiceMethod(returns = ReturnType.SINGLE)
162-
public Response<NamespacePropertiesEntry> getSyncWithResponse(Context context) {
147+
public Response<NamespacePropertiesEntryImpl> getWithResponse(Context context) {
163148
final String accept = "application/xml, application/atom+xml";
164149
return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
165150
}
@@ -174,23 +159,7 @@ public Response<NamespacePropertiesEntry> getSyncWithResponse(Context context) {
174159
* @return the details about the Service Bus namespace.
175160
*/
176161
@ServiceMethod(returns = ReturnType.SINGLE)
177-
public NamespacePropertiesEntry getSync() {
178-
return getSyncWithResponse(Context.NONE).getValue();
179-
}
180-
181-
/**
182-
* Get Namespace Properties
183-
*
184-
* <p>Get the details about the Service Bus namespace.
185-
*
186-
* @param context The context to associate with this operation.
187-
* @throws IllegalArgumentException thrown if parameters fail the validation.
188-
* @throws ServiceBusManagementErrorException thrown if the request is rejected by server.
189-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
190-
* @return the details about the Service Bus namespace.
191-
*/
192-
@ServiceMethod(returns = ReturnType.SINGLE)
193-
public NamespacePropertiesEntry getSync(Context context) {
194-
return getSyncWithResponse(context).getValue();
162+
public NamespacePropertiesEntryImpl get() {
163+
return getWithResponse(Context.NONE).getValue();
195164
}
196165
}

0 commit comments

Comments
 (0)