Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: dependencies
packages:
- "@typespec/http-client-java"
---

Update @azure-tools/typespec-client-generator-core to 0.67.1 and other dev dependencies to latest
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@typespec/sse": "0.81.0",
"@typespec/streams": "0.81.0",
"@azure-tools/typespec-azure-core": "0.67.0",
"@azure-tools/typespec-client-generator-core": "0.67.0",
"@azure-tools/typespec-client-generator-core": "0.67.1",
"@azure-tools/typespec-azure-resource-manager": "0.67.0",
"@azure-tools/typespec-autorest": "0.67.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ public BinaryData downloadFileMultipleContentTypes(DownloadFileMultipleContentTy
/**
* The uploadFileDefaultContentType operation.
*
* @param contentType Body parameter's content type. Known values are */*.
* @param file The file parameter.
* @param contentLength The Content-Length header for the request.
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
Expand All @@ -250,17 +249,16 @@ public BinaryData downloadFileMultipleContentTypes(DownloadFileMultipleContentTy
*/
@Metadata(properties = { MetadataProperties.GENERATED })
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentType, BinaryData file,
long contentLength, RequestContext requestContext) {
public Response<Void> uploadFileDefaultContentTypeWithResponse(BinaryData file, long contentLength,
RequestContext requestContext) {
return this.instrumentation.instrumentWithResponse("Type.File.Body.uploadFileDefaultContentType",
requestContext, updatedContext -> this.serviceClient.uploadFileDefaultContentTypeWithResponse(contentType,
file, contentLength, updatedContext));
requestContext, updatedContext -> this.serviceClient.uploadFileDefaultContentTypeWithResponse(file,
contentLength, updatedContext));
}

/**
* The uploadFileDefaultContentType operation.
*
* @param contentType Body parameter's content type. Known values are *&#47;*.
* @param file The file parameter.
* @param contentLength The Content-Length header for the request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
Expand All @@ -269,14 +267,13 @@ public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentTyp
*/
@Metadata(properties = { MetadataProperties.GENERATED })
@ServiceMethod(returns = ReturnType.SINGLE)
public void uploadFileDefaultContentType(String contentType, BinaryData file, long contentLength) {
uploadFileDefaultContentTypeWithResponse(contentType, file, contentLength, RequestContext.none());
public void uploadFileDefaultContentType(BinaryData file, long contentLength) {
uploadFileDefaultContentTypeWithResponse(file, contentLength, RequestContext.none());
}

/**
* The downloadFileDefaultContentType operation.
*
* @param accept The accept parameter.
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the service returns an error.
Expand All @@ -285,25 +282,22 @@ public void uploadFileDefaultContentType(String contentType, BinaryData file, lo
*/
@Metadata(properties = { MetadataProperties.GENERATED })
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(String accept,
RequestContext requestContext) {
public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(RequestContext requestContext) {
return this.instrumentation.instrumentWithResponse("Type.File.Body.downloadFileDefaultContentType",
requestContext,
updatedContext -> this.serviceClient.downloadFileDefaultContentTypeWithResponse(accept, updatedContext));
updatedContext -> this.serviceClient.downloadFileDefaultContentTypeWithResponse(updatedContext));
}

/**
* The downloadFileDefaultContentType operation.
*
* @param accept The accept parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the service returns an error.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/
@Metadata(properties = { MetadataProperties.GENERATED })
@ServiceMethod(returns = ReturnType.SINGLE)
public BinaryData downloadFileDefaultContentType(String accept) {
return downloadFileDefaultContentTypeWithResponse(accept, RequestContext.none()).getValue();
public BinaryData downloadFileDefaultContentType() {
return downloadFileDefaultContentTypeWithResponse(RequestContext.none()).getValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ public Response<BinaryData> downloadFileMultipleContentTypesWithResponse(
/**
* The uploadFileDefaultContentType operation.
*
* @param contentType Body parameter's content type. Known values are *&#47;*.
* @param file The file parameter.
* @param contentLength The Content-Length header for the request.
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
Expand All @@ -271,10 +270,11 @@ public Response<BinaryData> downloadFileMultipleContentTypesWithResponse(
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentType, BinaryData file,
long contentLength, RequestContext requestContext) {
public Response<Void> uploadFileDefaultContentTypeWithResponse(BinaryData file, long contentLength,
RequestContext requestContext) {
return this.instrumentation.instrumentWithResponse("Type.File.Body.uploadFileDefaultContentType",
requestContext, updatedContext -> {
final String contentType = "*/*";
return service.uploadFileDefaultContentType(this.client.getEndpoint(), contentType, file, contentLength,
updatedContext);
});
Expand All @@ -283,18 +283,17 @@ public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentTyp
/**
* The downloadFileDefaultContentType operation.
*
* @param accept The accept parameter.
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the service returns an error.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(String accept,
RequestContext requestContext) {
public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(RequestContext requestContext) {
return this.instrumentation.instrumentWithResponse("Type.File.Body.downloadFileDefaultContentType",
requestContext, updatedContext -> {
final String accept = "*/*";
return service.downloadFileDefaultContentType(this.client.getEndpoint(), accept, updatedContext);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package type.file;

