use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class DatasetDelete method datasetDelete.
public static void datasetDelete(String datasetName) throws IOException {
// String datasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Create request and configure any parameters.
Datasets.Delete request = client.projects().locations().datasets().delete(datasetName);
// Execute the request and process the results.
request.execute();
System.out.println("Dataset deleted.");
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class DatasetGetIamPolicy method datasetGetIamPolicy.
public static void datasetGetIamPolicy(String datasetName) throws IOException {
// String datasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Create request and configure any parameters.
Datasets.GetIamPolicy request = client.projects().locations().datasets().getIamPolicy(datasetName);
// Execute the request and process the results.
Policy policy = request.execute();
System.out.println("Dataset IAMPolicy retrieved: \n" + policy.toPrettyString());
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class DatasetList method datasetList.
public static void datasetList(String projectId, String regionId) throws IOException {
// String projectId = "your-project-id";
// String regionId = "us-central1";
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Results are paginated, so multiple queries may be required.
String parentName = String.format("projects/%s/locations/%s", projectId, regionId);
String pageToken = null;
List<Dataset> datasets = new ArrayList<>();
do {
// Create request and configure any parameters.
Datasets.List request = client.projects().locations().datasets().list(parentName).setPageSize(// Specify pageSize up to 1000
100).setPageToken(pageToken);
// Execute response and collect results.
ListDatasetsResponse response = request.execute();
datasets.addAll(response.getDatasets());
// Update the page token for the next request.
pageToken = response.getNextPageToken();
} while (pageToken != null);
// Print results.
System.out.printf("Retrieved %s datasets: \n", datasets.size());
for (Dataset data : datasets) {
System.out.println("\t" + data.toPrettyString());
}
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class DatasetPatch method datasetPatch.
public static void datasetPatch(String datasetName) throws IOException {
// String datasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Fetch the initial state of the dataset.
Datasets.Get getRequest = client.projects().locations().datasets().get(datasetName);
Dataset dataset = getRequest.execute();
// Update the Dataset fields as needed as needed. For a full list of dataset fields, see:
// https://cloud.google.com/healthcare/docs/reference/rest/v1beta1/projects.locations.datasets#Dataset
dataset.setTimeZone("America/New_York");
// Create request and configure any parameters.
Datasets.Patch request = client.projects().locations().datasets().patch(datasetName, dataset).setUpdateMask("timeZone");
// Execute the request and process the results.
dataset = request.execute();
System.out.println("Dataset patched: \n" + dataset.toPrettyString());
}
use of com.google.api.services.healthcare.v1.CloudHealthcare.Projects.Locations.Datasets in project java-docs-samples by GoogleCloudPlatform.
the class DatasetSetIamPolicy method datasetSetIamPolicy.
public static void datasetSetIamPolicy(String datasetName) throws IOException {
// String datasetName =
// String.format(DATASET_NAME, "your-project-id", "your-region-id", "your-dataset-id");
// Initialize the client, which will be used to interact with the service.
CloudHealthcare client = createClient();
// Configure the IAMPolicy to apply to the dataset.
// For more information on understanding IAM roles, see the following:
// https://cloud.google.com/iam/docs/understanding-roles
Binding binding = new Binding().setRole("roles/healthcare.datasetViewer").setMembers(Arrays.asList("domain:google.com"));
Policy policy = new Policy().setBindings(Arrays.asList(binding));
SetIamPolicyRequest policyRequest = new SetIamPolicyRequest().setPolicy(policy);
// Create request and configure any parameters.
Datasets.SetIamPolicy request = client.projects().locations().datasets().setIamPolicy(datasetName, policyRequest);
// Execute the request and process the results.
Policy updatedPolicy = request.execute();
System.out.println("Dataset policy has been updated: " + updatedPolicy.toPrettyString());
}
Aggregations