Skip to content

Commit de74066

Browse files
sync, fix expandableenum serialization and prepare release (#3027)
* bump core * sync tests * bump autorest * re-generate test code * bump core and sync tests * sync core * bump core * bump core, sync test * re-generate test code * bump core, sync test * re-generate test code --------- Co-authored-by: actions-user <[email protected]>
1 parent f6f5108 commit de74066

File tree

18 files changed

+595
-9
lines changed

18 files changed

+595
-9
lines changed

core

Submodule core updated 521 files

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@autorest/java",
3-
"version": "4.1.44",
3+
"version": "4.1.45",
44
"description": "The Java extension for classic generators in AutoRest.",
55
"scripts": {
66
"autorest": "autorest",

typespec-tests/src/main/java/tsptest/armstreamstyleserialization/ArmStreamStyleSerializationManager.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
import tsptest.armstreamstyleserialization.implementation.ArmStreamStyleSerializationClientBuilder;
3636
import tsptest.armstreamstyleserialization.implementation.FishesImpl;
3737
import tsptest.armstreamstyleserialization.implementation.FunctionsImpl;
38+
import tsptest.armstreamstyleserialization.implementation.PrioritiesImpl;
3839
import tsptest.armstreamstyleserialization.implementation.TopLevelArmResourcesImpl;
3940
import tsptest.armstreamstyleserialization.models.Fishes;
4041
import tsptest.armstreamstyleserialization.models.Functions;
42+
import tsptest.armstreamstyleserialization.models.Priorities;
4143
import tsptest.armstreamstyleserialization.models.TopLevelArmResources;
4244

4345
/**
@@ -51,6 +53,8 @@ public final class ArmStreamStyleSerializationManager {
5153

5254
private Functions functions;
5355

56+
private Priorities priorities;
57+
5458
private final ArmStreamStyleSerializationClient clientObject;
5559

5660
private ArmStreamStyleSerializationManager(HttpPipeline httpPipeline, AzureProfile profile,
@@ -304,6 +308,18 @@ public Functions functions() {
304308
return functions;
305309
}
306310

311+
/**
312+
* Gets the resource collection API of Priorities.
313+
*
314+
* @return Resource collection API of Priorities.
315+
*/
316+
public Priorities priorities() {
317+
if (this.priorities == null) {
318+
this.priorities = new PrioritiesImpl(clientObject.getPriorities(), this);
319+
}
320+
return priorities;
321+
}
322+
307323
/**
308324
* Gets wrapped service client ArmStreamStyleSerializationClient providing direct access to the underlying
309325
* auto-generated API implementation, based on Azure REST API.

typespec-tests/src/main/java/tsptest/armstreamstyleserialization/fluent/ArmStreamStyleSerializationClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,11 @@ public interface ArmStreamStyleSerializationClient {
6666
* @return the FunctionsClient object.
6767
*/
6868
FunctionsClient getFunctions();
69+
70+
/**
71+
* Gets the PrioritiesClient object to access its operations.
72+
*
73+
* @return the PrioritiesClient object.
74+
*/
75+
PrioritiesClient getPriorities();
6976
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package tsptest.armstreamstyleserialization.fluent;
6+
7+
import com.azure.core.annotation.ReturnType;
8+
import com.azure.core.annotation.ServiceMethod;
9+
import com.azure.core.http.rest.Response;
10+
import com.azure.core.util.Context;
11+
import tsptest.armstreamstyleserialization.models.Priority;
12+
13+
/**
14+
* An instance of this class provides access to all the operations defined in PrioritiesClient.
15+
*/
16+
public interface PrioritiesClient {
17+
/**
18+
* The setPriority operation.
19+
*
20+
* @param priority The priority parameter.
21+
* @param context The context to associate with this operation.
22+
* @throws IllegalArgumentException thrown if parameters fail the validation.
23+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
24+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
25+
* @return the response body along with {@link Response}.
26+
*/
27+
@ServiceMethod(returns = ReturnType.SINGLE)
28+
Response<Priority> setPriorityWithResponse(Priority priority, Context context);
29+
30+
/**
31+
* The setPriority operation.
32+
*
33+
* @param priority The priority parameter.
34+
* @throws IllegalArgumentException thrown if parameters fail the validation.
35+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
36+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
37+
* @return the response.
38+
*/
39+
@ServiceMethod(returns = ReturnType.SINGLE)
40+
Priority setPriority(Priority priority);
41+
}

typespec-tests/src/main/java/tsptest/armstreamstyleserialization/implementation/ArmStreamStyleSerializationClientImpl.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import tsptest.armstreamstyleserialization.fluent.ArmStreamStyleSerializationClient;
3535
import tsptest.armstreamstyleserialization.fluent.FishesClient;
3636
import tsptest.armstreamstyleserialization.fluent.FunctionsClient;
37+
import tsptest.armstreamstyleserialization.fluent.PrioritiesClient;
3738
import tsptest.armstreamstyleserialization.fluent.TopLevelArmResourcesClient;
3839

3940
/**
@@ -167,6 +168,20 @@ public FunctionsClient getFunctions() {
167168
return this.functions;
168169
}
169170

171+
/**
172+
* The PrioritiesClient object to access its operations.
173+
*/
174+
private final PrioritiesClient priorities;
175+
176+
/**
177+
* Gets the PrioritiesClient object to access its operations.
178+
*
179+
* @return the PrioritiesClient object.
180+
*/
181+
public PrioritiesClient getPriorities() {
182+
return this.priorities;
183+
}
184+
170185
/**
171186
* Initializes an instance of ArmStreamStyleSerializationClient client.
172187
*
@@ -188,6 +203,7 @@ public FunctionsClient getFunctions() {
188203
this.fishes = new FishesClientImpl(this);
189204
this.topLevelArmResources = new TopLevelArmResourcesClientImpl(this);
190205
this.functions = new FunctionsClientImpl(this);
206+
this.priorities = new PrioritiesClientImpl(this);
191207
}
192208

193209
/**
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package tsptest.armstreamstyleserialization.implementation;
6+
7+
import com.azure.core.annotation.ExpectedResponses;
8+
import com.azure.core.annotation.HeaderParam;
9+
import com.azure.core.annotation.Headers;
10+
import com.azure.core.annotation.Host;
11+
import com.azure.core.annotation.HostParam;
12+
import com.azure.core.annotation.Post;
13+
import com.azure.core.annotation.QueryParam;
14+
import com.azure.core.annotation.ReturnType;
15+
import com.azure.core.annotation.ServiceInterface;
16+
import com.azure.core.annotation.ServiceMethod;
17+
import com.azure.core.annotation.UnexpectedResponseExceptionType;
18+
import com.azure.core.http.rest.Response;
19+
import com.azure.core.http.rest.RestProxy;
20+
import com.azure.core.management.exception.ManagementException;
21+
import com.azure.core.util.Context;
22+
import com.azure.core.util.FluxUtil;
23+
import reactor.core.publisher.Mono;
24+
import tsptest.armstreamstyleserialization.fluent.PrioritiesClient;
25+
import tsptest.armstreamstyleserialization.models.Priority;
26+
27+
/**
28+
* An instance of this class provides access to all the operations defined in PrioritiesClient.
29+
*/
30+
public final class PrioritiesClientImpl implements PrioritiesClient {
31+
/**
32+
* The proxy service used to perform REST calls.
33+
*/
34+
private final PrioritiesService service;
35+
36+
/**
37+
* The service client containing this operation class.
38+
*/
39+
private final ArmStreamStyleSerializationClientImpl client;
40+
41+
/**
42+
* Initializes an instance of PrioritiesClientImpl.
43+
*
44+
* @param client the instance of the service client containing this operation class.
45+
*/
46+
PrioritiesClientImpl(ArmStreamStyleSerializationClientImpl client) {
47+
this.service
48+
= RestProxy.create(PrioritiesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
49+
this.client = client;
50+
}
51+
52+
/**
53+
* The interface defining all the services for ArmStreamStyleSerializationClientPriorities to be used by the proxy
54+
* service to perform REST calls.
55+
*/
56+
@Host("{endpoint}")
57+
@ServiceInterface(name = "ArmStreamStyleSerial")
58+
public interface PrioritiesService {
59+
@Headers({ "Content-Type: application/json" })
60+
@Post("/priority")
61+
@ExpectedResponses({ 200 })
62+
@UnexpectedResponseExceptionType(ManagementException.class)
63+
Mono<Response<Priority>> setPriority(@HostParam("endpoint") String endpoint,
64+
@QueryParam("priority") Priority priority, @HeaderParam("Accept") String accept, Context context);
65+
}
66+
67+
/**
68+
* The setPriority operation.
69+
*
70+
* @param priority The priority parameter.
71+
* @throws IllegalArgumentException thrown if parameters fail the validation.
72+
* @throws ManagementException thrown if the request is rejected by server.
73+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
74+
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
75+
*/
76+
@ServiceMethod(returns = ReturnType.SINGLE)
77+
private Mono<Response<Priority>> setPriorityWithResponseAsync(Priority priority) {
78+
if (this.client.getEndpoint() == null) {
79+
return Mono.error(
80+
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
81+
}
82+
if (priority == null) {
83+
return Mono.error(new IllegalArgumentException("Parameter priority is required and cannot be null."));
84+
}
85+
final String accept = "application/json";
86+
return FluxUtil
87+
.withContext(context -> service.setPriority(this.client.getEndpoint(), priority, accept, context))
88+
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
89+
}
90+
91+
/**
92+
* The setPriority operation.
93+
*
94+
* @param priority The priority parameter.
95+
* @param context The context to associate with this operation.
96+
* @throws IllegalArgumentException thrown if parameters fail the validation.
97+
* @throws ManagementException thrown if the request is rejected by server.
98+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
99+
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
100+
*/
101+
@ServiceMethod(returns = ReturnType.SINGLE)
102+
private Mono<Response<Priority>> setPriorityWithResponseAsync(Priority priority, Context context) {
103+
if (this.client.getEndpoint() == null) {
104+
return Mono.error(
105+
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
106+
}
107+
if (priority == null) {
108+
return Mono.error(new IllegalArgumentException("Parameter priority is required and cannot be null."));
109+
}
110+
final String accept = "application/json";
111+
context = this.client.mergeContext(context);
112+
return service.setPriority(this.client.getEndpoint(), priority, accept, context);
113+
}
114+
115+
/**
116+
* The setPriority operation.
117+
*
118+
* @param priority The priority parameter.
119+
* @throws IllegalArgumentException thrown if parameters fail the validation.
120+
* @throws ManagementException thrown if the request is rejected by server.
121+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
122+
* @return the response body on successful completion of {@link Mono}.
123+
*/
124+
@ServiceMethod(returns = ReturnType.SINGLE)
125+
private Mono<Priority> setPriorityAsync(Priority priority) {
126+
return setPriorityWithResponseAsync(priority).flatMap(res -> Mono.justOrEmpty(res.getValue()));
127+
}
128+
129+
/**
130+
* The setPriority operation.
131+
*
132+
* @param priority The priority parameter.
133+
* @param context The context to associate with this operation.
134+
* @throws IllegalArgumentException thrown if parameters fail the validation.
135+
* @throws ManagementException thrown if the request is rejected by server.
136+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
137+
* @return the response body along with {@link Response}.
138+
*/
139+
@ServiceMethod(returns = ReturnType.SINGLE)
140+
public Response<Priority> setPriorityWithResponse(Priority priority, Context context) {
141+
return setPriorityWithResponseAsync(priority, context).block();
142+
}
143+
144+
/**
145+
* The setPriority operation.
146+
*
147+
* @param priority The priority parameter.
148+
* @throws IllegalArgumentException thrown if parameters fail the validation.
149+
* @throws ManagementException thrown if the request is rejected by server.
150+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
151+
* @return the response.
152+
*/
153+
@ServiceMethod(returns = ReturnType.SINGLE)
154+
public Priority setPriority(Priority priority) {
155+
return setPriorityWithResponse(priority, Context.NONE).getValue();
156+
}
157+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package tsptest.armstreamstyleserialization.implementation;
6+
7+
import com.azure.core.http.rest.Response;
8+
import com.azure.core.util.Context;
9+
import com.azure.core.util.logging.ClientLogger;
10+
import tsptest.armstreamstyleserialization.fluent.PrioritiesClient;
11+
import tsptest.armstreamstyleserialization.models.Priorities;
12+
import tsptest.armstreamstyleserialization.models.Priority;
13+
14+
public final class PrioritiesImpl implements Priorities {
15+
private static final ClientLogger LOGGER = new ClientLogger(PrioritiesImpl.class);
16+
17+
private final PrioritiesClient innerClient;
18+
19+
private final tsptest.armstreamstyleserialization.ArmStreamStyleSerializationManager serviceManager;
20+
21+
public PrioritiesImpl(PrioritiesClient innerClient,
22+
tsptest.armstreamstyleserialization.ArmStreamStyleSerializationManager serviceManager) {
23+
this.innerClient = innerClient;
24+
this.serviceManager = serviceManager;
25+
}
26+
27+
public Response<Priority> setPriorityWithResponse(Priority priority, Context context) {
28+
return this.serviceClient().setPriorityWithResponse(priority, context);
29+
}
30+
31+
public Priority setPriority(Priority priority) {
32+
return this.serviceClient().setPriority(priority);
33+
}
34+
35+
private PrioritiesClient serviceClient() {
36+
return this.innerClient;
37+
}
38+
39+
private tsptest.armstreamstyleserialization.ArmStreamStyleSerializationManager manager() {
40+
return this.serviceManager;
41+
}
42+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package tsptest.armstreamstyleserialization.models;
6+
7+
import com.azure.core.http.rest.Response;
8+
import com.azure.core.util.Context;
9+
10+
/**
11+
* Resource collection API of Priorities.
12+
*/
13+
public interface Priorities {
14+
/**
15+
* The setPriority operation.
16+
*
17+
* @param priority The priority parameter.
18+
* @param context The context to associate with this operation.
19+
* @throws IllegalArgumentException thrown if parameters fail the validation.
20+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
21+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
22+
* @return the response body along with {@link Response}.
23+
*/
24+
Response<Priority> setPriorityWithResponse(Priority priority, Context context);
25+
26+
/**
27+
* The setPriority operation.
28+
*
29+
* @param priority The priority parameter.
30+
* @throws IllegalArgumentException thrown if parameters fail the validation.
31+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
32+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
33+
* @return the response.
34+
*/
35+
Priority setPriority(Priority priority);
36+
}

0 commit comments

Comments
 (0)