import io.clientcore.core.http.models.HttpHeaderName;
import io.clientcore.core.http.models.RequestContext;
import io.clientcore.core.models.binarydata.BinaryData;
import java.nio.file.Path;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -60,12 +62,13 @@ public void testDownloadFileMultipleContentTypes() {
@Test
public void testUploadFileDefaultContentType() {
BinaryData fileData = BinaryData.fromFile(PNG_FILE);
client.uploadFileDefaultContentType("image/png", fileData, fileData.getLength());
client.uploadFileDefaultContentTypeWithResponse(fileData, fileData.getLength(),
RequestContext.builder().setHeader(HttpHeaderName.CONTENT_TYPE, "image/png").build());
}

@Test
public void testDownloadFileDefaultContentType() {
BinaryData response = client.downloadFileDefaultContentType("image/png");
BinaryData response = client.downloadFileDefaultContentType();
Assertions.assertNotNull(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@typespec/sse": "0.81.0",
"@typespec/streams": "0.81.0",
"@azure-tools/typespec-azure-core": "0.67.0",
"@azure-tools/typespec-client-generator-core": "0.67.0",
"@azure-tools/typespec-client-generator-core": "0.67.1",
"@azure-tools/typespec-azure-resource-manager": "0.67.0",
"@azure-tools/typespec-autorest": "0.67.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ public Mono<Response<BinaryData>> downloadFileMultipleContentTypesWithResponse(S
* }
* </pre>
*
* @param contentType Body parameter's content type. Known values are *&#47;*.
* @param file The file parameter.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
Expand All @@ -208,9 +207,9 @@ public Mono<Response<BinaryData>> downloadFileMultipleContentTypesWithResponse(S
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> uploadFileDefaultContentTypeWithResponse(String contentType, BinaryData file,
public Mono<Response<Void>> uploadFileDefaultContentTypeWithResponse(BinaryData file,
RequestOptions requestOptions) {
return this.serviceClient.uploadFileDefaultContentTypeWithResponseAsync(contentType, file, requestOptions);
return this.serviceClient.uploadFileDefaultContentTypeWithResponseAsync(file, requestOptions);
}

/**
Expand All @@ -223,7 +222,6 @@ public Mono<Response<Void>> uploadFileDefaultContentTypeWithResponse(String cont
* }
* </pre>
*
* @param accept The accept parameter.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -233,9 +231,8 @@ public Mono<Response<Void>> uploadFileDefaultContentTypeWithResponse(String cont
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> downloadFileDefaultContentTypeWithResponse(String accept,
RequestOptions requestOptions) {
return this.serviceClient.downloadFileDefaultContentTypeWithResponseAsync(accept, requestOptions);
public Mono<Response<BinaryData>> downloadFileDefaultContentTypeWithResponse(RequestOptions requestOptions) {
return this.serviceClient.downloadFileDefaultContentTypeWithResponseAsync(requestOptions);
}

/**
Expand Down Expand Up @@ -338,7 +335,6 @@ public Mono<BinaryData> downloadFileMultipleContentTypes(DownloadFileMultipleCon
/**
* The uploadFileDefaultContentType operation.
*
* @param contentType Body parameter's content type. Known values are *&#47;*.
* @param file The file parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
Expand All @@ -350,17 +346,15 @@ public Mono<BinaryData> downloadFileMultipleContentTypes(DownloadFileMultipleCon
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> uploadFileDefaultContentType(String contentType, BinaryData file) {
public Mono<Void> uploadFileDefaultContentType(BinaryData file) {
// Generated convenience method for uploadFileDefaultContentTypeWithResponse
RequestOptions requestOptions = new RequestOptions();
return uploadFileDefaultContentTypeWithResponse(contentType, file, requestOptions).flatMap(FluxUtil::toMono);
return uploadFileDefaultContentTypeWithResponse(file, requestOptions).flatMap(FluxUtil::toMono);
}

/**
* The downloadFileDefaultContentType operation.
*
* @param accept The accept parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
Expand All @@ -370,9 +364,9 @@ public Mono<Void> uploadFileDefaultContentType(String contentType, BinaryData fi
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<BinaryData> downloadFileDefaultContentType(String accept) {
public Mono<BinaryData> downloadFileDefaultContentType() {
// Generated convenience method for downloadFileDefaultContentTypeWithResponse
RequestOptions requestOptions = new RequestOptions();
return downloadFileDefaultContentTypeWithResponse(accept, requestOptions).flatMap(FluxUtil::toMono);
return downloadFileDefaultContentTypeWithResponse(requestOptions).flatMap(FluxUtil::toMono);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ public Response<BinaryData> downloadFileMultipleContentTypesWithResponse(String
* }
* </pre>
*
* @param contentType Body parameter's content type. Known values are *&#47;*.
* @param file The file parameter.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
Expand All @@ -205,9 +204,8 @@ public Response<BinaryData> downloadFileMultipleContentTypesWithResponse(String
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentType, BinaryData file,
RequestOptions requestOptions) {
return this.serviceClient.uploadFileDefaultContentTypeWithResponse(contentType, file, requestOptions);
public Response<Void> uploadFileDefaultContentTypeWithResponse(BinaryData file, RequestOptions requestOptions) {
return this.serviceClient.uploadFileDefaultContentTypeWithResponse(file, requestOptions);
}

/**
Expand All @@ -220,7 +218,6 @@ public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentTyp
* }
* </pre>
*
* @param accept The accept parameter.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
Expand All @@ -230,9 +227,8 @@ public Response<Void> uploadFileDefaultContentTypeWithResponse(String contentTyp
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(String accept,
RequestOptions requestOptions) {
return this.serviceClient.downloadFileDefaultContentTypeWithResponse(accept, requestOptions);
public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(RequestOptions requestOptions) {
return this.serviceClient.downloadFileDefaultContentTypeWithResponse(requestOptions);
}

/**
Expand Down Expand Up @@ -332,7 +328,6 @@ public BinaryData downloadFileMultipleContentTypes(DownloadFileMultipleContentTy
/**
* The uploadFileDefaultContentType operation.
*
* @param contentType Body parameter's content type. Known values are *&#47;*.
* @param file The file parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
Expand All @@ -343,17 +338,15 @@ public BinaryData downloadFileMultipleContentTypes(DownloadFileMultipleContentTy
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public void uploadFileDefaultContentType(String contentType, BinaryData file) {
public void uploadFileDefaultContentType(BinaryData file) {
// Generated convenience method for uploadFileDefaultContentTypeWithResponse
RequestOptions requestOptions = new RequestOptions();
uploadFileDefaultContentTypeWithResponse(contentType, file, requestOptions).getValue();
uploadFileDefaultContentTypeWithResponse(file, requestOptions).getValue();
}

/**
* The downloadFileDefaultContentType operation.
*
* @param accept The accept parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
Expand All @@ -363,9 +356,9 @@ public void uploadFileDefaultContentType(String contentType, BinaryData file) {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public BinaryData downloadFileDefaultContentType(String accept) {
public BinaryData downloadFileDefaultContentType() {
// Generated convenience method for downloadFileDefaultContentTypeWithResponse
RequestOptions requestOptions = new RequestOptions();
return downloadFileDefaultContentTypeWithResponse(accept, requestOptions).getValue();
return downloadFileDefaultContentTypeWithResponse(requestOptions).getValue();
}
}
Loading
Loading