/** * Returns a list of [Voice][google.cloud.texttospeech.v1.Voice] supported for synthesis. * * <p>Sample code: * * <pre><code> * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { * ListVoicesRequest request = ListVoicesRequest.newBuilder().build(); * ListVoicesResponse response = textToSpeechClient.listVoices(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListVoicesResponse listVoices(ListVoicesRequest request) { return listVoicesCallable().call(request); }
/** Request funnel for all read/write requests. */ <RequestT, ResponseT> ApiFuture<ResponseT> sendRequest( RequestT requestT, UnaryCallable<RequestT, ResponseT> callable) { Preconditions.checkState(!closed, "Firestore client has already been closed"); return callable.futureCall(requestT); }
/** * Creates a callable chain to handle SampleRowKeys RPcs. The chain will: * * <ul> * <li>Convert a table id to a {@link com.google.bigtable.v2.SampleRowKeysRequest}. * <li>Dispatch the request to the GAPIC's {@link BigtableStub#sampleRowKeysCallable()}. * <li>Spool responses into a list. * <li>Retry on failure. * <li>Convert the responses into {@link KeyOffset}s. * </ul> */ private UnaryCallable<String, List<KeyOffset>> createSampleRowKeysCallable() { UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> spoolable = stub.sampleRowKeysCallable().all(); UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> retryable = Callables.retrying(spoolable, settings.sampleRowKeysSettings(), clientContext); UnaryCallable<String, List<KeyOffset>> userFacing = new SampleRowKeysCallable(retryable, requestContext); return userFacing.withDefaultCallContext(clientContext.getDefaultCallContext()); }
/** * Returns a list of [Voice][google.cloud.texttospeech.v1beta1.Voice] supported for synthesis. * * <p>Sample code: * * <pre><code> * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { * ListVoicesRequest request = ListVoicesRequest.newBuilder().build(); * ListVoicesResponse response = textToSpeechClient.listVoices(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListVoicesResponse listVoices(ListVoicesRequest request) { return listVoicesCallable().call(request); }
@Override public ApiFuture<RowT> futureCall(Query query, ApiCallContext context) { return inner.futureCall(query.limit(1), context); } }
/** * Returns a list of the sensitive information types that the DLP API supports. See * https://cloud.google.com/dlp/docs/infotypes-reference to learn more. * * <p>Sample code: * * <pre><code> * try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) { * ListInfoTypesRequest request = ListInfoTypesRequest.newBuilder().build(); * ListInfoTypesResponse response = dlpServiceClient.listInfoTypes(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInfoTypesResponse listInfoTypes(ListInfoTypesRequest request) { return listInfoTypesCallable().call(request); }
@Override public ApiFuture<Void> futureCall(RowMutation request, ApiCallContext context) { return inner.futureCall(request.toBulkProto(requestContext), context); } }
/** * Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn * more. * * <p>Sample code: * * <pre><code> * try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) { * GetInspectTemplateRequest request = GetInspectTemplateRequest.newBuilder().build(); * InspectTemplate response = dlpServiceClient.getInspectTemplate(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final InspectTemplate getInspectTemplate(GetInspectTemplateRequest request) { return getInspectTemplateCallable().call(request); }
@Override public ApiFuture<Void> futureCall(BulkMutation request, ApiCallContext context) { return innerCallable.futureCall(request.toProto(requestContext), context); } }
/** * Deletes the specified intent. * * <p>Sample code: * * <pre><code> * try (IntentsClient intentsClient = IntentsClient.create()) { * IntentName name = IntentName.of("[PROJECT]", "[INTENT]"); * DeleteIntentRequest request = DeleteIntentRequest.newBuilder() * .setName(name.toString()) * .build(); * intentsClient.deleteIntent(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteIntent(DeleteIntentRequest request) { deleteIntentCallable().call(request); }
@Override public ApiFuture<Row> futureCall(ReadModifyWriteRow request, ApiCallContext context) { ApiFuture<ReadModifyWriteRowResponse> rawResponse = inner.futureCall(request.toProto(requestContext), context); return ApiFutures.transform( rawResponse, new ApiFunction<ReadModifyWriteRowResponse, Row>() { @Override public Row apply(ReadModifyWriteRowResponse readModifyWriteRowResponse) { return convertResponse(readModifyWriteRowResponse); } }, MoreExecutors.directExecutor()); }
/** * Run image detection and annotation for a batch of images. * * <p>Sample code: * * <pre><code> * try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) { * List<AnnotateImageRequest> requests = new ArrayList<>(); * BatchAnnotateImagesRequest request = BatchAnnotateImagesRequest.newBuilder() * .addAllRequests(requests) * .build(); * BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImagesRequest request) { return batchAnnotateImagesCallable().call(request); }
@Override public ApiFuture<Empty> delete(DeleteSinkRequest request) { return translate( configClient.deleteSinkCallable().futureCall(request), true, StatusCode.Code.NOT_FOUND); }
/** * Deletes a logs-based metric. * * <p>Sample code: * * <pre><code> * try (MetricsClient metricsClient = MetricsClient.create()) { * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]"); * DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder() * .setMetricName(metricName.toString()) * .build(); * metricsClient.deleteLogMetric(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteLogMetric(DeleteLogMetricRequest request) { deleteLogMetricCallable().call(request); }
@Override public ApiFuture<ListMonitoredResourceDescriptorsResponse> list( ListMonitoredResourceDescriptorsRequest request) { return translate( loggingClient.listMonitoredResourceDescriptorsCallable().futureCall(request), true); }
/** * Deletes all active contexts in the specified session. * * <p>Sample code: * * <pre><code> * try (ContextsClient contextsClient = ContextsClient.create()) { * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]"); * DeleteAllContextsRequest request = DeleteAllContextsRequest.newBuilder() * .setParent(parent.toString()) * .build(); * contextsClient.deleteAllContexts(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteAllContexts(DeleteAllContextsRequest request) { deleteAllContextsCallable().call(request); }
@Override public ApiFuture<Empty> delete(DeleteLogRequest request) { return translate( loggingClient.deleteLogCallable().futureCall(request), true, StatusCode.Code.NOT_FOUND); }
/** * Gets a single alerting policy. * * <p>Sample code: * * <pre><code> * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) { * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]"); * GetAlertPolicyRequest request = GetAlertPolicyRequest.newBuilder() * .setName(name.toString()) * .build(); * AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AlertPolicy getAlertPolicy(GetAlertPolicyRequest request) { return getAlertPolicyCallable().call(request); }
@Override public ApiFuture<LogMetric> get(GetLogMetricRequest request) { return translate( metricsClient.getLogMetricCallable().futureCall(request), true, StatusCode.Code.NOT_FOUND); }
/** * Retrieves an SSH public key. * * <p>Sample code: * * <pre><code> * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { * FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); * GetSshPublicKeyRequest request = GetSshPublicKeyRequest.newBuilder() * .setName(name.toString()) * .build(); * SshPublicKey response = osLoginServiceClient.getSshPublicKey(request); * } * </code></pre> * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SshPublicKey getSshPublicKey(GetSshPublicKeyRequest request) { return getSshPublicKeyCallable().call(request); }