Skip to content

Commit de237a4

Browse files
v4, update m4 to 4.15.447 for javagen (#900)
* update m4 to 4.15.447 for javagen * increase version * regen tests * update tests
1 parent 71ad503 commit de237a4

File tree

75 files changed

+3535
-1371
lines changed

Some content is hidden

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

75 files changed

+3535
-1371
lines changed

azure-tests/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Mono<Response<Void>> postRequired(
5959
@QueryParam("query") Integer query,
6060
@PathParam("path") String path,
6161
@BodyParam("application/json") int body,
62+
@HeaderParam("Accept") String accept,
6263
Context context);
6364

6465
@Post("/parameterGrouping/postOptional")
@@ -68,6 +69,7 @@ Mono<Response<Void>> postOptional(
6869
@HostParam("$host") String host,
6970
@HeaderParam("customHeader") String customHeader,
7071
@QueryParam("query") Integer query,
72+
@HeaderParam("Accept") String accept,
7173
Context context);
7274

7375
@Post("/parameterGrouping/postMultipleParameterGroups")
@@ -79,6 +81,7 @@ Mono<Response<Void>> postMultiParamGroups(
7981
@QueryParam("query-one") Integer queryOne,
8082
@HeaderParam("header-two") String headerTwo,
8183
@QueryParam("query-two") Integer queryTwo,
84+
@HeaderParam("Accept") String accept,
8285
Context context);
8386

8487
@Post("/parameterGrouping/sharedParameterGroupObject")
@@ -88,6 +91,7 @@ Mono<Response<Void>> postSharedParameterGroupObject(
8891
@HostParam("$host") String host,
8992
@HeaderParam("header-one") String headerOne,
9093
@QueryParam("query-one") Integer queryOne,
94+
@HeaderParam("Accept") String accept,
9195
Context context);
9296
}
9397

@@ -114,12 +118,14 @@ public Mono<Response<Void>> postRequiredWithResponseAsync(
114118
} else {
115119
parameterGroupingPostRequiredParameters.validate();
116120
}
121+
final String accept = "application/json";
117122
String customHeader = parameterGroupingPostRequiredParameters.getCustomHeader();
118123
Integer query = parameterGroupingPostRequiredParameters.getQuery();
119124
String path = parameterGroupingPostRequiredParameters.getPath();
120125
int body = parameterGroupingPostRequiredParameters.getBody();
121126
return FluxUtil.withContext(
122-
context -> service.postRequired(this.client.getHost(), customHeader, query, path, body, context));
127+
context ->
128+
service.postRequired(this.client.getHost(), customHeader, query, path, body, accept, context));
123129
}
124130

