This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
+ *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * Source source = Source.newBuilder().build();
+ * Source response = securityCenterClient.createSource(parent, source);
+ * }
+ *
+ *
+ *
+ * Note: close() needs to be called on the securityCenterClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of SecurityCenterSettings to + * create(). For example: + * + *
To customize credentials: + * + *
+ *
+ * SecurityCenterSettings securityCenterSettings =
+ * SecurityCenterSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * SecurityCenterClient securityCenterClient =
+ * SecurityCenterClient.create(securityCenterSettings);
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ *
+ * SecurityCenterSettings securityCenterSettings =
+ * SecurityCenterSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SecurityCenterClient securityCenterClient =
+ * SecurityCenterClient.create(securityCenterSettings);
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class SecurityCenterClient implements BackgroundResource {
+ private final SecurityCenterSettings settings;
+ private final SecurityCenterStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of SecurityCenterClient with default settings. */
+ public static final SecurityCenterClient create() throws IOException {
+ return create(SecurityCenterSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of SecurityCenterClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final SecurityCenterClient create(SecurityCenterSettings settings)
+ throws IOException {
+ return new SecurityCenterClient(settings);
+ }
+
+ /**
+ * Constructs an instance of SecurityCenterClient, using the given stub for making calls. This is
+ * for advanced usage - prefer to use SecurityCenterSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final SecurityCenterClient create(SecurityCenterStub stub) {
+ return new SecurityCenterClient(stub);
+ }
+
+ /**
+ * Constructs an instance of SecurityCenterClient, 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 SecurityCenterClient(SecurityCenterSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((SecurityCenterStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected SecurityCenterClient(SecurityCenterStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final SecurityCenterSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public SecurityCenterStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * Source source = Source.newBuilder().build();
+ * Source response = securityCenterClient.createSource(parent, source);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new source's parent. Its format should be
+ * "organizations/[organization_id]".
+ * @param source Required. The Source being created, only the display_name and description will be
+ * used. All other fields will be ignored.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Source createSource(OrganizationName parent, Source source) {
+ CreateSourceRequest request =
+ CreateSourceRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSource(source)
+ .build();
+ return createSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * Source source = Source.newBuilder().build();
+ * Source response = securityCenterClient.createSource(parent.toString(), source);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new source's parent. Its format should be
+ * "organizations/[organization_id]".
+ * @param source Required. The Source being created, only the display_name and description will be
+ * used. All other fields will be ignored.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Source createSource(String parent, Source source) {
+ CreateSourceRequest request =
+ CreateSourceRequest.newBuilder().setParent(parent).setSource(source).build();
+ return createSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * Source source = Source.newBuilder().build();
+ * CreateSourceRequest request = CreateSourceRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setSource(source)
+ * .build();
+ * Source response = securityCenterClient.createSource(request);
+ * }
+ *
+ *
+ * @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 Source createSource(CreateSourceRequest request) {
+ return createSourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * Source source = Source.newBuilder().build();
+ * CreateSourceRequest request = CreateSourceRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setSource(source)
+ * .build();
+ * ApiFuture<Source> future = securityCenterClient.createSourceCallable().futureCall(request);
+ * // Do something
+ * Source response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String findingId = "";
+ * Finding finding = Finding.newBuilder().build();
+ * Finding response = securityCenterClient.createFinding(parent, findingId, finding);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new finding's parent. Its format should be
+ * "organizations/[organization_id]/sources/[source_id]".
+ * @param findingId Required. Unique identifier provided by the client within the parent scope. It
+ * must be alphanumeric and less than or equal to 32 characters and greater than 0 characters
+ * in length.
+ * @param finding Required. The Finding being created. The name and security_marks will be ignored
+ * as they are both output only fields on this resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Finding createFinding(SourceName parent, String findingId, Finding finding) {
+ CreateFindingRequest request =
+ CreateFindingRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setFindingId(findingId)
+ .setFinding(finding)
+ .build();
+ return createFinding(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a finding. The corresponding source must exist for finding creation to succeed.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String findingId = "";
+ * Finding finding = Finding.newBuilder().build();
+ * Finding response = securityCenterClient.createFinding(parent.toString(), findingId, finding);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new finding's parent. Its format should be
+ * "organizations/[organization_id]/sources/[source_id]".
+ * @param findingId Required. Unique identifier provided by the client within the parent scope. It
+ * must be alphanumeric and less than or equal to 32 characters and greater than 0 characters
+ * in length.
+ * @param finding Required. The Finding being created. The name and security_marks will be ignored
+ * as they are both output only fields on this resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Finding createFinding(String parent, String findingId, Finding finding) {
+ CreateFindingRequest request =
+ CreateFindingRequest.newBuilder()
+ .setParent(parent)
+ .setFindingId(findingId)
+ .setFinding(finding)
+ .build();
+ return createFinding(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a finding. The corresponding source must exist for finding creation to succeed.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String findingId = "";
+ * Finding finding = Finding.newBuilder().build();
+ * CreateFindingRequest request = CreateFindingRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setFindingId(findingId)
+ * .setFinding(finding)
+ * .build();
+ * Finding response = securityCenterClient.createFinding(request);
+ * }
+ *
+ *
+ * @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 Finding createFinding(CreateFindingRequest request) {
+ return createFindingCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a finding. The corresponding source must exist for finding creation to succeed.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String findingId = "";
+ * Finding finding = Finding.newBuilder().build();
+ * CreateFindingRequest request = CreateFindingRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setFindingId(findingId)
+ * .setFinding(finding)
+ * .build();
+ * ApiFuture<Finding> future = securityCenterClient.createFindingCallable().futureCall(request);
+ * // Do something
+ * Finding response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String configId = "";
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * NotificationConfig response = securityCenterClient.createNotificationConfig(parent, configId, notificationConfig);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new notification config's parent. Its format is
+ * "organizations/[organization_id]".
+ * @param configId Required. Unique identifier provided by the client within the parent scope. It
+ * must be between 1 and 128 characters, and contains alphanumeric characters, underscores or
+ * hyphens only.
+ * @param notificationConfig Required. The notification config being created. The name and the
+ * service account will be ignored as they are both output only fields on this resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig createNotificationConfig(
+ OrganizationName parent, String configId, NotificationConfig notificationConfig) {
+ CreateNotificationConfigRequest request =
+ CreateNotificationConfigRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setConfigId(configId)
+ .setNotificationConfig(notificationConfig)
+ .build();
+ return createNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String configId = "";
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * NotificationConfig response = securityCenterClient.createNotificationConfig(parent.toString(), configId, notificationConfig);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new notification config's parent. Its format is
+ * "organizations/[organization_id]".
+ * @param configId Required. Unique identifier provided by the client within the parent scope. It
+ * must be between 1 and 128 characters, and contains alphanumeric characters, underscores or
+ * hyphens only.
+ * @param notificationConfig Required. The notification config being created. The name and the
+ * service account will be ignored as they are both output only fields on this resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig createNotificationConfig(
+ String parent, String configId, NotificationConfig notificationConfig) {
+ CreateNotificationConfigRequest request =
+ CreateNotificationConfigRequest.newBuilder()
+ .setParent(parent)
+ .setConfigId(configId)
+ .setNotificationConfig(notificationConfig)
+ .build();
+ return createNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * NotificationConfig response = securityCenterClient.createNotificationConfig(parent, notificationConfig);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new notification config's parent. Its format is
+ * "organizations/[organization_id]".
+ * @param notificationConfig Required. The notification config being created. The name and the
+ * service account will be ignored as they are both output only fields on this resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig createNotificationConfig(
+ OrganizationName parent, NotificationConfig notificationConfig) {
+ CreateNotificationConfigRequest request =
+ CreateNotificationConfigRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setNotificationConfig(notificationConfig)
+ .build();
+ return createNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * NotificationConfig response = securityCenterClient.createNotificationConfig(parent.toString(), notificationConfig);
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the new notification config's parent. Its format is
+ * "organizations/[organization_id]".
+ * @param notificationConfig Required. The notification config being created. The name and the
+ * service account will be ignored as they are both output only fields on this resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig createNotificationConfig(
+ String parent, NotificationConfig notificationConfig) {
+ CreateNotificationConfigRequest request =
+ CreateNotificationConfigRequest.newBuilder()
+ .setParent(parent)
+ .setNotificationConfig(notificationConfig)
+ .build();
+ return createNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String configId = "";
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * CreateNotificationConfigRequest request = CreateNotificationConfigRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setConfigId(configId)
+ * .setNotificationConfig(notificationConfig)
+ * .build();
+ * NotificationConfig response = securityCenterClient.createNotificationConfig(request);
+ * }
+ *
+ *
+ * @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 NotificationConfig createNotificationConfig(
+ CreateNotificationConfigRequest request) {
+ return createNotificationConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String configId = "";
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * CreateNotificationConfigRequest request = CreateNotificationConfigRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setConfigId(configId)
+ * .setNotificationConfig(notificationConfig)
+ * .build();
+ * ApiFuture<NotificationConfig> future = securityCenterClient.createNotificationConfigCallable().futureCall(request);
+ * // Do something
+ * NotificationConfig response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * securityCenterClient.deleteNotificationConfig(name);
+ * }
+ *
+ *
+ * @param name Required. Name of the notification config to delete. Its format is
+ * "organizations/[organization_id]/notificationConfigs/[config_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteNotificationConfig(NotificationConfigName name) {
+ DeleteNotificationConfigRequest request =
+ DeleteNotificationConfigRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * securityCenterClient.deleteNotificationConfig(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Name of the notification config to delete. Its format is
+ * "organizations/[organization_id]/notificationConfigs/[config_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteNotificationConfig(String name) {
+ DeleteNotificationConfigRequest request =
+ DeleteNotificationConfigRequest.newBuilder().setName(name).build();
+ deleteNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * DeleteNotificationConfigRequest request = DeleteNotificationConfigRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * securityCenterClient.deleteNotificationConfig(request);
+ * }
+ *
+ *
+ * @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 deleteNotificationConfig(DeleteNotificationConfigRequest request) {
+ deleteNotificationConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * DeleteNotificationConfigRequest request = DeleteNotificationConfigRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = securityCenterClient.deleteNotificationConfigCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * Policy response = securityCenterClient.getIamPolicy(resource);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(ResourceName resource) {
+ GetIamPolicyRequest request =
+ GetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .build();
+ return getIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy on the specified Source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * Policy response = securityCenterClient.getIamPolicy(resource.toString());
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(String resource) {
+ GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return getIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy on the specified Source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .build();
+ * Policy response = securityCenterClient.getIamPolicy(request);
+ * }
+ *
+ *
+ * @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 Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy on the specified Source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .build();
+ * ApiFuture<Policy> future = securityCenterClient.getIamPolicyCallable().futureCall(request);
+ * // Do something
+ * Policy response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * NotificationConfig response = securityCenterClient.getNotificationConfig(name);
+ * }
+ *
+ *
+ * @param name Required. Name of the notification config to get. Its format is
+ * "organizations/[organization_id]/notificationConfigs/[config_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig getNotificationConfig(NotificationConfigName name) {
+ GetNotificationConfigRequest request =
+ GetNotificationConfigRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * NotificationConfig response = securityCenterClient.getNotificationConfig(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Name of the notification config to get. Its format is
+ * "organizations/[organization_id]/notificationConfigs/[config_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig getNotificationConfig(String name) {
+ GetNotificationConfigRequest request =
+ GetNotificationConfigRequest.newBuilder().setName(name).build();
+ return getNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * GetNotificationConfigRequest request = GetNotificationConfigRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * NotificationConfig response = securityCenterClient.getNotificationConfig(request);
+ * }
+ *
+ *
+ * @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 NotificationConfig getNotificationConfig(GetNotificationConfigRequest request) {
+ return getNotificationConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]");
+ * GetNotificationConfigRequest request = GetNotificationConfigRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<NotificationConfig> future = securityCenterClient.getNotificationConfigCallable().futureCall(request);
+ * // Do something
+ * NotificationConfig response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+ * OrganizationSettings response = securityCenterClient.getOrganizationSettings(name);
+ * }
+ *
+ *
+ * @param name Required. Name of the organization to get organization settings for. Its format is
+ * "organizations/[organization_id]/organizationSettings".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OrganizationSettings getOrganizationSettings(OrganizationSettingsName name) {
+ GetOrganizationSettingsRequest request =
+ GetOrganizationSettingsRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getOrganizationSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the settings for an organization.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+ * OrganizationSettings response = securityCenterClient.getOrganizationSettings(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Name of the organization to get organization settings for. Its format is
+ * "organizations/[organization_id]/organizationSettings".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OrganizationSettings getOrganizationSettings(String name) {
+ GetOrganizationSettingsRequest request =
+ GetOrganizationSettingsRequest.newBuilder().setName(name).build();
+ return getOrganizationSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the settings for an organization.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+ * GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * OrganizationSettings response = securityCenterClient.getOrganizationSettings(request);
+ * }
+ *
+ *
+ * @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 OrganizationSettings getOrganizationSettings(
+ GetOrganizationSettingsRequest request) {
+ return getOrganizationSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the settings for an organization.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+ * GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<OrganizationSettings> future = securityCenterClient.getOrganizationSettingsCallable().futureCall(request);
+ * // Do something
+ * OrganizationSettings response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * Source response = securityCenterClient.getSource(name);
+ * }
+ *
+ *
+ * @param name Required. Relative resource name of the source. Its format is
+ * "organizations/[organization_id]/source/[source_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Source getSource(SourceName name) {
+ GetSourceRequest request =
+ GetSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * Source response = securityCenterClient.getSource(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Relative resource name of the source. Its format is
+ * "organizations/[organization_id]/source/[source_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Source getSource(String name) {
+ GetSourceRequest request = GetSourceRequest.newBuilder().setName(name).build();
+ return getSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * GetSourceRequest request = GetSourceRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * Source response = securityCenterClient.getSource(request);
+ * }
+ *
+ *
+ * @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 Source getSource(GetSourceRequest request) {
+ return getSourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * GetSourceRequest request = GetSourceRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Source> future = securityCenterClient.getSourceCallable().futureCall(request);
+ * // Do something
+ * Source response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String groupBy = "";
+ * GroupAssetsRequest request = GroupAssetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setGroupBy(groupBy)
+ * .build();
+ * for (GroupResult element : securityCenterClient.groupAssets(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @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 GroupAssetsPagedResponse groupAssets(GroupAssetsRequest request) {
+ return groupAssetsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Filters an organization's assets and groups them by their specified properties.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String groupBy = "";
+ * GroupAssetsRequest request = GroupAssetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setGroupBy(groupBy)
+ * .build();
+ * ApiFuture<GroupAssetsPagedResponse> future = securityCenterClient.groupAssetsPagedCallable().futureCall(request);
+ * // Do something
+ * for (GroupResult element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * String groupBy = "";
+ * GroupAssetsRequest request = GroupAssetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setGroupBy(groupBy)
+ * .build();
+ * while (true) {
+ * GroupAssetsResponse response = securityCenterClient.groupAssetsCallable().call(request);
+ * for (GroupResult element : response.getGroupByResultsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableTo group across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String groupBy = "";
+ * for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the source to groupBy. Its format is
+ * "organizations/[organization_id]/sources/[source_id]". To groupBy across all sources
+ * provide a source_id of `-`. For example: organizations/{organization_id}/sources/-
+ * @param groupBy Required. Expression that defines what assets fields to use for grouping
+ * (including `state_change`). The string value should follow SQL syntax: comma separated list
+ * of fields. For example: "parent,resource_name".
+ * The following fields are supported: + *
* resource_name * category * state * parent + *
The following fields are supported when compare_duration is set: + *
* state_change + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GroupFindingsPagedResponse groupFindings(SourceName parent, String groupBy) { + GroupFindingsRequest request = + GroupFindingsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setGroupBy(groupBy) + .build(); + return groupFindings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *
To group across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String groupBy = "";
+ * for (GroupResult element : securityCenterClient.groupFindings(parent.toString(), groupBy).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the source to groupBy. Its format is
+ * "organizations/[organization_id]/sources/[source_id]". To groupBy across all sources
+ * provide a source_id of `-`. For example: organizations/{organization_id}/sources/-
+ * @param groupBy Required. Expression that defines what assets fields to use for grouping
+ * (including `state_change`). The string value should follow SQL syntax: comma separated list
+ * of fields. For example: "parent,resource_name".
+ * The following fields are supported: + *
* resource_name * category * state * parent + *
The following fields are supported when compare_duration is set: + *
* state_change + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GroupFindingsPagedResponse groupFindings(String parent, String groupBy) { + GroupFindingsRequest request = + GroupFindingsRequest.newBuilder().setParent(parent).setGroupBy(groupBy).build(); + return groupFindings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *
To group across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String groupBy = "";
+ * GroupFindingsRequest request = GroupFindingsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setGroupBy(groupBy)
+ * .build();
+ * for (GroupResult element : securityCenterClient.groupFindings(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @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 GroupFindingsPagedResponse groupFindings(GroupFindingsRequest request) {
+ return groupFindingsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Filters an organization or source's findings and groups them by their specified properties.
+ *
+ * To group across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String groupBy = "";
+ * GroupFindingsRequest request = GroupFindingsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setGroupBy(groupBy)
+ * .build();
+ * ApiFuture<GroupFindingsPagedResponse> future = securityCenterClient.groupFindingsPagedCallable().futureCall(request);
+ * // Do something
+ * for (GroupResult element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableTo group across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * String groupBy = "";
+ * GroupFindingsRequest request = GroupFindingsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setGroupBy(groupBy)
+ * .build();
+ * while (true) {
+ * GroupFindingsResponse response = securityCenterClient.groupFindingsCallable().call(request);
+ * for (GroupResult element : response.getGroupByResultsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the organization assets should belong to. Its format is
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAssetsPagedResponse listAssets(OrganizationName parent) {
+ ListAssetsRequest request =
+ ListAssetsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listAssets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists an organization's assets.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the organization assets should belong to. Its format is
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAssetsPagedResponse listAssets(String parent) {
+ ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent).build();
+ return listAssets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists an organization's assets.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListAssetsRequest request = ListAssetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @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 ListAssetsPagedResponse listAssets(ListAssetsRequest request) {
+ return listAssetsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists an organization's assets.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListAssetsRequest request = ListAssetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListAssetsPagedResponse> future = securityCenterClient.listAssetsPagedCallable().futureCall(request);
+ * // Do something
+ * for (ListAssetsResponse.ListAssetsResult element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListAssetsRequest request = ListAssetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListAssetsResponse response = securityCenterClient.listAssetsCallable().call(request);
+ * for (ListAssetsResponse.ListAssetsResult element : response.getListAssetsResultsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableTo list across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the source the findings belong to. Its format is
+ * "organizations/[organization_id]/sources/[source_id]". To list across all sources provide a
+ * source_id of `-`. For example: organizations/{organization_id}/sources/-
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListFindingsPagedResponse listFindings(SourceName parent) {
+ ListFindingsRequest request =
+ ListFindingsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listFindings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists an organization or source's findings.
+ *
+ * To list across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the source the findings belong to. Its format is
+ * "organizations/[organization_id]/sources/[source_id]". To list across all sources provide a
+ * source_id of `-`. For example: organizations/{organization_id}/sources/-
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListFindingsPagedResponse listFindings(String parent) {
+ ListFindingsRequest request = ListFindingsRequest.newBuilder().setParent(parent).build();
+ return listFindings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists an organization or source's findings.
+ *
+ * To list across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * ListFindingsRequest request = ListFindingsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @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 ListFindingsPagedResponse listFindings(ListFindingsRequest request) {
+ return listFindingsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists an organization or source's findings.
+ *
+ * To list across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * ListFindingsRequest request = ListFindingsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListFindingsPagedResponse> future = securityCenterClient.listFindingsPagedCallable().futureCall(request);
+ * // Do something
+ * for (ListFindingsResponse.ListFindingsResult element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableTo list across all sources provide a `-` as the source id. Example: + * /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+ * ListFindingsRequest request = ListFindingsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListFindingsResponse response = securityCenterClient.listFindingsCallable().call(request);
+ * for (ListFindingsResponse.ListFindingsResult element : response.getListFindingsResultsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (NotificationConfig element : securityCenterClient.listNotificationConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the organization to list notification configs. Its format is
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotificationConfigsPagedResponse listNotificationConfigs(
+ OrganizationName parent) {
+ ListNotificationConfigsRequest request =
+ ListNotificationConfigsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listNotificationConfigs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists notification configs.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (NotificationConfig element : securityCenterClient.listNotificationConfigs(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of the organization to list notification configs. Its format is
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotificationConfigsPagedResponse listNotificationConfigs(String parent) {
+ ListNotificationConfigsRequest request =
+ ListNotificationConfigsRequest.newBuilder().setParent(parent).build();
+ return listNotificationConfigs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists notification configs.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListNotificationConfigsRequest request = ListNotificationConfigsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (NotificationConfig element : securityCenterClient.listNotificationConfigs(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @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 ListNotificationConfigsPagedResponse listNotificationConfigs(
+ ListNotificationConfigsRequest request) {
+ return listNotificationConfigsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists notification configs.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListNotificationConfigsRequest request = ListNotificationConfigsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListNotificationConfigsPagedResponse> future = securityCenterClient.listNotificationConfigsPagedCallable().futureCall(request);
+ * // Do something
+ * for (NotificationConfig element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListNotificationConfigsRequest request = ListNotificationConfigsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListNotificationConfigsResponse response = securityCenterClient.listNotificationConfigsCallable().call(request);
+ * for (NotificationConfig element : response.getNotificationConfigsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the parent of sources to list. Its format should be
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSourcesPagedResponse listSources(OrganizationName parent) {
+ ListSourcesRequest request =
+ ListSourcesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listSources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all sources belonging to an organization.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (Source element : securityCenterClient.listSources(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Resource name of the parent of sources to list. Its format should be
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSourcesPagedResponse listSources(String parent) {
+ ListSourcesRequest request = ListSourcesRequest.newBuilder().setParent(parent).build();
+ return listSources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all sources belonging to an organization.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListSourcesRequest request = ListSourcesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (Source element : securityCenterClient.listSources(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @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 ListSourcesPagedResponse listSources(ListSourcesRequest request) {
+ return listSourcesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all sources belonging to an organization.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListSourcesRequest request = ListSourcesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListSourcesPagedResponse> future = securityCenterClient.listSourcesPagedCallable().futureCall(request);
+ * // Do something
+ * for (Source element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * ListSourcesRequest request = ListSourcesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListSourcesResponse response = securityCenterClient.listSourcesCallable().call(request);
+ * for (Source element : response.getSourcesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableThis API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * RunAssetDiscoveryResponse response = securityCenterClient.runAssetDiscoveryAsync(parent).get();
+ * }
+ *
+ *
+ * @param parent Required. Name of the organization to run asset discovery for. Its format is
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureThis API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * RunAssetDiscoveryResponse response = securityCenterClient.runAssetDiscoveryAsync(parent.toString()).get();
+ * }
+ *
+ *
+ * @param parent Required. Name of the organization to run asset discovery for. Its format is
+ * "organizations/[organization_id]".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureThis API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * RunAssetDiscoveryResponse response = securityCenterClient.runAssetDiscoveryAsync(request).get();
+ * }
+ *
+ *
+ * @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
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureThis API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * OperationFuture<RunAssetDiscoveryResponse, Empty> future = securityCenterClient.runAssetDiscoveryOperationCallable().futureCall(request);
+ * // Do something
+ * RunAssetDiscoveryResponse response = future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallableThis API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<Operation> future = securityCenterClient.runAssetDiscoveryCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+ * Finding.State state = Finding.State.STATE_UNSPECIFIED;
+ * Timestamp startTime = Timestamp.newBuilder().build();
+ * Finding response = securityCenterClient.setFindingState(name, state, startTime);
+ * }
+ *
+ *
+ * @param name Required. The relative resource name of the finding. See:
+ * https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
+ * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".
+ * @param state Required. The desired State of the finding.
+ * @param startTime Required. The time at which the updated state takes effect.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Finding setFindingState(FindingName name, Finding.State state, Timestamp startTime) {
+ SetFindingStateRequest request =
+ SetFindingStateRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setState(state)
+ .setStartTime(startTime)
+ .build();
+ return setFindingState(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates the state of a finding.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+ * Finding.State state = Finding.State.STATE_UNSPECIFIED;
+ * Timestamp startTime = Timestamp.newBuilder().build();
+ * Finding response = securityCenterClient.setFindingState(name.toString(), state, startTime);
+ * }
+ *
+ *
+ * @param name Required. The relative resource name of the finding. See:
+ * https://cloud.google.com/apis/design/resource_names#relative_resource_name Example:
+ * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".
+ * @param state Required. The desired State of the finding.
+ * @param startTime Required. The time at which the updated state takes effect.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Finding setFindingState(String name, Finding.State state, Timestamp startTime) {
+ SetFindingStateRequest request =
+ SetFindingStateRequest.newBuilder()
+ .setName(name)
+ .setState(state)
+ .setStartTime(startTime)
+ .build();
+ return setFindingState(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates the state of a finding.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+ * Finding.State state = Finding.State.STATE_UNSPECIFIED;
+ * Timestamp startTime = Timestamp.newBuilder().build();
+ * SetFindingStateRequest request = SetFindingStateRequest.newBuilder()
+ * .setName(name.toString())
+ * .setState(state)
+ * .setStartTime(startTime)
+ * .build();
+ * Finding response = securityCenterClient.setFindingState(request);
+ * }
+ *
+ *
+ * @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 Finding setFindingState(SetFindingStateRequest request) {
+ return setFindingStateCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates the state of a finding.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+ * Finding.State state = Finding.State.STATE_UNSPECIFIED;
+ * Timestamp startTime = Timestamp.newBuilder().build();
+ * SetFindingStateRequest request = SetFindingStateRequest.newBuilder()
+ * .setName(name.toString())
+ * .setState(state)
+ * .setStartTime(startTime)
+ * .build();
+ * ApiFuture<Finding> future = securityCenterClient.setFindingStateCallable().futureCall(request);
+ * // Do something
+ * Finding response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * Policy policy = Policy.newBuilder().build();
+ * Policy response = securityCenterClient.setIamPolicy(resource, policy);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
+ * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
+ * Platform services (such as Projects) might reject them.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .setPolicy(policy)
+ .build();
+ return setIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Sets the access control policy on the specified Source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * Policy policy = Policy.newBuilder().build();
+ * Policy response = securityCenterClient.setIamPolicy(resource.toString(), policy);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
+ * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
+ * Platform services (such as Projects) might reject them.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(String resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build();
+ return setIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Sets the access control policy on the specified Source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * Policy policy = Policy.newBuilder().build();
+ * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .setPolicy(policy)
+ * .build();
+ * Policy response = securityCenterClient.setIamPolicy(request);
+ * }
+ *
+ *
+ * @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 Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Sets the access control policy on the specified Source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * Policy policy = Policy.newBuilder().build();
+ * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .setPolicy(policy)
+ * .build();
+ * ApiFuture<Policy> future = securityCenterClient.setIamPolicyCallable().futureCall(request);
+ * // Do something
+ * Policy response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(resource, permissions);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy detail is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @param permissions The set of permissions to check for the `resource`. Permissions with
+ * wildcards (such as '*' or 'storage.*') are not allowed. For more information see
+ * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(
+ ResourceName resource, ListSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(resource.toString(), permissions);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy detail is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @param permissions The set of permissions to check for the `resource`. Permissions with
+ * wildcards (such as '*' or 'storage.*') are not allowed. For more information see
+ * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(
+ String resource, ListSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .addAllPermissions(permissions)
+ * .build();
+ * TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(request);
+ * }
+ *
+ *
+ * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the permissions that a caller has on the specified source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+ * .setResource(resource.toString())
+ * .addAllPermissions(permissions)
+ * .build();
+ * ApiFuture<TestIamPermissionsResponse> future = securityCenterClient.testIamPermissionsCallable().futureCall(request);
+ * // Do something
+ * TestIamPermissionsResponse response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Finding finding = Finding.newBuilder().build();
+ * Finding response = securityCenterClient.updateFinding(finding);
+ * }
+ *
+ *
+ * @param finding Required. The finding resource to update or create if it does not already exist.
+ * parent, security_marks, and update_time will be ignored.
+ * In the case of creation, the finding id portion of the name must be alphanumeric and + * less than or equal to 32 characters and greater than 0 characters in length. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding updateFinding(Finding finding) { + UpdateFindingRequest request = UpdateFindingRequest.newBuilder().setFinding(finding).build(); + return updateFinding(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a finding. The corresponding source must exist for a finding creation to + * succeed. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Finding finding = Finding.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Finding response = securityCenterClient.updateFinding(finding, updateMask);
+ * }
+ *
+ *
+ * @param finding Required. The finding resource to update or create if it does not already exist.
+ * parent, security_marks, and update_time will be ignored.
+ * In the case of creation, the finding id portion of the name must be alphanumeric and + * less than or equal to 32 characters and greater than 0 characters in length. + * @param updateMask The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + *
When updating a finding, an empty mask is treated as updating all mutable fields and + * replacing source_properties. Individual source_properties can be added/updated by using + * "source_properties.<property key>" in the field mask. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding updateFinding(Finding finding, FieldMask updateMask) { + UpdateFindingRequest request = + UpdateFindingRequest.newBuilder().setFinding(finding).setUpdateMask(updateMask).build(); + return updateFinding(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a finding. The corresponding source must exist for a finding creation to + * succeed. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Finding finding = Finding.newBuilder().build();
+ * UpdateFindingRequest request = UpdateFindingRequest.newBuilder()
+ * .setFinding(finding)
+ * .build();
+ * Finding response = securityCenterClient.updateFinding(request);
+ * }
+ *
+ *
+ * @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 Finding updateFinding(UpdateFindingRequest request) {
+ return updateFindingCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates or updates a finding. The corresponding source must exist for a finding creation to
+ * succeed.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Finding finding = Finding.newBuilder().build();
+ * UpdateFindingRequest request = UpdateFindingRequest.newBuilder()
+ * .setFinding(finding)
+ * .build();
+ * ApiFuture<Finding> future = securityCenterClient.updateFindingCallable().futureCall(request);
+ * // Do something
+ * Finding response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * NotificationConfig response = securityCenterClient.updateNotificationConfig(notificationConfig);
+ * }
+ *
+ *
+ * @param notificationConfig Required. The notification config to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotificationConfig updateNotificationConfig(NotificationConfig notificationConfig) {
+ UpdateNotificationConfigRequest request =
+ UpdateNotificationConfigRequest.newBuilder()
+ .setNotificationConfig(notificationConfig)
+ .build();
+ return updateNotificationConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * NotificationConfig response = securityCenterClient.updateNotificationConfig(notificationConfig, updateMask);
+ * }
+ *
+ *
+ * @param notificationConfig Required. The notification config to update.
+ * @param updateMask The FieldMask to use when updating the notification config.
+ * If empty all mutable fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NotificationConfig updateNotificationConfig( + NotificationConfig notificationConfig, FieldMask updateMask) { + UpdateNotificationConfigRequest request = + UpdateNotificationConfigRequest.newBuilder() + .setNotificationConfig(notificationConfig) + .setUpdateMask(updateMask) + .build(); + return updateNotificationConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a notification config. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * UpdateNotificationConfigRequest request = UpdateNotificationConfigRequest.newBuilder()
+ * .setNotificationConfig(notificationConfig)
+ * .build();
+ * NotificationConfig response = securityCenterClient.updateNotificationConfig(request);
+ * }
+ *
+ *
+ * @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 NotificationConfig updateNotificationConfig(
+ UpdateNotificationConfigRequest request) {
+ return updateNotificationConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a notification config.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * NotificationConfig notificationConfig = NotificationConfig.newBuilder().build();
+ * UpdateNotificationConfigRequest request = UpdateNotificationConfigRequest.newBuilder()
+ * .setNotificationConfig(notificationConfig)
+ * .build();
+ * ApiFuture<NotificationConfig> future = securityCenterClient.updateNotificationConfigCallable().futureCall(request);
+ * // Do something
+ * NotificationConfig response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
+ * OrganizationSettings response = securityCenterClient.updateOrganizationSettings(organizationSettings);
+ * }
+ *
+ *
+ * @param organizationSettings Required. The organization settings resource to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OrganizationSettings updateOrganizationSettings(
+ OrganizationSettings organizationSettings) {
+ UpdateOrganizationSettingsRequest request =
+ UpdateOrganizationSettingsRequest.newBuilder()
+ .setOrganizationSettings(organizationSettings)
+ .build();
+ return updateOrganizationSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an organization's settings.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
+ * UpdateOrganizationSettingsRequest request = UpdateOrganizationSettingsRequest.newBuilder()
+ * .setOrganizationSettings(organizationSettings)
+ * .build();
+ * OrganizationSettings response = securityCenterClient.updateOrganizationSettings(request);
+ * }
+ *
+ *
+ * @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 OrganizationSettings updateOrganizationSettings(
+ UpdateOrganizationSettingsRequest request) {
+ return updateOrganizationSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an organization's settings.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
+ * UpdateOrganizationSettingsRequest request = UpdateOrganizationSettingsRequest.newBuilder()
+ * .setOrganizationSettings(organizationSettings)
+ * .build();
+ * ApiFuture<OrganizationSettings> future = securityCenterClient.updateOrganizationSettingsCallable().futureCall(request);
+ * // Do something
+ * OrganizationSettings response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Source source = Source.newBuilder().build();
+ * Source response = securityCenterClient.updateSource(source);
+ * }
+ *
+ *
+ * @param source Required. The source resource to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Source updateSource(Source source) {
+ UpdateSourceRequest request = UpdateSourceRequest.newBuilder().setSource(source).build();
+ return updateSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Source source = Source.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Source response = securityCenterClient.updateSource(source, updateMask);
+ * }
+ *
+ *
+ * @param source Required. The source resource to update.
+ * @param updateMask The FieldMask to use when updating the source resource.
+ * If empty all mutable fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source updateSource(Source source, FieldMask updateMask) { + UpdateSourceRequest request = + UpdateSourceRequest.newBuilder().setSource(source).setUpdateMask(updateMask).build(); + return updateSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a source. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Source source = Source.newBuilder().build();
+ * UpdateSourceRequest request = UpdateSourceRequest.newBuilder()
+ * .setSource(source)
+ * .build();
+ * Source response = securityCenterClient.updateSource(request);
+ * }
+ *
+ *
+ * @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 Source updateSource(UpdateSourceRequest request) {
+ return updateSourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a source.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * Source source = Source.newBuilder().build();
+ * UpdateSourceRequest request = UpdateSourceRequest.newBuilder()
+ * .setSource(source)
+ * .build();
+ * ApiFuture<Source> future = securityCenterClient.updateSourceCallable().futureCall(request);
+ * // Do something
+ * Source response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+ * SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks);
+ * }
+ *
+ *
+ * @param securityMarks Required. The security marks resource to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks) {
+ UpdateSecurityMarksRequest request =
+ UpdateSecurityMarksRequest.newBuilder().setSecurityMarks(securityMarks).build();
+ return updateSecurityMarks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates security marks.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks, updateMask);
+ * }
+ *
+ *
+ * @param securityMarks Required. The security marks resource to update.
+ * @param updateMask The FieldMask to use when updating the security marks resource.
+ * The field mask must not contain duplicate fields. If empty or set to "marks", all marks + * will be replaced. Individual marks can be updated using "marks.<mark_key>". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SecurityMarks updateSecurityMarks( + SecurityMarks securityMarks, FieldMask updateMask) { + UpdateSecurityMarksRequest request = + UpdateSecurityMarksRequest.newBuilder() + .setSecurityMarks(securityMarks) + .setUpdateMask(updateMask) + .build(); + return updateSecurityMarks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates security marks. + * + *
Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+ * UpdateSecurityMarksRequest request = UpdateSecurityMarksRequest.newBuilder()
+ * .setSecurityMarks(securityMarks)
+ * .build();
+ * SecurityMarks response = securityCenterClient.updateSecurityMarks(request);
+ * }
+ *
+ *
+ * @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 SecurityMarks updateSecurityMarks(UpdateSecurityMarksRequest request) {
+ return updateSecurityMarksCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates security marks.
+ *
+ * Sample code: + * + *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+ * UpdateSecurityMarksRequest request = UpdateSecurityMarksRequest.newBuilder()
+ * .setSecurityMarks(securityMarks)
+ * .build();
+ * ApiFuture<SecurityMarks> future = securityCenterClient.updateSecurityMarksCallable().futureCall(request);
+ * // Do something
+ * SecurityMarks response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createSource to 30 seconds: + * + *
+ *
+ * SecurityCenterSettings.Builder securityCenterSettingsBuilder =
+ * SecurityCenterSettings.newBuilder();
+ * securityCenterSettingsBuilder
+ * .createSourceSettings()
+ * .setRetrySettings(
+ * securityCenterSettingsBuilder.createSourceSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SecurityCenterSettings securityCenterSettings = securityCenterSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class SecurityCenterSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ==================== SecurityCenterClient ====================
+ *
+ * Service Description: V1p1Beta1 APIs for Security Center service.
+ *
+ * Sample for SecurityCenterClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator")
+@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+public class GrpcSecurityCenterCallableFactory implements GrpcStubCallableFactory {
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public class GrpcSecurityCenterStub extends SecurityCenterStub {
+
+ private static final MethodDescriptor
+ *
+ */
+@Generated("by gapic-generator")
+package com.google.cloud.securitycenter.v1p1beta1;
+
+import javax.annotation.Generated;
diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterCallableFactory.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterCallableFactory.java
new file mode 100644
index 000000000..99203d37a
--- /dev/null
+++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterCallableFactory.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2020 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.cloud.securitycenter.v1p1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * gRPC callable factory implementation for Cloud Security Command Center API.
+ *
+ *
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * Source source = Source.newBuilder().build();
+ * Source response = securityCenterClient.createSource(parent, source);
+ * }
+ *
+ *