com.google.api.serviceusage.v1beta1.stub.HttpJsonServiceUsageStub Maven / Gradle / Ivy
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.api.serviceusage.v1beta1.stub;
import static com.google.api.serviceusage.v1beta1.ServiceUsageClient.ListAdminOverridesPagedResponse;
import static com.google.api.serviceusage.v1beta1.ServiceUsageClient.ListConsumerOverridesPagedResponse;
import static com.google.api.serviceusage.v1beta1.ServiceUsageClient.ListConsumerQuotaMetricsPagedResponse;
import static com.google.api.serviceusage.v1beta1.ServiceUsageClient.ListServicesPagedResponse;
import com.google.api.HttpRule;
import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.httpjson.ApiMethodDescriptor;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
import com.google.api.gax.httpjson.ProtoMessageResponseParser;
import com.google.api.gax.httpjson.ProtoRestSerializer;
import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.api.serviceusage.v1beta1.BatchEnableServicesRequest;
import com.google.api.serviceusage.v1beta1.ConsumerQuotaLimit;
import com.google.api.serviceusage.v1beta1.ConsumerQuotaMetric;
import com.google.api.serviceusage.v1beta1.CreateAdminOverrideRequest;
import com.google.api.serviceusage.v1beta1.CreateConsumerOverrideRequest;
import com.google.api.serviceusage.v1beta1.DeleteAdminOverrideRequest;
import com.google.api.serviceusage.v1beta1.DeleteConsumerOverrideRequest;
import com.google.api.serviceusage.v1beta1.DisableServiceRequest;
import com.google.api.serviceusage.v1beta1.EnableServiceRequest;
import com.google.api.serviceusage.v1beta1.GenerateServiceIdentityRequest;
import com.google.api.serviceusage.v1beta1.GetConsumerQuotaLimitRequest;
import com.google.api.serviceusage.v1beta1.GetConsumerQuotaMetricRequest;
import com.google.api.serviceusage.v1beta1.GetServiceRequest;
import com.google.api.serviceusage.v1beta1.ImportAdminOverridesMetadata;
import com.google.api.serviceusage.v1beta1.ImportAdminOverridesRequest;
import com.google.api.serviceusage.v1beta1.ImportAdminOverridesResponse;
import com.google.api.serviceusage.v1beta1.ImportConsumerOverridesMetadata;
import com.google.api.serviceusage.v1beta1.ImportConsumerOverridesRequest;
import com.google.api.serviceusage.v1beta1.ImportConsumerOverridesResponse;
import com.google.api.serviceusage.v1beta1.ListAdminOverridesRequest;
import com.google.api.serviceusage.v1beta1.ListAdminOverridesResponse;
import com.google.api.serviceusage.v1beta1.ListConsumerOverridesRequest;
import com.google.api.serviceusage.v1beta1.ListConsumerOverridesResponse;
import com.google.api.serviceusage.v1beta1.ListConsumerQuotaMetricsRequest;
import com.google.api.serviceusage.v1beta1.ListConsumerQuotaMetricsResponse;
import com.google.api.serviceusage.v1beta1.ListServicesRequest;
import com.google.api.serviceusage.v1beta1.ListServicesResponse;
import com.google.api.serviceusage.v1beta1.OperationMetadata;
import com.google.api.serviceusage.v1beta1.QuotaOverride;
import com.google.api.serviceusage.v1beta1.Service;
import com.google.api.serviceusage.v1beta1.ServiceIdentity;
import com.google.api.serviceusage.v1beta1.UpdateAdminOverrideRequest;
import com.google.api.serviceusage.v1beta1.UpdateConsumerOverrideRequest;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* REST stub implementation for the ServiceUsage service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@BetaApi
@Generated("by gapic-generator-java")
public class HttpJsonServiceUsageStub extends ServiceUsageStub {
private static final TypeRegistry typeRegistry =
TypeRegistry.newBuilder()
.add(Empty.getDescriptor())
.add(ServiceIdentity.getDescriptor())
.add(ImportConsumerOverridesResponse.getDescriptor())
.add(ImportAdminOverridesResponse.getDescriptor())
.add(QuotaOverride.getDescriptor())
.add(ImportAdminOverridesMetadata.getDescriptor())
.add(OperationMetadata.getDescriptor())
.add(ImportConsumerOverridesMetadata.getDescriptor())
.build();
private static final ApiMethodDescriptor
enableServiceMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/EnableService")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*}:enable",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearName().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(EnableServiceRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
disableServiceMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/DisableService")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*}:disable",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearName().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DisableServiceRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor getServiceMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/GetService")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Service.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
listServicesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/ListServices")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*}/services",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "filter", request.getFilter());
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListServicesResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
batchEnableServicesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/BatchEnableServices")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*}/services:batchEnable",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(BatchEnableServicesRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor<
ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsResponse>
listConsumerQuotaMetricsMethodDescriptor =
ApiMethodDescriptor
.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/ListConsumerQuotaMetrics")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*}/consumerQuotaMetrics",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "view", request.getViewValue());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListConsumerQuotaMetricsResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
getConsumerQuotaMetricMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/GetConsumerQuotaMetric")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "view", request.getViewValue());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ConsumerQuotaMetric.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
getConsumerQuotaLimitMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/GetConsumerQuotaLimit")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "view", request.getViewValue());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ConsumerQuotaLimit.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
createAdminOverrideMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/CreateAdminOverride")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/adminOverrides",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(
fields, "forceOnly", request.getForceOnlyList());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("override", request.getOverride(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreateAdminOverrideRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
updateAdminOverrideMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/UpdateAdminOverride")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/adminOverrides/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(
fields, "forceOnly", request.getForceOnlyList());
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("override", request.getOverride(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(UpdateAdminOverrideRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
deleteAdminOverrideMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/DeleteAdminOverride")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/adminOverrides/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(
fields, "forceOnly", request.getForceOnlyList());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeleteAdminOverrideRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
listAdminOverridesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.api.serviceusage.v1beta1.ServiceUsage/ListAdminOverrides")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/adminOverrides",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListAdminOverridesResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
importAdminOverridesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/ImportAdminOverrides")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*}/consumerQuotaMetrics:importAdminOverrides",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(ImportAdminOverridesRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
createConsumerOverrideMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/CreateConsumerOverride")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/consumerOverrides",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(
fields, "forceOnly", request.getForceOnlyList());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("override", request.getOverride(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreateConsumerOverrideRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
updateConsumerOverrideMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/UpdateConsumerOverride")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/consumerOverrides/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(
fields, "forceOnly", request.getForceOnlyList());
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("override", request.getOverride(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(UpdateConsumerOverrideRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
deleteConsumerOverrideMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/DeleteConsumerOverride")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/consumerOverrides/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(
fields, "forceOnly", request.getForceOnlyList());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeleteConsumerOverrideRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor<
ListConsumerOverridesRequest, ListConsumerOverridesResponse>
listConsumerOverridesMethodDescriptor =
ApiMethodDescriptor
.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/ListConsumerOverrides")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/consumerOverrides",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListConsumerOverridesResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
importConsumerOverridesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/ImportConsumerOverrides")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*}/consumerQuotaMetrics:importConsumerOverrides",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(ImportConsumerOverridesRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
generateServiceIdentityMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.api.serviceusage.v1beta1.ServiceUsage/GenerateServiceIdentity")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1beta1/{parent=*/*/services/*}:generateServiceIdentity",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(GenerateServiceIdentityRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private final UnaryCallable enableServiceCallable;
private final OperationCallable
enableServiceOperationCallable;
private final UnaryCallable disableServiceCallable;
private final OperationCallable
disableServiceOperationCallable;
private final UnaryCallable getServiceCallable;
private final UnaryCallable listServicesCallable;
private final UnaryCallable
listServicesPagedCallable;
private final UnaryCallable batchEnableServicesCallable;
private final OperationCallable
batchEnableServicesOperationCallable;
private final UnaryCallable
listConsumerQuotaMetricsCallable;
private final UnaryCallable<
ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsPagedResponse>
listConsumerQuotaMetricsPagedCallable;
private final UnaryCallable
getConsumerQuotaMetricCallable;
private final UnaryCallable
getConsumerQuotaLimitCallable;
private final UnaryCallable createAdminOverrideCallable;
private final OperationCallable
createAdminOverrideOperationCallable;
private final UnaryCallable updateAdminOverrideCallable;
private final OperationCallable
updateAdminOverrideOperationCallable;
private final UnaryCallable deleteAdminOverrideCallable;
private final OperationCallable
deleteAdminOverrideOperationCallable;
private final UnaryCallable
listAdminOverridesCallable;
private final UnaryCallable
listAdminOverridesPagedCallable;
private final UnaryCallable importAdminOverridesCallable;
private final OperationCallable<
ImportAdminOverridesRequest, ImportAdminOverridesResponse, ImportAdminOverridesMetadata>
importAdminOverridesOperationCallable;
private final UnaryCallable
createConsumerOverrideCallable;
private final OperationCallable
createConsumerOverrideOperationCallable;
private final UnaryCallable
updateConsumerOverrideCallable;
private final OperationCallable
updateConsumerOverrideOperationCallable;
private final UnaryCallable
deleteConsumerOverrideCallable;
private final OperationCallable
deleteConsumerOverrideOperationCallable;
private final UnaryCallable
listConsumerOverridesCallable;
private final UnaryCallable
listConsumerOverridesPagedCallable;
private final UnaryCallable
importConsumerOverridesCallable;
private final OperationCallable<
ImportConsumerOverridesRequest,
ImportConsumerOverridesResponse,
ImportConsumerOverridesMetadata>
importConsumerOverridesOperationCallable;
private final UnaryCallable
generateServiceIdentityCallable;
private final OperationCallable
generateServiceIdentityOperationCallable;
private final BackgroundResource backgroundResources;
private final HttpJsonOperationsStub httpJsonOperationsStub;
private final HttpJsonStubCallableFactory callableFactory;
public static final HttpJsonServiceUsageStub create(ServiceUsageStubSettings settings)
throws IOException {
return new HttpJsonServiceUsageStub(settings, ClientContext.create(settings));
}
public static final HttpJsonServiceUsageStub create(ClientContext clientContext)
throws IOException {
return new HttpJsonServiceUsageStub(
ServiceUsageStubSettings.newHttpJsonBuilder().build(), clientContext);
}
public static final HttpJsonServiceUsageStub create(
ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
return new HttpJsonServiceUsageStub(
ServiceUsageStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of HttpJsonServiceUsageStub, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected HttpJsonServiceUsageStub(ServiceUsageStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new HttpJsonServiceUsageCallableFactory());
}
/**
* Constructs an instance of HttpJsonServiceUsageStub, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected HttpJsonServiceUsageStub(
ServiceUsageStubSettings settings,
ClientContext clientContext,
HttpJsonStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.httpJsonOperationsStub =
HttpJsonOperationsStub.create(
clientContext,
callableFactory,
typeRegistry,
ImmutableMap.builder()
.put(
"google.longrunning.Operations.GetOperation",
HttpRule.newBuilder().setGet("/v1beta1/{name=operations/*}").build())
.put(
"google.longrunning.Operations.ListOperations",
HttpRule.newBuilder().setGet("/v1beta1/operations").build())
.build());
HttpJsonCallSettings enableServiceTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(enableServiceMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings disableServiceTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(disableServiceMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings getServiceTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getServiceMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings listServicesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(listServicesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
batchEnableServicesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(batchEnableServicesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
listConsumerQuotaMetricsTransportSettings =
HttpJsonCallSettings
.newBuilder()
.setMethodDescriptor(listConsumerQuotaMetricsMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
getConsumerQuotaMetricTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getConsumerQuotaMetricMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
getConsumerQuotaLimitTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getConsumerQuotaLimitMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
createAdminOverrideTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createAdminOverrideMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
updateAdminOverrideTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updateAdminOverrideMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
deleteAdminOverrideTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteAdminOverrideMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
listAdminOverridesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(listAdminOverridesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
importAdminOverridesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(importAdminOverridesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
createConsumerOverrideTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createConsumerOverrideMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
updateConsumerOverrideTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updateConsumerOverrideMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
deleteConsumerOverrideTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteConsumerOverrideMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
listConsumerOverridesTransportSettings =
HttpJsonCallSettings
.newBuilder()
.setMethodDescriptor(listConsumerOverridesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
importConsumerOverridesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(importConsumerOverridesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
generateServiceIdentityTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(generateServiceIdentityMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
this.enableServiceCallable =
callableFactory.createUnaryCallable(
enableServiceTransportSettings, settings.enableServiceSettings(), clientContext);
this.enableServiceOperationCallable =
callableFactory.createOperationCallable(
enableServiceTransportSettings,
settings.enableServiceOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.disableServiceCallable =
callableFactory.createUnaryCallable(
disableServiceTransportSettings, settings.disableServiceSettings(), clientContext);
this.disableServiceOperationCallable =
callableFactory.createOperationCallable(
disableServiceTransportSettings,
settings.disableServiceOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.getServiceCallable =
callableFactory.createUnaryCallable(
getServiceTransportSettings, settings.getServiceSettings(), clientContext);
this.listServicesCallable =
callableFactory.createUnaryCallable(
listServicesTransportSettings, settings.listServicesSettings(), clientContext);
this.listServicesPagedCallable =
callableFactory.createPagedCallable(
listServicesTransportSettings, settings.listServicesSettings(), clientContext);
this.batchEnableServicesCallable =
callableFactory.createUnaryCallable(
batchEnableServicesTransportSettings,
settings.batchEnableServicesSettings(),
clientContext);
this.batchEnableServicesOperationCallable =
callableFactory.createOperationCallable(
batchEnableServicesTransportSettings,
settings.batchEnableServicesOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.listConsumerQuotaMetricsCallable =
callableFactory.createUnaryCallable(
listConsumerQuotaMetricsTransportSettings,
settings.listConsumerQuotaMetricsSettings(),
clientContext);
this.listConsumerQuotaMetricsPagedCallable =
callableFactory.createPagedCallable(
listConsumerQuotaMetricsTransportSettings,
settings.listConsumerQuotaMetricsSettings(),
clientContext);
this.getConsumerQuotaMetricCallable =
callableFactory.createUnaryCallable(
getConsumerQuotaMetricTransportSettings,
settings.getConsumerQuotaMetricSettings(),
clientContext);
this.getConsumerQuotaLimitCallable =
callableFactory.createUnaryCallable(
getConsumerQuotaLimitTransportSettings,
settings.getConsumerQuotaLimitSettings(),
clientContext);
this.createAdminOverrideCallable =
callableFactory.createUnaryCallable(
createAdminOverrideTransportSettings,
settings.createAdminOverrideSettings(),
clientContext);
this.createAdminOverrideOperationCallable =
callableFactory.createOperationCallable(
createAdminOverrideTransportSettings,
settings.createAdminOverrideOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.updateAdminOverrideCallable =
callableFactory.createUnaryCallable(
updateAdminOverrideTransportSettings,
settings.updateAdminOverrideSettings(),
clientContext);
this.updateAdminOverrideOperationCallable =
callableFactory.createOperationCallable(
updateAdminOverrideTransportSettings,
settings.updateAdminOverrideOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.deleteAdminOverrideCallable =
callableFactory.createUnaryCallable(
deleteAdminOverrideTransportSettings,
settings.deleteAdminOverrideSettings(),
clientContext);
this.deleteAdminOverrideOperationCallable =
callableFactory.createOperationCallable(
deleteAdminOverrideTransportSettings,
settings.deleteAdminOverrideOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.listAdminOverridesCallable =
callableFactory.createUnaryCallable(
listAdminOverridesTransportSettings,
settings.listAdminOverridesSettings(),
clientContext);
this.listAdminOverridesPagedCallable =
callableFactory.createPagedCallable(
listAdminOverridesTransportSettings,
settings.listAdminOverridesSettings(),
clientContext);
this.importAdminOverridesCallable =
callableFactory.createUnaryCallable(
importAdminOverridesTransportSettings,
settings.importAdminOverridesSettings(),
clientContext);
this.importAdminOverridesOperationCallable =
callableFactory.createOperationCallable(
importAdminOverridesTransportSettings,
settings.importAdminOverridesOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.createConsumerOverrideCallable =
callableFactory.createUnaryCallable(
createConsumerOverrideTransportSettings,
settings.createConsumerOverrideSettings(),
clientContext);
this.createConsumerOverrideOperationCallable =
callableFactory.createOperationCallable(
createConsumerOverrideTransportSettings,
settings.createConsumerOverrideOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.updateConsumerOverrideCallable =
callableFactory.createUnaryCallable(
updateConsumerOverrideTransportSettings,
settings.updateConsumerOverrideSettings(),
clientContext);
this.updateConsumerOverrideOperationCallable =
callableFactory.createOperationCallable(
updateConsumerOverrideTransportSettings,
settings.updateConsumerOverrideOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.deleteConsumerOverrideCallable =
callableFactory.createUnaryCallable(
deleteConsumerOverrideTransportSettings,
settings.deleteConsumerOverrideSettings(),
clientContext);
this.deleteConsumerOverrideOperationCallable =
callableFactory.createOperationCallable(
deleteConsumerOverrideTransportSettings,
settings.deleteConsumerOverrideOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.listConsumerOverridesCallable =
callableFactory.createUnaryCallable(
listConsumerOverridesTransportSettings,
settings.listConsumerOverridesSettings(),
clientContext);
this.listConsumerOverridesPagedCallable =
callableFactory.createPagedCallable(
listConsumerOverridesTransportSettings,
settings.listConsumerOverridesSettings(),
clientContext);
this.importConsumerOverridesCallable =
callableFactory.createUnaryCallable(
importConsumerOverridesTransportSettings,
settings.importConsumerOverridesSettings(),
clientContext);
this.importConsumerOverridesOperationCallable =
callableFactory.createOperationCallable(
importConsumerOverridesTransportSettings,
settings.importConsumerOverridesOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.generateServiceIdentityCallable =
callableFactory.createUnaryCallable(
generateServiceIdentityTransportSettings,
settings.generateServiceIdentitySettings(),
clientContext);
this.generateServiceIdentityOperationCallable =
callableFactory.createOperationCallable(
generateServiceIdentityTransportSettings,
settings.generateServiceIdentityOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
@InternalApi
public static List getMethodDescriptors() {
List methodDescriptors = new ArrayList<>();
methodDescriptors.add(enableServiceMethodDescriptor);
methodDescriptors.add(disableServiceMethodDescriptor);
methodDescriptors.add(getServiceMethodDescriptor);
methodDescriptors.add(listServicesMethodDescriptor);
methodDescriptors.add(batchEnableServicesMethodDescriptor);
methodDescriptors.add(listConsumerQuotaMetricsMethodDescriptor);
methodDescriptors.add(getConsumerQuotaMetricMethodDescriptor);
methodDescriptors.add(getConsumerQuotaLimitMethodDescriptor);
methodDescriptors.add(createAdminOverrideMethodDescriptor);
methodDescriptors.add(updateAdminOverrideMethodDescriptor);
methodDescriptors.add(deleteAdminOverrideMethodDescriptor);
methodDescriptors.add(listAdminOverridesMethodDescriptor);
methodDescriptors.add(importAdminOverridesMethodDescriptor);
methodDescriptors.add(createConsumerOverrideMethodDescriptor);
methodDescriptors.add(updateConsumerOverrideMethodDescriptor);
methodDescriptors.add(deleteConsumerOverrideMethodDescriptor);
methodDescriptors.add(listConsumerOverridesMethodDescriptor);
methodDescriptors.add(importConsumerOverridesMethodDescriptor);
methodDescriptors.add(generateServiceIdentityMethodDescriptor);
return methodDescriptors;
}
public HttpJsonOperationsStub getHttpJsonOperationsStub() {
return httpJsonOperationsStub;
}
@Override
public UnaryCallable enableServiceCallable() {
return enableServiceCallable;
}
@Override
public OperationCallable
enableServiceOperationCallable() {
return enableServiceOperationCallable;
}
@Override
public UnaryCallable disableServiceCallable() {
return disableServiceCallable;
}
@Override
public OperationCallable
disableServiceOperationCallable() {
return disableServiceOperationCallable;
}
@Override
public UnaryCallable getServiceCallable() {
return getServiceCallable;
}
@Override
public UnaryCallable listServicesCallable() {
return listServicesCallable;
}
@Override
public UnaryCallable listServicesPagedCallable() {
return listServicesPagedCallable;
}
@Override
public UnaryCallable batchEnableServicesCallable() {
return batchEnableServicesCallable;
}
@Override
public OperationCallable
batchEnableServicesOperationCallable() {
return batchEnableServicesOperationCallable;
}
@Override
public UnaryCallable
listConsumerQuotaMetricsCallable() {
return listConsumerQuotaMetricsCallable;
}
@Override
public UnaryCallable
listConsumerQuotaMetricsPagedCallable() {
return listConsumerQuotaMetricsPagedCallable;
}
@Override
public UnaryCallable
getConsumerQuotaMetricCallable() {
return getConsumerQuotaMetricCallable;
}
@Override
public UnaryCallable
getConsumerQuotaLimitCallable() {
return getConsumerQuotaLimitCallable;
}
@Override
public UnaryCallable createAdminOverrideCallable() {
return createAdminOverrideCallable;
}
@Override
public OperationCallable
createAdminOverrideOperationCallable() {
return createAdminOverrideOperationCallable;
}
@Override
public UnaryCallable updateAdminOverrideCallable() {
return updateAdminOverrideCallable;
}
@Override
public OperationCallable
updateAdminOverrideOperationCallable() {
return updateAdminOverrideOperationCallable;
}
@Override
public UnaryCallable deleteAdminOverrideCallable() {
return deleteAdminOverrideCallable;
}
@Override
public OperationCallable
deleteAdminOverrideOperationCallable() {
return deleteAdminOverrideOperationCallable;
}
@Override
public UnaryCallable
listAdminOverridesCallable() {
return listAdminOverridesCallable;
}
@Override
public UnaryCallable
listAdminOverridesPagedCallable() {
return listAdminOverridesPagedCallable;
}
@Override
public UnaryCallable importAdminOverridesCallable() {
return importAdminOverridesCallable;
}
@Override
public OperationCallable<
ImportAdminOverridesRequest, ImportAdminOverridesResponse, ImportAdminOverridesMetadata>
importAdminOverridesOperationCallable() {
return importAdminOverridesOperationCallable;
}
@Override
public UnaryCallable createConsumerOverrideCallable() {
return createConsumerOverrideCallable;
}
@Override
public OperationCallable
createConsumerOverrideOperationCallable() {
return createConsumerOverrideOperationCallable;
}
@Override
public UnaryCallable updateConsumerOverrideCallable() {
return updateConsumerOverrideCallable;
}
@Override
public OperationCallable
updateConsumerOverrideOperationCallable() {
return updateConsumerOverrideOperationCallable;
}
@Override
public UnaryCallable