Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-client-java, pageable for unbranded #5551

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
5 changes: 0 additions & 5 deletions packages/http-client-java/emitter/src/code-model-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,6 @@ export class CodeModelBuilder {
responses: SdkHttpResponse[],
sdkMethod: SdkMethod<SdkHttpOperation>,
) {
if (!this.isBranded()) {
// TODO: currently unbranded does not support paged operation
return;
}

if (sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") {
for (const response of responses) {
const bodyType = response.type;
Expand Down
4 changes: 2 additions & 2 deletions packages/http-client-java/emitter/src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CodeModelBuilder } from "./code-model-builder.js";
import { CodeModel } from "./common/code-model.js";
import { logError, spawnAsync, SpawnError } from "./utils.js";
import {
CODE_RUNTIME_DEPENDENCY,
CODE_JAVA_SDK_DEPENDENCY,
JDK_NOT_FOUND_MESSAGE,
validateDependencies,
} from "./validate.js";
Expand Down Expand Up @@ -197,7 +197,7 @@ export async function $onEmit(context: EmitContext<EmitterOptions>) {
program.trace("http-client-java", `Code generation log: ${result.stdout}`);
} catch (error: any) {
if (error && "code" in error && error["code"] === "ENOENT") {
logError(program, JDK_NOT_FOUND_MESSAGE, CODE_RUNTIME_DEPENDENCY);
logError(program, JDK_NOT_FOUND_MESSAGE, CODE_JAVA_SDK_DEPENDENCY);
} else {
logError(
program,
Expand Down
8 changes: 4 additions & 4 deletions packages/http-client-java/emitter/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { logError, spawnAsync, trace } from "./utils.js";

export const JDK_NOT_FOUND_MESSAGE =
"Java Development Kit (JDK) is not found in PATH. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download";
export const CODE_RUNTIME_DEPENDENCY = "invalid-runtime-dependency";
export const CODE_JAVA_SDK_DEPENDENCY = "invalid-java-sdk-dependency";

export async function validateDependencies(
program: Program | undefined,
Expand All @@ -25,7 +25,7 @@ export async function validateDependencies(
// // eslint-disable-next-line no-console
// console.log("[ERROR] " + message);
if (program && logDiagnostic) {
logError(program, message, CODE_RUNTIME_DEPENDENCY);
logError(program, message, CODE_JAVA_SDK_DEPENDENCY);
}
}
}
Expand All @@ -37,7 +37,7 @@ export async function validateDependencies(
// // eslint-disable-next-line no-console
// console.log("[ERROR] " + message);
if (program && logDiagnostic) {
logError(program, message, CODE_RUNTIME_DEPENDENCY);
logError(program, message, CODE_JAVA_SDK_DEPENDENCY);
}
}

Expand All @@ -61,7 +61,7 @@ export async function validateDependencies(
// // eslint-disable-next-line no-console
// console.log("[ERROR] " + message);
if (program && logDiagnostic) {
logError(program, message, CODE_RUNTIME_DEPENDENCY);
logError(program, message, CODE_JAVA_SDK_DEPENDENCY);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@typespec/http-specs": "0.1.0-alpha.7",
"@typespec/http-client-java": "file:../../typespec-http-client-java-0.1.7.tgz",
"@typespec/http-client-java": "file:../../typespec-http-client-java-0.1.8.tgz",
"@typespec/http-client-java-tests": "file:"
},
"overrides": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>io.clientcore</groupId>
<artifactId>core</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.http.pipeline.KeyCredentialPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.KeyCredentialTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -244,7 +244,7 @@ private HttpPipeline createHttpPipeline() {
if (keyCredential != null) {
policies.add(new KeyCredentialPolicy("x-ms-api-key", keyCredential, null));
}
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.http.pipeline.KeyCredentialPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.KeyCredentialTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -244,7 +244,7 @@ private HttpPipeline createHttpPipeline() {
if (keyCredential != null) {
policies.add(new KeyCredentialPolicy("authorization", keyCredential, "SharedAccessKey"));
}
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.http.pipeline.KeyCredentialPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.KeyCredentialTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -244,7 +244,7 @@ private HttpPipeline createHttpPipeline() {
if (keyCredential != null) {
policies.add(new KeyCredentialPolicy("authorization", keyCredential, "Bearer"));
}
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.http.pipeline.KeyCredentialPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.KeyCredentialTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -243,7 +243,7 @@ private HttpPipeline createHttpPipeline() {
if (keyCredential != null) {
policies.add(new KeyCredentialPolicy("authorization", keyCredential, "Bearer"));
}
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -221,7 +221,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions));
policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions));
this.pipelinePolicies.stream().forEach(p -> policies.add(p));
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -221,7 +221,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions));
policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions));
this.pipelinePolicies.stream().forEach(p -> policies.add(p));
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -222,7 +222,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions));
policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions));
this.pipelinePolicies.stream().forEach(p -> policies.add(p));
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -222,7 +222,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions));
policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions));
this.pipelinePolicies.stream().forEach(p -> policies.add(p));
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -221,7 +221,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions));
policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions));
this.pipelinePolicies.stream().forEach(p -> policies.add(p));
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import io.clientcore.core.http.models.HttpRedirectOptions;
import io.clientcore.core.http.models.HttpRetryOptions;
import io.clientcore.core.http.models.ProxyOptions;
import io.clientcore.core.http.pipeline.HttpLoggingPolicy;
import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy;
import io.clientcore.core.http.pipeline.HttpPipeline;
import io.clientcore.core.http.pipeline.HttpPipelineBuilder;
import io.clientcore.core.http.pipeline.HttpPipelinePolicy;
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
import io.clientcore.core.instrumentation.logging.ClientLogger;
import io.clientcore.core.models.traits.ConfigurationTrait;
import io.clientcore.core.models.traits.EndpointTrait;
import io.clientcore.core.models.traits.HttpTrait;
import io.clientcore.core.models.traits.ProxyTrait;
import io.clientcore.core.util.ClientLogger;
import io.clientcore.core.util.configuration.Configuration;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -222,7 +222,7 @@ private HttpPipeline createHttpPipeline() {
policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions));
policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions));
this.pipelinePolicies.stream().forEach(p -> policies.add(p));
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
policies.add(new HttpInstrumentationPolicy(null, localHttpLogOptions));
httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));
return httpPipelineBuilder.build();
}
Expand Down
Loading
Loading