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 Node dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-java"
---

access=public should override Paged
8 changes: 8 additions & 0 deletions packages/http-client-java/emitter/src/code-model-builder.ts
Comment thread
weidongxu-microsoft marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,14 @@ export class CodeModelBuilder {
this.trackSchemaUsage(schema, {
usage: [SchemaContext.Public],
});
if (schema instanceof ObjectSchema && schema.usage) {
const schemaUsage: SchemaContext[] | undefined = schema.usage;
// And, remove the Paged, as we assume customer explicitly asks Public
const index = schemaUsage.indexOf(SchemaContext.Paged);
if (index >= 0) {
schemaUsage.splice(index, 1);
}
}
} else if (access === "internal") {
const schema = this.processSchema(model, model.name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@typespec/spector": "0.1.0-alpha.24",
"@typespec/spec-api": "0.1.0-alpha.13",
"@typespec/http-specs": "0.1.0-alpha.34",
"@typespec/http-specs": "0.1.0-alpha.35",
"@typespec/json-schema": "1.10.0",
"@typespec/http-client-java": "file:../../typespec-http-client-java-0.7.0.tgz",
"@typespec/http-client-java-tests": "file:"
Expand All @@ -29,10 +29,10 @@
"@typespec/events": "0.80.0",
"@typespec/sse": "0.80.0",
"@typespec/streams": "0.80.0",
"@azure-tools/typespec-azure-core": "0.66.0",
"@azure-tools/typespec-client-generator-core": "0.66.2",
"@azure-tools/typespec-azure-core": "0.66.1",
"@azure-tools/typespec-client-generator-core": "0.66.4",
"@azure-tools/typespec-azure-resource-manager": "0.66.0",
"@azure-tools/typespec-autorest": "0.66.0"
"@azure-tools/typespec-autorest": "0.66.1"
},
"private": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
@ServiceClientBuilder(
serviceClients = {
ServerDrivenPaginationClient.class,
ServerDrivenPaginationAlternateInitialVerbClient.class,
ServerDrivenPaginationContinuationTokenClient.class,
PageSizeClient.class,
XmlPaginationClient.class })
Expand Down Expand Up @@ -239,6 +240,18 @@ public ServerDrivenPaginationClient buildServerDrivenPaginationClient() {
innerClient.getInstrumentation());
}

/**
* Builds an instance of ServerDrivenPaginationAlternateInitialVerbClient class.
*
* @return an instance of ServerDrivenPaginationAlternateInitialVerbClient.
*/
@Metadata(properties = { MetadataProperties.GENERATED })
public ServerDrivenPaginationAlternateInitialVerbClient buildServerDrivenPaginationAlternateInitialVerbClient() {
PageableClientImpl innerClient = buildInnerClient();
return new ServerDrivenPaginationAlternateInitialVerbClient(
innerClient.getServerDrivenPaginationAlternateInitialVerbs(), innerClient.getInstrumentation());
}

/**
* Builds an instance of ServerDrivenPaginationContinuationTokenClient class.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package payload.pageable;

import io.clientcore.core.annotations.Metadata;
import io.clientcore.core.annotations.MetadataProperties;
import io.clientcore.core.annotations.ReturnType;
import io.clientcore.core.annotations.ServiceClient;
import io.clientcore.core.annotations.ServiceMethod;
import io.clientcore.core.http.models.HttpResponseException;
import io.clientcore.core.http.models.RequestContext;
import io.clientcore.core.http.paging.PagedIterable;
import io.clientcore.core.instrumentation.Instrumentation;
import payload.pageable.implementation.ServerDrivenPaginationAlternateInitialVerbsImpl;
import payload.pageable.serverdrivenpagination.alternateinitialverb.Filter;

/**
* Initializes a new instance of the synchronous PageableClient type.
*/
@ServiceClient(builder = PageableClientBuilder.class)
public final class ServerDrivenPaginationAlternateInitialVerbClient {
@Metadata(properties = { MetadataProperties.GENERATED })
private final ServerDrivenPaginationAlternateInitialVerbsImpl serviceClient;

private final Instrumentation instrumentation;

/**
* Initializes an instance of ServerDrivenPaginationAlternateInitialVerbClient class.
*
* @param serviceClient the service client implementation.
* @param instrumentation the instrumentation instance.
*/
@Metadata(properties = { MetadataProperties.GENERATED })
ServerDrivenPaginationAlternateInitialVerbClient(ServerDrivenPaginationAlternateInitialVerbsImpl serviceClient,
Instrumentation instrumentation) {
this.serviceClient = serviceClient;
this.instrumentation = instrumentation;
}

/**
* The post operation.
*
* @param body The body 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 paginated response with {@link PagedIterable}.
*/
@Metadata(properties = { MetadataProperties.GENERATED })
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<Pet> post(Filter body) {
return post(body, RequestContext.none());
}

/**
* The post operation.
*
* @param body The body 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 paginated response with {@link PagedIterable}.
*/
@Metadata(properties = { MetadataProperties.GENERATED })
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<Pet> post(Filter body, RequestContext requestContext) {
return this.serviceClient.post(body, requestContext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ public ServerDrivenPaginationsImpl getServerDrivenPaginations() {
return this.serverDrivenPaginations;
}

/**
* The ServerDrivenPaginationAlternateInitialVerbsImpl object to access its operations.
*/
private final ServerDrivenPaginationAlternateInitialVerbsImpl serverDrivenPaginationAlternateInitialVerbs;

/**
* Gets the ServerDrivenPaginationAlternateInitialVerbsImpl object to access its operations.
*
* @return the ServerDrivenPaginationAlternateInitialVerbsImpl object.
*/
public ServerDrivenPaginationAlternateInitialVerbsImpl getServerDrivenPaginationAlternateInitialVerbs() {
return this.serverDrivenPaginationAlternateInitialVerbs;
}

/**
* The ServerDrivenPaginationContinuationTokensImpl object to access its operations.
*/
Expand Down Expand Up @@ -117,6 +131,7 @@ public PageableClientImpl(HttpPipeline httpPipeline, Instrumentation instrumenta
this.instrumentation = instrumentation;
this.endpoint = endpoint;
this.serverDrivenPaginations = new ServerDrivenPaginationsImpl(this);
this.serverDrivenPaginationAlternateInitialVerbs = new ServerDrivenPaginationAlternateInitialVerbsImpl(this);
this.serverDrivenPaginationContinuationTokens = new ServerDrivenPaginationContinuationTokensImpl(this);
this.pageSizes = new PageSizesImpl(this);
this.xmlPaginations = new XmlPaginationsImpl(this);
Expand Down
Loading
Loading