Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
change from quotaProjectID to quotaProjectId
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed Jun 18, 2020
1 parent c641572 commit cea6118
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 79 deletions.
8 changes: 4 additions & 4 deletions gax/src/main/java/com/google/api/gax/rpc/ClientContext.java
Expand Up @@ -97,7 +97,7 @@ public abstract class ClientContext {
public abstract String getEndpoint();

@Nullable
public abstract String getQuotaProjectID();
public abstract String getQuotaProjectId();

/** Gets the {@link ApiTracerFactory} that will be used to generate traces for operations. */
@BetaApi("The surface for tracing is not stable yet and may change in the future.")
Expand All @@ -114,7 +114,7 @@ public static Builder newBuilder() {
.setStreamWatchdog(null)
.setStreamWatchdogCheckInterval(Duration.ZERO)
.setTracerFactory(NoopApiTracerFactory.getInstance())
.setQuotaProjectID(null);
.setQuotaProjectId(null);
}

public abstract Builder toBuilder();
Expand Down Expand Up @@ -204,7 +204,7 @@ public static ClientContext create(StubSettings settings) throws IOException {
.setClock(clock)
.setDefaultCallContext(defaultCallContext)
.setEndpoint(settings.getEndpoint())
.setQuotaProjectID(settings.getQuotaProjectID())
.setQuotaProjectId(settings.getQuotaProjectId())
.setStreamWatchdog(watchdog)
.setStreamWatchdogCheckInterval(settings.getStreamWatchdogCheckInterval())
.setTracerFactory(settings.getTracerFactory())
Expand Down Expand Up @@ -234,7 +234,7 @@ public abstract static class Builder {

public abstract Builder setEndpoint(String endpoint);

public abstract Builder setQuotaProjectID(String quotaProjectID);
public abstract Builder setQuotaProjectId(String QuotaProjectId);

@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public abstract Builder setStreamWatchdog(Watchdog watchdog);
Expand Down
18 changes: 9 additions & 9 deletions gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java
Expand Up @@ -93,8 +93,8 @@ public final String getEndpoint() {
return stubSettings.getEndpoint();
}

public final String getQuotaProjectID() {
return stubSettings.getQuotaProjectID();
public final String getQuotaProjectId() {
return stubSettings.getQuotaProjectId();
}

@BetaApi("The surface for streaming is not stable yet and may change in the future.")
Expand All @@ -118,7 +118,7 @@ public String toString() {
.add("internalHeaderProvider", getInternalHeaderProvider())
.add("clock", getClock())
.add("endpoint", getEndpoint())
.add("quotaProjectID", getQuotaProjectID())
.add("quotaProjectId", getQuotaProjectId())
.add("watchdogProvider", getWatchdogProvider())
.add("watchdogCheckInterval", getWatchdogCheckInterval())
.toString();
Expand Down Expand Up @@ -221,8 +221,8 @@ public B setEndpoint(String endpoint) {
return self();
}

public B setQuotaProjectID(String quotaProjectID) {
stubSettings.setQuotaProjectID(quotaProjectID);
public B setQuotaProjectId(String quotaProjectId) {
stubSettings.setQuotaProjectId(quotaProjectId);
return self();
}

Expand Down Expand Up @@ -274,9 +274,9 @@ public String getEndpoint() {
return stubSettings.getEndpoint();
}

/** Gets the QuotaProjectID that was previously set on this Builder. */
public String getQuotaProjectID() {
return stubSettings.getQuotaProjectID();
/** Gets the QuotaProjectId that was previously set on this Builder. */
public String getQuotaProjectId() {
return stubSettings.getQuotaProjectId();
}

@BetaApi("The surface for streaming is not stable yet and may change in the future.")
Expand Down Expand Up @@ -309,7 +309,7 @@ public String toString() {
.add("internalHeaderProvider", getInternalHeaderProvider())
.add("clock", getClock())
.add("endpoint", getEndpoint())
.add("quotaProjectID", getQuotaProjectID())
.add("quotaProjectId", getQuotaProjectId())
.add("watchdogProvider", getWatchdogProvider())
.add("watchdogCheckInterval", getWatchdogCheckInterval())
.toString();
Expand Down
48 changes: 24 additions & 24 deletions gax/src/main/java/com/google/api/gax/rpc/StubSettings.java
Expand Up @@ -71,7 +71,7 @@ public abstract class StubSettings<SettingsT extends StubSettings<SettingsT>> {
private final TransportChannelProvider transportChannelProvider;
private final ApiClock clock;
private final String endpoint;
private final String quotaProjectID;
private final String quotaProjectId;
@Nullable private final WatchdogProvider streamWatchdogProvider;
@Nonnull private final Duration streamWatchdogCheckInterval;
@Nonnull private final ApiTracerFactory tracerFactory;
Expand All @@ -85,7 +85,7 @@ protected StubSettings(Builder builder) {
this.internalHeaderProvider = builder.internalHeaderProvider;
this.clock = builder.clock;
this.endpoint = builder.endpoint;
this.quotaProjectID = builder.quotaProjectID;
this.quotaProjectId = builder.quotaProjectId;
this.streamWatchdogProvider = builder.streamWatchdogProvider;
this.streamWatchdogCheckInterval = builder.streamWatchdogCheckInterval;
this.tracerFactory = builder.tracerFactory;
Expand Down Expand Up @@ -121,8 +121,8 @@ public final String getEndpoint() {
return endpoint;
}

public final String getQuotaProjectID() {
return quotaProjectID;
public final String getQuotaProjectId() {
return quotaProjectId;
}

@BetaApi("The surface for streaming is not stable yet and may change in the future.")
Expand Down Expand Up @@ -156,7 +156,7 @@ public String toString() {
.add("internalHeaderProvider", internalHeaderProvider)
.add("clock", clock)
.add("endpoint", endpoint)
.add("quotaProjectID", quotaProjectID)
.add("quotaProjectId", quotaProjectId)
.add("streamWatchdogProvider", streamWatchdogProvider)
.add("streamWatchdogCheckInterval", streamWatchdogCheckInterval)
.add("tracerFactory", tracerFactory)
Expand All @@ -175,7 +175,7 @@ public abstract static class Builder<
private TransportChannelProvider transportChannelProvider;
private ApiClock clock;
private String endpoint;
private String quotaProjectID;
private String quotaProjectId;
@Nullable private WatchdogProvider streamWatchdogProvider;
@Nonnull private Duration streamWatchdogCheckInterval;
@Nonnull private ApiTracerFactory tracerFactory;
Expand All @@ -189,16 +189,16 @@ protected Builder(StubSettings settings) {
this.internalHeaderProvider = settings.internalHeaderProvider;
this.clock = settings.clock;
this.endpoint = settings.endpoint;
this.quotaProjectID = settings.quotaProjectID;
this.quotaProjectId = settings.quotaProjectId;
this.streamWatchdogProvider = settings.streamWatchdogProvider;
this.streamWatchdogCheckInterval = settings.streamWatchdogCheckInterval;
this.tracerFactory = settings.tracerFactory;
}

/** Get Quota Project ID from Client Context * */
private static String getQuotaProjectIDFromClientContext(ClientContext clientContext) {
if (clientContext.getQuotaProjectID() != null) {
return clientContext.getQuotaProjectID();
private static String getQuotaProjectIdFromClientContext(ClientContext clientContext) {
if (clientContext.getQuotaProjectId() != null) {
return clientContext.getQuotaProjectId();
}
if (clientContext.getCredentials() instanceof QuotaProjectIdProvider) {
return ((QuotaProjectIdProvider) clientContext.getCredentials()).getQuotaProjectId();
Expand All @@ -221,7 +221,7 @@ protected Builder(ClientContext clientContext) {
this.internalHeaderProvider = new NoHeaderProvider();
this.clock = NanoClock.getDefaultClock();
this.endpoint = null;
this.quotaProjectID = null;
this.quotaProjectId = null;
this.streamWatchdogProvider = InstantiatingWatchdogProvider.create();
this.streamWatchdogCheckInterval = Duration.ofSeconds(10);
this.tracerFactory = NoopApiTracerFactory.getInstance();
Expand All @@ -239,7 +239,7 @@ protected Builder(ClientContext clientContext) {
FixedWatchdogProvider.create(clientContext.getStreamWatchdog());
this.streamWatchdogCheckInterval = clientContext.getStreamWatchdogCheckInterval();
this.tracerFactory = clientContext.getTracerFactory();
this.quotaProjectID = getQuotaProjectIDFromClientContext(clientContext);
this.quotaProjectId = getQuotaProjectIdFromClientContext(clientContext);
}
}

Expand Down Expand Up @@ -268,8 +268,8 @@ public B setCredentialsProvider(CredentialsProvider credentialsProvider) {
this.credentialsProvider = Preconditions.checkNotNull(credentialsProvider);
try {
Credentials credentials = credentialsProvider.getCredentials();
if (this.quotaProjectID == null && credentials instanceof QuotaProjectIdProvider) {
this.quotaProjectID = ((QuotaProjectIdProvider) credentials).getQuotaProjectId();
if (this.quotaProjectId == null && credentials instanceof QuotaProjectIdProvider) {
this.quotaProjectId = ((QuotaProjectIdProvider) credentials).getQuotaProjectId();
}
} catch (IOException e) {
System.out.println("fail to fetch credentials");
Expand All @@ -287,9 +287,9 @@ public B setCredentialsProvider(CredentialsProvider credentialsProvider) {
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public B setHeaderProvider(HeaderProvider headerProvider) {
this.headerProvider = headerProvider;
if (this.quotaProjectID == null
if (this.quotaProjectId == null
&& headerProvider.getHeaders().containsKey(QUOTA_PROJECT_ID_HEADER_KEY)) {
this.quotaProjectID = headerProvider.getHeaders().get(QUOTA_PROJECT_ID_HEADER_KEY);
this.quotaProjectId = headerProvider.getHeaders().get(QUOTA_PROJECT_ID_HEADER_KEY);
}
return self();
}
Expand All @@ -304,9 +304,9 @@ public B setHeaderProvider(HeaderProvider headerProvider) {
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
protected B setInternalHeaderProvider(HeaderProvider internalHeaderProvider) {
this.internalHeaderProvider = internalHeaderProvider;
if (this.quotaProjectID == null
if (this.quotaProjectId == null
&& internalHeaderProvider.getHeaders().containsKey(QUOTA_PROJECT_ID_HEADER_KEY)) {
this.quotaProjectID = internalHeaderProvider.getHeaders().get(QUOTA_PROJECT_ID_HEADER_KEY);
this.quotaProjectId = internalHeaderProvider.getHeaders().get(QUOTA_PROJECT_ID_HEADER_KEY);
}
return self();
}
Expand Down Expand Up @@ -346,8 +346,8 @@ public B setEndpoint(String endpoint) {
return self();
}

public B setQuotaProjectID(String quotaProjectID) {
this.quotaProjectID = quotaProjectID;
public B setQuotaProjectId(String quotaProjectId) {
this.quotaProjectId = quotaProjectId;
return self();
}

Expand Down Expand Up @@ -417,9 +417,9 @@ public String getEndpoint() {
return endpoint;
}

/** Gets the QuotaProjectID that was previously set on this Builder. */
public String getQuotaProjectID() {
return quotaProjectID;
/** Gets the QuotaProjectId that was previously set on this Builder. */
public String getQuotaProjectId() {
return quotaProjectId;
}

@BetaApi("The surface for streaming is not stable yet and may change in the future.")
Expand Down Expand Up @@ -454,7 +454,7 @@ public String toString() {
.add("internalHeaderProvider", internalHeaderProvider)
.add("clock", clock)
.add("endpoint", endpoint)
.add("quotaProjectID", quotaProjectID)
.add("quotaProjectId", quotaProjectId)
.add("streamWatchdogProvider", streamWatchdogProvider)
.add("streamWatchdogCheckInterval", streamWatchdogCheckInterval)
.add("tracerFactory", tracerFactory)
Expand Down

0 comments on commit cea6118

Please sign in to comment.