125131
/**
@@ -170,6 +176,7 @@ public Mono<Response<Void>> postOptionalWithResponseAsync(
170176
if (parameterGroupingPostOptionalParameters != null) {
171177
parameterGroupingPostOptionalParameters.validate();
172178
}
179+
final String accept = "application/json";
173180
String customHeaderInternal = null;
174181
if (parameterGroupingPostOptionalParameters != null) {
175182
customHeaderInternal = parameterGroupingPostOptionalParameters.getCustomHeader();
@@ -181,7 +188,7 @@ public Mono<Response<Void>> postOptionalWithResponseAsync(
181188
}
182189
Integer query = queryInternal;
183190
return FluxUtil.withContext(
184-
context -> service.postOptional(this.client.getHost(), customHeader, query, context));
191+
context -> service.postOptional(this.client.getHost(), customHeader, query, accept, context));
185192
}
186193

187194
/**
@@ -264,6 +271,7 @@ public Mono<Response<Void>> postMultiParamGroupsWithResponseAsync(
264271
if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) {
265272
parameterGroupingPostMultiParamGroupsSecondParamGroup.validate();
266273
}
274+
final String accept = "application/json";
267275
String headerOneInternal = null;
268276
if (firstParameterGroup != null) {
269277
headerOneInternal = firstParameterGroup.getHeaderOne();
@@ -287,7 +295,7 @@ public Mono<Response<Void>> postMultiParamGroupsWithResponseAsync(
287295
return FluxUtil.withContext(
288296
context ->
289297
service.postMultiParamGroups(
290-
this.client.getHost(), headerOne, queryOne, headerTwo, queryTwo, context));
298+
this.client.getHost(), headerOne, queryOne, headerTwo, queryTwo, accept, context));
291299
}
292300

293301
/**
@@ -377,6 +385,7 @@ public Mono<Response<Void>> postSharedParameterGroupObjectWithResponseAsync(
377385
if (firstParameterGroup != null) {
378386
firstParameterGroup.validate();
379387
}
388+
final String accept = "application/json";
380389
String headerOneInternal = null;
381390
if (firstParameterGroup != null) {
382391
headerOneInternal = firstParameterGroup.getHeaderOne();
@@ -388,7 +397,9 @@ public Mono<Response<Void>> postSharedParameterGroupObjectWithResponseAsync(
388397
}
389398
Integer queryOne = queryOneInternal;
390399
return FluxUtil.withContext(
391-
context -> service.postSharedParameterGroupObject(this.client.getHost(), headerOne, queryOne, context));
400+
context ->
401+
service.postSharedParameterGroupObject(
402+
this.client.getHost(), headerOne, queryOne, accept, context));
392403
}
393404

394405
/**

azure-tests/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.azure.core.annotation.ExpectedResponses;
44
import com.azure.core.annotation.Get;
5+
import com.azure.core.annotation.HeaderParam;
56
import com.azure.core.annotation.Host;
67
import com.azure.core.annotation.HostParam;
78
import com.azure.core.annotation.QueryParam;
@@ -116,7 +117,10 @@ private interface AutoRestReportServiceForAzureService {
116117
@ExpectedResponses({200})
117118
@UnexpectedResponseExceptionType(ErrorException.class)
118119
Mono<Response<Map<String, Integer>>> getReport(
119-
@HostParam("$host") String host, @QueryParam("qualifier") String qualifier, Context context);
120+
@HostParam("$host") String host,
121+
@QueryParam("qualifier") String qualifier,
122+
@HeaderParam("Accept") String accept,
123+
Context context);
120124
}
121125

122126
/**
@@ -134,7 +138,8 @@ public Mono<Response<Map<String, Integer>>> getReportWithResponseAsync(String qu
134138
if (this.getHost() == null) {
135139
return Mono.error(new IllegalArgumentException("Parameter this.getHost() is required and cannot be null."));
136140
}
137-
return FluxUtil.withContext(context -> service.getReport(this.getHost(), qualifier, context));
141+
final String accept = "application/json";
142+
return FluxUtil.withContext(context -> service.getReport(this.getHost(), qualifier, accept, context));
138143
}
139144

140145
/**

azure-tests/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.azure.core.annotation.ExpectedResponses;
44
import com.azure.core.annotation.Get;
5+
import com.azure.core.annotation.HeaderParam;
56
import com.azure.core.annotation.Host;
67
import com.azure.core.annotation.HostParam;
78
import com.azure.core.annotation.QueryParam;
@@ -47,25 +48,37 @@ private interface ApiVersionDefaultsService {
4748
@ExpectedResponses({200})
4849
@UnexpectedResponseExceptionType(ErrorException.class)
4950
Mono<Response<Void>> getMethodGlobalValid(
50-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
51+
@HostParam("$host") String host,
52+
@QueryParam("api-version") String apiVersion,
53+
@HeaderParam("Accept") String accept,
54+
Context context);
5155

5256
@Get("/azurespecials/apiVersion/method/string/none/query/globalNotProvided/2015-07-01-preview")
5357
@ExpectedResponses({200})
5458
@UnexpectedResponseExceptionType(ErrorException.class)
5559
Mono<Response<Void>> getMethodGlobalNotProvidedValid(
56-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
60+
@HostParam("$host") String host,
61+
@QueryParam("api-version") String apiVersion,
62+
@HeaderParam("Accept") String accept,
63+
Context context);
5764

5865
@Get("/azurespecials/apiVersion/path/string/none/query/global/2015-07-01-preview")
5966
@ExpectedResponses({200})
6067
@UnexpectedResponseExceptionType(ErrorException.class)
6168
Mono<Response<Void>> getPathGlobalValid(
62-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
69+
@HostParam("$host") String host,
70+
@QueryParam("api-version") String apiVersion,
71+
@HeaderParam("Accept") String accept,
72+
Context context);
6373

6474
@Get("/azurespecials/apiVersion/swagger/string/none/query/global/2015-07-01-preview")
6575
@ExpectedResponses({200})
6676
@UnexpectedResponseExceptionType(ErrorException.class)
6777
Mono<Response<Void>> getSwaggerGlobalValid(
68-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
78+
@HostParam("$host") String host,
79+
@QueryParam("api-version") String apiVersion,
80+
@HeaderParam("Accept") String accept,
81+
Context context);
6982
}
7083

7184
/**
@@ -81,8 +94,11 @@ public Mono<Response<Void>> getMethodGlobalValidWithResponseAsync() {
8194
return Mono.error(
8295
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
8396
}
97+
final String accept = "application/json";
8498
return FluxUtil.withContext(
85-
context -> service.getMethodGlobalValid(this.client.getHost(), this.client.getApiVersion(), context));
99+
context ->
100+
service.getMethodGlobalValid(
101+
this.client.getHost(), this.client.getApiVersion(), accept, context));
86102
}
87103

88104
/**
@@ -121,10 +137,11 @@ public Mono<Response<Void>> getMethodGlobalNotProvidedValidWithResponseAsync() {
121137
return Mono.error(
122138
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
123139
}
140+
final String accept = "application/json";
124141
return FluxUtil.withContext(
125142
context ->
126143
service.getMethodGlobalNotProvidedValid(
127-
this.client.getHost(), this.client.getApiVersion(), context));
144+
this.client.getHost(), this.client.getApiVersion(), accept, context));
128145
}
129146

130147
/**
@@ -163,8 +180,11 @@ public Mono<Response<Void>> getPathGlobalValidWithResponseAsync() {
163180
return Mono.error(
164181
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
165182
}
183+
final String accept = "application/json";
166184
return FluxUtil.withContext(
167-
context -> service.getPathGlobalValid(this.client.getHost(), this.client.getApiVersion(), context));
185+
context ->
186+
service.getPathGlobalValid(
187+
this.client.getHost(), this.client.getApiVersion(), accept, context));
168188
}
169189

170190
/**
@@ -203,8 +223,11 @@ public Mono<Response<Void>> getSwaggerGlobalValidWithResponseAsync() {
203223
return Mono.error(
204224
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
205225
}
226+
final String accept = "application/json";
206227
return FluxUtil.withContext(
207-
context -> service.getSwaggerGlobalValid(this.client.getHost(), this.client.getApiVersion(), context));
228+
context ->
229+
service.getSwaggerGlobalValid(
230+
this.client.getHost(), this.client.getApiVersion(), accept, context));
208231
}
209232

210233
/**

azure-tests/src/main/java/fixtures/azurespecials/ApiVersionLocals.java

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.azure.core.annotation.ExpectedResponses;
44
import com.azure.core.annotation.Get;
5+
import com.azure.core.annotation.HeaderParam;
56
import com.azure.core.annotation.Host;
67
import com.azure.core.annotation.HostParam;
78
import com.azure.core.annotation.QueryParam;
@@ -47,25 +48,37 @@ private interface ApiVersionLocalsService {
4748
@ExpectedResponses({200})
4849
@UnexpectedResponseExceptionType(ErrorException.class)
4950
Mono<Response<Void>> getMethodLocalValid(
50-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
51+
@HostParam("$host") String host,
52+
@QueryParam("api-version") String apiVersion,
53+
@HeaderParam("Accept") String accept,
54+
Context context);
5155

5256
@Get("/azurespecials/apiVersion/method/string/none/query/local/null")
5357
@ExpectedResponses({200})
5458
@UnexpectedResponseExceptionType(ErrorException.class)
5559
Mono<Response<Void>> getMethodLocalNull(
56-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
60+
@HostParam("$host") String host,
61+
@QueryParam("api-version") String apiVersion,
62+
@HeaderParam("Accept") String accept,
63+
Context context);
5764

5865
@Get("/azurespecials/apiVersion/path/string/none/query/local/2.0")
5966
@ExpectedResponses({200})
6067
@UnexpectedResponseExceptionType(ErrorException.class)
6168
Mono<Response<Void>> getPathLocalValid(
62-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
69+
@HostParam("$host") String host,
70+
@QueryParam("api-version") String apiVersion,
71+
@HeaderParam("Accept") String accept,
72+
Context context);
6373

6474
@Get("/azurespecials/apiVersion/swagger/string/none/query/local/2.0")
6575
@ExpectedResponses({200})
6676
@UnexpectedResponseExceptionType(ErrorException.class)
6777
Mono<Response<Void>> getSwaggerLocalValid(
68-
@HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context);
78+
@HostParam("$host") String host,
79+
@QueryParam("api-version") String apiVersion,
80+
@HeaderParam("Accept") String accept,
81+
Context context);
6982
}
7083

7184
/**
@@ -82,7 +95,9 @@ public Mono<Response<Void>> getMethodLocalValidWithResponseAsync() {
8295
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
8396
}
8497
final String apiVersion = "2.0";
85-
return FluxUtil.withContext(context -> service.getMethodLocalValid(this.client.getHost(), apiVersion, context));
98+
final String accept = "application/json";
99+
return FluxUtil.withContext(
100+
context -> service.getMethodLocalValid(this.client.getHost(), apiVersion, accept, context));
86101
}
87102

88103
/**
@@ -124,7 +139,9 @@ public Mono<Response<Void>> getMethodLocalNullWithResponseAsync(String apiVersio
124139
return Mono.error(
125140
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
126141
}
127-
return FluxUtil.withContext(context -> service.getMethodLocalNull(this.client.getHost(), apiVersion, context));
142+
final String accept = "application/json";
143+
return FluxUtil.withContext(
144+
context -> service.getMethodLocalNull(this.client.getHost(), apiVersion, accept, context));
128145
}
129146

130147
/**
@@ -195,7 +212,9 @@ public Mono<Response<Void>> getPathLocalValidWithResponseAsync() {
195212
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
196213
}
197214
final String apiVersion = "2.0";
198-
return FluxUtil.withContext(context -> service.getPathLocalValid(this.client.getHost(), apiVersion, context));
215+
final String accept = "application/json";
216+
return FluxUtil.withContext(
217+
context -> service.getPathLocalValid(this.client.getHost(), apiVersion, accept, context));
199218
}
200219

201220
/**
@@ -235,8 +254,9 @@ public Mono<Response<Void>> getSwaggerLocalValidWithResponseAsync() {
235254
new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null."));
236255
}
237256
final String apiVersion = "2.0";
257+
final String accept = "application/json";
238258
return FluxUtil.withContext(
239-
context -> service.getSwaggerLocalValid(this.client.getHost(), apiVersion, context));
259+
context -> service.getSwaggerLocalValid(this.client.getHost(), apiVersion, accept, context));
240260
}
241261

242262
/**

azure-tests/src/main/java/fixtures/azurespecials/Headers.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ private interface HeadersService {
5151
Mono<HeadersCustomNamedRequestIdResponse> customNamedRequestId(
5252
@HostParam("$host") String host,
5353
@HeaderParam("foo-client-request-id") String fooClientRequestId,
54+
@HeaderParam("Accept") String accept,
5455
Context context);
5556

5657
@Post("/azurespecials/customNamedRequestIdParamGrouping")
@@ -59,6 +60,7 @@ Mono<HeadersCustomNamedRequestIdResponse> customNamedRequestId(
5960
Mono<HeadersCustomNamedRequestIdParamGroupingResponse> customNamedRequestIdParamGrouping(
6061
@HostParam("$host") String host,
6162
@HeaderParam("foo-client-request-id") String fooClientRequestId,
63+
@HeaderParam("Accept") String accept,
6264
Context context);
6365

6466
@Head("/azurespecials/customNamedRequestIdHead")
@@ -67,6 +69,7 @@ Mono<HeadersCustomNamedRequestIdParamGroupingResponse> customNamedRequestIdParam
6769
Mono<HeadersCustomNamedRequestIdHeadResponse> customNamedRequestIdHead(
6870
@HostParam("$host") String host,
6971
@HeaderParam("foo-client-request-id") String fooClientRequestId,
72+
@HeaderParam("Accept") String accept,
7073
Context context);
7174
}
7275

@@ -89,8 +92,9 @@ public Mono<HeadersCustomNamedRequestIdResponse> customNamedRequestIdWithRespons
8992
return Mono.error(
9093
new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null."));
9194
}
95+
final String accept = "application/json";
9296
return FluxUtil.withContext(
93-
context -> service.customNamedRequestId(this.client.getHost(), fooClientRequestId, context));
97+
context -> service.customNamedRequestId(this.client.getHost(), fooClientRequestId, accept, context));
9498
}
9599

96100
/**
@@ -145,10 +149,12 @@ public Mono<HeadersCustomNamedRequestIdParamGroupingResponse> customNamedRequest
145149
} else {
146150
headerCustomNamedRequestIdParamGroupingParameters.validate();
147151
}
152+
final String accept = "application/json";
148153
String fooClientRequestId = headerCustomNamedRequestIdParamGroupingParameters.getFooClientRequestId();
149154
return FluxUtil.withContext(
150155
context ->
151-
service.customNamedRequestIdParamGrouping(this.client.getHost(), fooClientRequestId, context));
156+
service.customNamedRequestIdParamGrouping(
157+
this.client.getHost(), fooClientRequestId, accept, context));
152158
}
153159

154160
/**
@@ -203,8 +209,10 @@ public Mono<HeadersCustomNamedRequestIdHeadResponse> customNamedRequestIdHeadWit
203209
return Mono.error(
204210
new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null."));
205211
}
212+
final String accept = "application/json";
206213
return FluxUtil.withContext(
207-
context -> service.customNamedRequestIdHead(this.client.getHost(), fooClientRequestId, context));
214+
context ->
215+
service.customNamedRequestIdHead(this.client.getHost(), fooClientRequestId, accept, context));
208216
}
209217

210218
/**

0 commit comments

Comments
 (0)