Skip to content

Commit 8502aff

Browse files
The PR for tsp, update @azure-tools/cadl-ranch-specs to 0.33.2 (#2745)
* The 1st PR for tsp, update @azure-tools/cadl-ranch-specs to 0.332 * re-generate test code * Fixed ci exception * Fixed for #2745 (comment) * Rollback source for #2745 (comment) --------- Co-authored-by: actions-user <[email protected]>
1 parent 609065d commit 8502aff

File tree

117 files changed

+10002
-105
lines changed

Some content is hidden

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

117 files changed

+10002
-105
lines changed

typespec-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"testserver-run": "npx cadl-ranch serve ./node_modules/@azure-tools/cadl-ranch-specs/http --coverageFile ./cadl-ranch-coverage-java.json"
1010
},
1111
"dependencies": {
12-
"@azure-tools/cadl-ranch-specs": "0.32.0",
12+
"@azure-tools/cadl-ranch-specs": "0.33.2",
1313
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.15.15.tgz"
1414
},
1515
"devDependencies": {

typespec-tests/src/main/java/com/specialheaders/clientrequestid/ClientRequestIdAsyncClient.java renamed to typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdAsyncClient.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33
// Code generated by Microsoft (R) TypeSpec Code Generator.
44

5-
package com.specialheaders.clientrequestid;
5+
package com.azure.specialheaders.xmsclientrequestid;
66

77
import com.azure.core.annotation.Generated;
88
import com.azure.core.annotation.ReturnType;
@@ -15,37 +15,37 @@
1515
import com.azure.core.http.rest.RequestOptions;
1616
import com.azure.core.http.rest.Response;
1717
import com.azure.core.util.FluxUtil;
18-
import com.specialheaders.clientrequestid.implementation.ClientRequestIdClientImpl;
18+
import com.azure.specialheaders.xmsclientrequestid.implementation.XmsClientRequestIdClientImpl;
1919
import reactor.core.publisher.Mono;
2020

2121
/**
22-
* Initializes a new instance of the asynchronous ClientRequestIdClient type.
22+
* Initializes a new instance of the asynchronous XmsClientRequestIdClient type.
2323
*/
24-
@ServiceClient(builder = ClientRequestIdClientBuilder.class, isAsync = true)
25-
public final class ClientRequestIdAsyncClient {
24+
@ServiceClient(builder = XmsClientRequestIdClientBuilder.class, isAsync = true)
25+
public final class XmsClientRequestIdAsyncClient {
2626
@Generated
27-
private final ClientRequestIdClientImpl serviceClient;
27+
private final XmsClientRequestIdClientImpl serviceClient;
2828

2929
/**
30-
* Initializes an instance of ClientRequestIdAsyncClient class.
30+
* Initializes an instance of XmsClientRequestIdAsyncClient class.
3131
*
3232
* @param serviceClient the service client implementation.
3333
*/
3434
@Generated
35-
ClientRequestIdAsyncClient(ClientRequestIdClientImpl serviceClient) {
35+
XmsClientRequestIdAsyncClient(XmsClientRequestIdClientImpl serviceClient) {
3636
this.serviceClient = serviceClient;
3737
}
3838

3939
/**
40-
* Get operation with azure client request id header.
40+
* Get operation with azure `x-ms-client-request-id` header.
4141
*
4242
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
4343
* @throws HttpResponseException thrown if the request is rejected by server.
4444
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
4545
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
4646
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
47-
* @return operation with azure client request id header along with {@link Response} on successful completion of
48-
* {@link Mono}.
47+
* @return operation with azure `x-ms-client-request-id` header along with {@link Response} on successful completion
48+
* of {@link Mono}.
4949
*/
5050
@Generated
5151
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -54,14 +54,14 @@ public Mono<Response<Void>> getWithResponse(RequestOptions requestOptions) {
5454
}
5555

5656
/**
57-
* Get operation with azure client request id header.
57+
* Get operation with azure `x-ms-client-request-id` header.
5858
*
5959
* @throws HttpResponseException thrown if the request is rejected by server.
6060
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
6161
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
6262
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
6363
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
64-
* @return operation with azure client request id header on successful completion of {@link Mono}.
64+
* @return operation with azure `x-ms-client-request-id` header on successful completion of {@link Mono}.
6565
*/
6666
@Generated
6767
@ServiceMethod(returns = ReturnType.SINGLE)

typespec-tests/src/main/java/com/specialheaders/clientrequestid/ClientRequestIdClient.java renamed to typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClient.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33
// Code generated by Microsoft (R) TypeSpec Code Generator.
44

5-
package com.specialheaders.clientrequestid;
5+
package com.azure.specialheaders.xmsclientrequestid;
66

77
import com.azure.core.annotation.Generated;
88
import com.azure.core.annotation.ReturnType;
@@ -14,35 +14,35 @@
1414
import com.azure.core.exception.ResourceNotFoundException;
1515
import com.azure.core.http.rest.RequestOptions;
1616
import com.azure.core.http.rest.Response;
17-
import com.specialheaders.clientrequestid.implementation.ClientRequestIdClientImpl;
17+
import com.azure.specialheaders.xmsclientrequestid.implementation.XmsClientRequestIdClientImpl;
1818

1919
/**
20-
* Initializes a new instance of the synchronous ClientRequestIdClient type.
20+
* Initializes a new instance of the synchronous XmsClientRequestIdClient type.
2121
*/
22-
@ServiceClient(builder = ClientRequestIdClientBuilder.class)
23-
public final class ClientRequestIdClient {
22+
@ServiceClient(builder = XmsClientRequestIdClientBuilder.class)
23+
public final class XmsClientRequestIdClient {
2424
@Generated
25-
private final ClientRequestIdClientImpl serviceClient;
25+
private final XmsClientRequestIdClientImpl serviceClient;
2626

2727
/**
28-
* Initializes an instance of ClientRequestIdClient class.
28+
* Initializes an instance of XmsClientRequestIdClient class.
2929
*
3030
* @param serviceClient the service client implementation.
3131
*/
3232
@Generated
33-
ClientRequestIdClient(ClientRequestIdClientImpl serviceClient) {
33+
XmsClientRequestIdClient(XmsClientRequestIdClientImpl serviceClient) {
3434
this.serviceClient = serviceClient;
3535
}
3636

3737
/**
38-
* Get operation with azure client request id header.
38+
* Get operation with azure `x-ms-client-request-id` header.
3939
*
4040
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
4141
* @throws HttpResponseException thrown if the request is rejected by server.
4242
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
4343
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
4444
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
45-
* @return operation with azure client request id header along with {@link Response}.
45+
* @return operation with azure `x-ms-client-request-id` header along with {@link Response}.
4646
*/
4747
@Generated
4848
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -51,7 +51,7 @@ public Response<Void> getWithResponse(RequestOptions requestOptions) {
5151
}
5252

5353
/**
54-
* Get operation with azure client request id header.
54+
* Get operation with azure `x-ms-client-request-id` header.
5555
*
5656
* @throws HttpResponseException thrown if the request is rejected by server.
5757
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.

typespec-tests/src/main/java/com/specialheaders/clientrequestid/ClientRequestIdClientBuilder.java renamed to typespec-tests/src/main/java/com/azure/specialheaders/xmsclientrequestid/XmsClientRequestIdClientBuilder.java

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33
// Code generated by Microsoft (R) TypeSpec Code Generator.
44

5-
package com.specialheaders.clientrequestid;
5+
package com.azure.specialheaders.xmsclientrequestid;
66

77
import com.azure.core.annotation.Generated;
88
import com.azure.core.annotation.ServiceClientBuilder;
@@ -31,18 +31,18 @@
3131
import com.azure.core.util.builder.ClientBuilderUtil;
3232
import com.azure.core.util.logging.ClientLogger;
3333
import com.azure.core.util.serializer.JacksonAdapter;
34-
import com.specialheaders.clientrequestid.implementation.ClientRequestIdClientImpl;
34+
import com.azure.specialheaders.xmsclientrequestid.implementation.XmsClientRequestIdClientImpl;
3535
import java.util.ArrayList;
3636
import java.util.List;
3737
import java.util.Map;
3838
import java.util.Objects;
3939

4040
/**
41-
* A builder for creating a new instance of the ClientRequestIdClient type.
41+
* A builder for creating a new instance of the XmsClientRequestIdClient type.
4242
*/
43-
@ServiceClientBuilder(serviceClients = { ClientRequestIdClient.class, ClientRequestIdAsyncClient.class })
44-
public final class ClientRequestIdClientBuilder
45-
implements HttpTrait<ClientRequestIdClientBuilder>, ConfigurationTrait<ClientRequestIdClientBuilder> {
43+
@ServiceClientBuilder(serviceClients = { XmsClientRequestIdClient.class, XmsClientRequestIdAsyncClient.class })
44+
public final class XmsClientRequestIdClientBuilder
45+
implements HttpTrait<XmsClientRequestIdClientBuilder>, ConfigurationTrait<XmsClientRequestIdClientBuilder> {
4646
@Generated
4747
private static final String SDK_NAME = "name";
4848

@@ -51,16 +51,16 @@ public final class ClientRequestIdClientBuilder
5151

5252
@Generated
5353
private static final Map<String, String> PROPERTIES
54-
= CoreUtils.getProperties("specialheaders-clientrequestid.properties");
54+
= CoreUtils.getProperties("azure-specialheaders-xmsclientrequestid.properties");
5555

5656
@Generated
5757
private final List<HttpPipelinePolicy> pipelinePolicies;
5858

5959
/**
60-
* Create an instance of the ClientRequestIdClientBuilder.
60+
* Create an instance of the XmsClientRequestIdClientBuilder.
6161
*/
6262
@Generated
63-
public ClientRequestIdClientBuilder() {
63+
public XmsClientRequestIdClientBuilder() {
6464
this.pipelinePolicies = new ArrayList<>();
6565
}
6666

@@ -75,7 +75,7 @@ public ClientRequestIdClientBuilder() {
7575
*/
7676
@Generated
7777
@Override
78-
public ClientRequestIdClientBuilder pipeline(HttpPipeline pipeline) {
78+
public XmsClientRequestIdClientBuilder pipeline(HttpPipeline pipeline) {
7979
if (this.pipeline != null && pipeline == null) {
8080
LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
8181
}
@@ -94,7 +94,7 @@ public ClientRequestIdClientBuilder pipeline(HttpPipeline pipeline) {
9494
*/
9595
@Generated
9696
@Override
97-
public ClientRequestIdClientBuilder httpClient(HttpClient httpClient) {
97+
public XmsClientRequestIdClientBuilder httpClient(HttpClient httpClient) {
9898
this.httpClient = httpClient;
9999
return this;
100100
}
@@ -110,7 +110,7 @@ public ClientRequestIdClientBuilder httpClient(HttpClient httpClient) {
110110
*/
111111
@Generated
112112
@Override
113-
public ClientRequestIdClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
113+
public XmsClientRequestIdClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
114114
this.httpLogOptions = httpLogOptions;
115115
return this;
116116
}
@@ -126,7 +126,7 @@ public ClientRequestIdClientBuilder httpLogOptions(HttpLogOptions httpLogOptions
126126
*/
127127
@Generated
128128
@Override
129-
public ClientRequestIdClientBuilder clientOptions(ClientOptions clientOptions) {
129+
public XmsClientRequestIdClientBuilder clientOptions(ClientOptions clientOptions) {
130130
this.clientOptions = clientOptions;
131131
return this;
132132
}
@@ -142,7 +142,7 @@ public ClientRequestIdClientBuilder clientOptions(ClientOptions clientOptions) {
142142
*/
143143
@Generated
144144
@Override
145-
public ClientRequestIdClientBuilder retryOptions(RetryOptions retryOptions) {
145+
public XmsClientRequestIdClientBuilder retryOptions(RetryOptions retryOptions) {
146146
this.retryOptions = retryOptions;
147147
return this;
148148
}
@@ -152,7 +152,7 @@ public ClientRequestIdClientBuilder retryOptions(RetryOptions retryOptions) {
152152
*/
153153
@Generated
154154
@Override
155-
public ClientRequestIdClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
155+
public XmsClientRequestIdClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
156156
Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.");
157157
pipelinePolicies.add(customPolicy);
158158
return this;
@@ -169,7 +169,7 @@ public ClientRequestIdClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
169169
*/
170170
@Generated
171171
@Override
172-
public ClientRequestIdClientBuilder configuration(Configuration configuration) {
172+
public XmsClientRequestIdClientBuilder configuration(Configuration configuration) {
173173
this.configuration = configuration;
174174
return this;
175175
}
@@ -184,24 +184,24 @@ public ClientRequestIdClientBuilder configuration(Configuration configuration) {
184184
* Sets The retry policy that will attempt to retry failed requests, if applicable.
185185
*
186186
* @param retryPolicy the retryPolicy value.
187-
* @return the ClientRequestIdClientBuilder.
187+
* @return the XmsClientRequestIdClientBuilder.
188188
*/
189189
@Generated
190-
public ClientRequestIdClientBuilder retryPolicy(RetryPolicy retryPolicy) {
190+
public XmsClientRequestIdClientBuilder retryPolicy(RetryPolicy retryPolicy) {
191191
this.retryPolicy = retryPolicy;
192192
return this;
193193
}
194194

195195
/**
196-
* Builds an instance of ClientRequestIdClientImpl with the provided parameters.
196+
* Builds an instance of XmsClientRequestIdClientImpl with the provided parameters.
197197
*
198-
* @return an instance of ClientRequestIdClientImpl.
198+
* @return an instance of XmsClientRequestIdClientImpl.
199199
*/
200200
@Generated
201-
private ClientRequestIdClientImpl buildInnerClient() {
201+
private XmsClientRequestIdClientImpl buildInnerClient() {
202202
HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
203-
ClientRequestIdClientImpl client
204-
= new ClientRequestIdClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter());
203+
XmsClientRequestIdClientImpl client
204+
= new XmsClientRequestIdClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter());
205205
return client;
206206
}
207207

@@ -216,7 +216,7 @@ private HttpPipeline createHttpPipeline() {
216216
String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
217217
String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);
218218
policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));
219-
policies.add(new RequestIdPolicy("client-request-id"));
219+
policies.add(new RequestIdPolicy());
220220
policies.add(new AddHeadersFromContextPolicy());
221221
HttpHeaders headers = new HttpHeaders();
222222
localClientOptions.getHeaders()
@@ -243,24 +243,24 @@ private HttpPipeline createHttpPipeline() {
243243
}
244244

245245
/**
246-
* Builds an instance of ClientRequestIdAsyncClient class.
246+
* Builds an instance of XmsClientRequestIdAsyncClient class.
247247
*
248-
* @return an instance of ClientRequestIdAsyncClient.
248+
* @return an instance of XmsClientRequestIdAsyncClient.
249249
*/
250250
@Generated
251-
public ClientRequestIdAsyncClient buildAsyncClient() {
252-
return new ClientRequestIdAsyncClient(buildInnerClient());
251+
public XmsClientRequestIdAsyncClient buildAsyncClient() {
252+
return new XmsClientRequestIdAsyncClient(buildInnerClient());
253253
}
254254

255255
/**
256-
* Builds an instance of ClientRequestIdClient class.
256+
* Builds an instance of XmsClientRequestIdClient class.
257257
*
258-
* @return an instance of ClientRequestIdClient.
258+
* @return an instance of XmsClientRequestIdClient.
259259
*/
260260
@Generated
261-
public ClientRequestIdClient buildClient() {
262-
return new ClientRequestIdClient(buildInnerClient());
261+
public XmsClientRequestIdClient buildClient() {
262+
return new XmsClientRequestIdClient(buildInnerClient());
263263
}
264264

265-
private static final ClientLogger LOGGER = new ClientLogger(ClientRequestIdClientBuilder.class);
265+
private static final ClientLogger LOGGER = new ClientLogger(XmsClientRequestIdClientBuilder.class);
266266
}

0 commit comments

Comments
 (0)