/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * Deletes all error events of a given project. * * <p>Sample code: * * <pre><code> * try (ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient.create()) { * ProjectName projectName = ProjectName.of("[PROJECT]"); * DeleteEventsRequest request = DeleteEventsRequest.newBuilder() * .setProjectName(projectName.toString()) * .build(); * DeleteEventsResponse response = errorStatsServiceClient.deleteEvents(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 DeleteEventsResponse deleteEvents(DeleteEventsRequest request) { return deleteEventsCallable().call(request); }
/** * Returns information about the particular transfer run. * * <p>Sample code: * * <pre><code> * try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { * RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]"); * GetTransferRunRequest request = GetTransferRunRequest.newBuilder() * .setName(name.toString()) * .build(); * TransferRun response = dataTransferServiceClient.getTransferRun(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 TransferRun getTransferRun(GetTransferRunRequest request) { return getTransferRunCallable().call(request); }
/** * Deletes the specified entity type. * * <p>Sample code: * * <pre><code> * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]"); * DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder() * .setName(name.toString()) * .build(); * entityTypesClient.deleteEntityType(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 deleteEntityType(DeleteEntityTypeRequest request) { deleteEntityTypeCallable().call(request); }
/** * Lists the descriptors for monitored resource types used by Logging. * * <p>Sample code: * * <pre><code> * try (LoggingClient loggingClient = LoggingClient.create()) { * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build(); * for (MonitoredResourceDescriptor element : loggingClient.listMonitoredResourceDescriptors(request).iterateAll()) { * // doThingsWith(element); * } * } * </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 ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors( ListMonitoredResourceDescriptorsRequest request) { return listMonitoredResourceDescriptorsPagedCallable().call(request); }
/** * Deletes the specified knowledge base. * * <p>Sample code: * * <pre><code> * try (KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.create()) { * KnowledgeBaseName name = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]"); * DeleteKnowledgeBaseRequest request = DeleteKnowledgeBaseRequest.newBuilder() * .setName(name.toString()) * .build(); * knowledgeBasesClient.deleteKnowledgeBase(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 deleteKnowledgeBase(DeleteKnowledgeBaseRequest request) { deleteKnowledgeBaseCallable().call(request); }
/** * Deletes the specified session entity type. * * <p>Sample code: * * <pre><code> * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) { * SessionEntityTypeName name = SessionEntityTypeName.of("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]"); * DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder() * .setName(name.toString()) * .build(); * sessionEntityTypesClient.deleteSessionEntityType(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 deleteSessionEntityType(DeleteSessionEntityTypeRequest request) { deleteSessionEntityTypeCallable().call(request); }
/** * Retrieves the specified intent. * * <p>Sample code: * * <pre><code> * try (IntentsClient intentsClient = IntentsClient.create()) { * IntentName name = IntentName.of("[PROJECT]", "[INTENT]"); * GetIntentRequest request = GetIntentRequest.newBuilder() * .setName(name.toString()) * .build(); * Intent response = intentsClient.getIntent(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 Intent getIntent(GetIntentRequest request) { return getIntentCallable().call(request); }
/** * Gets information about a particular instance configuration. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * InstanceConfigName name = InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]"); * GetInstanceConfigRequest request = GetInstanceConfigRequest.newBuilder() * .setName(name.toString()) * .build(); * InstanceConfig response = instanceAdminClient.getInstanceConfig(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 InstanceConfig getInstanceConfig(GetInstanceConfigRequest request) { return getInstanceConfigCallable().call(request); }
/** * Stops a ScanRun. The stopped ScanRun is returned. * * <p>Sample code: * * <pre><code> * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) { * String formattedName = WebSecurityScannerClient.formatScanRunName("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]"); * StopScanRunRequest request = StopScanRunRequest.newBuilder() * .setName(formattedName) * .build(); * ScanRun response = webSecurityScannerClient.stopScanRun(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 ScanRun stopScanRun(StopScanRunRequest request) { return stopScanRunCallable().call(request); }
/** * Gets a single document. * * <p>Sample code: * * <pre><code> * try (FirestoreClient firestoreClient = FirestoreClient.create()) { * String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); * GetDocumentRequest request = GetDocumentRequest.newBuilder() * .setName(formattedName) * .build(); * Document response = firestoreClient.getDocument(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 Document getDocument(GetDocumentRequest request) { return getDocumentCallable().call(request); }
/** * Lists the last few versions of the device state in descending order (i.e.: newest first). * * <p>Sample code: * * <pre><code> * try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) { * DeviceName name = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]"); * ListDeviceStatesRequest request = ListDeviceStatesRequest.newBuilder() * .setName(name.toString()) * .build(); * ListDeviceStatesResponse response = deviceManagerClient.listDeviceStates(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 ListDeviceStatesResponse listDeviceStates(ListDeviceStatesRequest request) { return listDeviceStatesCallable().call(request); }
@Test public void scanMarker() { FakeStreamingApi.ServerStreamingStashCallable<ReadRowsRequest, ReadRowsResponse> inner = new ServerStreamingStashCallable<>( Lists.newArrayList( // send a scan marker ReadRowsResponse.newBuilder() .setLastScannedRowKey(ByteString.copyFromUtf8("key1")) .build())); RowMergingCallable<Row> rowMergingCallable = new RowMergingCallable<>(inner, new DefaultRowAdapter()); List<Row> results = rowMergingCallable.all().call(ReadRowsRequest.getDefaultInstance()); Truth.assertThat(results) .containsExactly( Row.create(ByteString.copyFromUtf8("key1"), Lists.<RowCell>newArrayList())); }
@Test public void testFirstIsLimited() { ServerStreamingStashCallable<ReadRowsRequest, Row> innerCallable = new ServerStreamingStashCallable<>(); ReadRowsUserCallable<Row> callable = new ReadRowsUserCallable<>(innerCallable, REQUEST_CONTEXT); Query query = Query.create("fake-table"); callable.first().call(query); Truth.assertThat(innerCallable.getActualRequest()) .isEqualTo(query.limit(1).toProto(REQUEST_CONTEXT)); } }