From e18a7b6bb0cd3a39fc992cf98334606e6d726321 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 10 Feb 2020 16:30:20 -0800 Subject: [PATCH] feat: add v1p1beta1 client --- google-cloud-securitycenter-bom/pom.xml | 2 +- google-cloud-securitycenter/pom.xml | 9 + .../v1p1beta1/SecurityCenterClient.java | 3348 ++++++++++ .../v1p1beta1/SecurityCenterSettings.java | 471 ++ .../v1p1beta1/package-info.java | 41 + .../GrpcSecurityCenterCallableFactory.java | 115 + .../stub/GrpcSecurityCenterStub.java | 1003 +++ .../v1p1beta1/stub/SecurityCenterStub.java | 222 + .../stub/SecurityCenterStubSettings.java | 1319 ++++ .../v1p1beta1/MockSecurityCenter.java | 57 + .../v1p1beta1/MockSecurityCenterImpl.java | 411 ++ .../v1p1beta1/SecurityCenterClientTest.java | 1451 +++++ .../pom.xml | 64 + .../v1p1beta1/SecurityCenterGrpc.java | 3336 ++++++++++ pom.xml | 12 + .../pom.xml | 38 + .../cloud/securitycenter/v1p1beta1/Asset.java | 5449 +++++++++++++++++ .../securitycenter/v1p1beta1/AssetName.java | 182 + .../v1p1beta1/AssetOrBuilder.java | 314 + .../v1p1beta1/AssetOuterClass.java | 167 + .../v1p1beta1/CreateFindingRequest.java | 1165 ++++ .../CreateFindingRequestOrBuilder.java | 129 + .../CreateNotificationConfigRequest.java | 1205 ++++ ...ateNotificationConfigRequestOrBuilder.java | 135 + .../v1p1beta1/CreateSourceRequest.java | 971 +++ .../CreateSourceRequestOrBuilder.java | 100 + .../DeleteNotificationConfigRequest.java | 676 ++ ...eteNotificationConfigRequestOrBuilder.java | 56 + .../securitycenter/v1p1beta1/Finding.java | 3024 +++++++++ .../securitycenter/v1p1beta1/FindingName.java | 211 + .../v1p1beta1/FindingOrBuilder.java | 400 ++ .../v1p1beta1/FindingOuterClass.java | 133 + .../GetNotificationConfigRequest.java | 668 ++ ...GetNotificationConfigRequestOrBuilder.java | 56 + .../GetOrganizationSettingsRequest.java | 673 ++ ...tOrganizationSettingsRequestOrBuilder.java | 56 + .../v1p1beta1/GetSourceRequest.java | 656 ++ .../v1p1beta1/GetSourceRequestOrBuilder.java | 56 + .../v1p1beta1/GroupAssetsRequest.java | 2698 ++++++++ .../GroupAssetsRequestOrBuilder.java | 430 ++ .../v1p1beta1/GroupAssetsResponse.java | 1570 +++++ .../GroupAssetsResponseOrBuilder.java | 163 + .../v1p1beta1/GroupFindingsRequest.java | 2598 ++++++++ .../GroupFindingsRequestOrBuilder.java | 401 ++ .../v1p1beta1/GroupFindingsResponse.java | 1573 +++++ .../GroupFindingsResponseOrBuilder.java | 163 + .../securitycenter/v1p1beta1/GroupResult.java | 874 +++ .../v1p1beta1/GroupResultOrBuilder.java | 93 + .../v1p1beta1/ListAssetsRequest.java | 3026 +++++++++ .../v1p1beta1/ListAssetsRequestOrBuilder.java | 483 ++ .../v1p1beta1/ListAssetsResponse.java | 2767 +++++++++ .../ListAssetsResponseOrBuilder.java | 168 + .../v1p1beta1/ListFindingsRequest.java | 2934 +++++++++ .../ListFindingsRequestOrBuilder.java | 456 ++ .../v1p1beta1/ListFindingsResponse.java | 4732 ++++++++++++++ .../ListFindingsResponseOrBuilder.java | 168 + .../ListNotificationConfigsRequest.java | 956 +++ ...stNotificationConfigsRequestOrBuilder.java | 99 + .../ListNotificationConfigsResponse.java | 1226 ++++ ...tNotificationConfigsResponseOrBuilder.java | 116 + .../v1p1beta1/ListSourcesRequest.java | 942 +++ .../ListSourcesRequestOrBuilder.java | 99 + .../v1p1beta1/ListSourcesResponse.java | 1138 ++++ .../ListSourcesResponseOrBuilder.java | 104 + .../v1p1beta1/NotificationConfig.java | 2757 +++++++++ .../v1p1beta1/NotificationConfigName.java | 192 + .../NotificationConfigOrBuilder.java | 207 + .../NotificationConfigOuterClass.java | 122 + .../v1p1beta1/NotificationMessage.java | 1026 ++++ .../NotificationMessageOrBuilder.java | 90 + .../NotificationMessageOuterClass.java | 82 + .../v1p1beta1/OrganizationName.java | 162 + .../v1p1beta1/OrganizationSettings.java | 2308 +++++++ .../v1p1beta1/OrganizationSettingsName.java | 162 + .../OrganizationSettingsOrBuilder.java | 115 + .../OrganizationSettingsOuterClass.java | 108 + .../v1p1beta1/RunAssetDiscoveryRequest.java | 667 ++ .../RunAssetDiscoveryRequestOrBuilder.java | 56 + .../v1p1beta1/RunAssetDiscoveryResponse.java | 1074 ++++ .../RunAssetDiscoveryResponseOrBuilder.java | 85 + .../RunAssetDiscoveryResponseOuterClass.java | 81 + .../v1p1beta1/SecurityMarks.java | 1048 ++++ .../v1p1beta1/SecurityMarksName.java | 321 + .../v1p1beta1/SecurityMarksNames.java | 32 + .../v1p1beta1/SecurityMarksOrBuilder.java | 142 + .../v1p1beta1/SecurityMarksOuterClass.java | 103 + .../v1p1beta1/SecuritycenterService.java | 821 +++ .../v1p1beta1/SetFindingStateRequest.java | 1119 ++++ .../SetFindingStateRequestOrBuilder.java | 127 + .../securitycenter/v1p1beta1/Source.java | 1082 ++++ .../securitycenter/v1p1beta1/SourceName.java | 182 + .../v1p1beta1/SourceOrBuilder.java | 126 + .../v1p1beta1/SourceOuterClass.java | 84 + .../securitycenter/v1p1beta1/TopicName.java | 182 + .../v1p1beta1/UntypedSecurityMarksName.java | 106 + .../v1p1beta1/UpdateFindingRequest.java | 1140 ++++ .../UpdateFindingRequestOrBuilder.java | 128 + .../UpdateNotificationConfigRequest.java | 1065 ++++ ...ateNotificationConfigRequestOrBuilder.java | 105 + .../UpdateOrganizationSettingsRequest.java | 1072 ++++ ...eOrganizationSettingsRequestOrBuilder.java | 105 + .../v1p1beta1/UpdateSecurityMarksRequest.java | 1366 +++++ .../UpdateSecurityMarksRequestOrBuilder.java | 151 + .../v1p1beta1/UpdateSourceRequest.java | 1041 ++++ .../UpdateSourceRequestOrBuilder.java | 104 + .../securitycenter/v1p1beta1/asset.proto | 119 + .../securitycenter/v1p1beta1/finding.proto | 111 + .../v1p1beta1/notification_config.proto | 112 + .../v1p1beta1/notification_message.proto | 42 + .../v1p1beta1/organization_settings.proto | 83 + .../run_asset_discovery_response.proto | 53 + .../v1p1beta1/security_marks.proto | 57 + .../v1p1beta1/securitycenter_service.proto | 1277 ++++ .../securitycenter/v1p1beta1/source.proto | 60 + synth.py | 2 +- versions.txt | 2 + 116 files changed, 81320 insertions(+), 2 deletions(-) create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClient.java create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterSettings.java create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/package-info.java create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterCallableFactory.java create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterStub.java create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStub.java create mode 100644 google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStubSettings.java create mode 100644 google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenter.java create mode 100644 google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenterImpl.java create mode 100644 google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClientTest.java create mode 100644 grpc-google-cloud-securitycenter-v1p1beta1/pom.xml create mode 100644 grpc-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterGrpc.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/pom.xml create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Asset.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Finding.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResult.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResultOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfig.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessage.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettings.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponse.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarks.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksNames.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecuritycenterService.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Source.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOuterClass.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/TopicName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UntypedSecurityMarksName.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequest.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequestOrBuilder.java create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/asset.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/finding.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_config.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_message.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/organization_settings.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/security_marks.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto create mode 100644 proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/source.proto diff --git a/google-cloud-securitycenter-bom/pom.xml b/google-cloud-securitycenter-bom/pom.xml index 7a7b2c35b..22c4a7ecc 100644 --- a/google-cloud-securitycenter-bom/pom.xml +++ b/google-cloud-securitycenter-bom/pom.xml @@ -11,7 +11,7 @@ 0.4.0 - Google Cloud securitycenter BOM + Google Cloud Security Command Center BOM https://github.com/googleapis/java-securitycenter BOM for Google Cloud Security Command Center diff --git a/google-cloud-securitycenter/pom.xml b/google-cloud-securitycenter/pom.xml index 4d6d9123c..90d6510bc 100644 --- a/google-cloud-securitycenter/pom.xml +++ b/google-cloud-securitycenter/pom.xml @@ -50,6 +50,10 @@ com.google.api.grpc proto-google-cloud-securitycenter-v1beta1 + + com.google.api.grpc + proto-google-cloud-securitycenter-v1p1beta1 + com.google.guava guava @@ -88,6 +92,11 @@ grpc-google-cloud-securitycenter-v1beta1 test + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1p1beta1 + test + com.google.api diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClient.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClient.java new file mode 100644 index 000000000..e3f558dc7 --- /dev/null +++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClient.java @@ -0,0 +1,3348 @@ +/* + * 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; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.securitycenter.v1p1beta1.stub.SecurityCenterStub; +import com.google.cloud.securitycenter.v1p1beta1.stub.SecurityCenterStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: V1p1Beta1 APIs for Security Center service. + * + *

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: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

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 UnaryCallable createSourceCallable() { + return stub.createSourceCallable(); + } + + // 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, 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 UnaryCallable createFindingCallable() { + return stub.createFindingCallable(); + } + + // 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, 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 UnaryCallable + createNotificationConfigCallable() { + return stub.createNotificationConfigCallable(); + } + + // 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);
+   * }
+   * 
+ * + * @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 UnaryCallable + deleteNotificationConfigCallable() { + return stub.deleteNotificationConfigCallable(); + } + + // 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);
+   * }
+   * 
+ * + * @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 UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // 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);
+   * }
+   * 
+ * + * @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 UnaryCallable + getNotificationConfigCallable() { + return stub.getNotificationConfigCallable(); + } + + // 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);
+   * }
+   * 
+ * + * @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 UnaryCallable + getOrganizationSettingsCallable() { + return stub.getOrganizationSettingsCallable(); + } + + // 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);
+   * }
+   * 
+ * + * @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 UnaryCallable getSourceCallable() { + return stub.getSourceCallable(); + } + + // 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();
+   *   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 UnaryCallable + groupAssetsPagedCallable() { + return stub.groupAssetsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable groupAssetsCallable() { + return stub.groupAssetsCallable(); + } + + // 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, 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 UnaryCallable + groupFindingsPagedCallable() { + return stub.groupFindingsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable groupFindingsCallable() { + return stub.groupFindingsCallable(); + } + + // 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).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 UnaryCallable listAssetsPagedCallable() { + return stub.listAssetsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable listAssetsCallable() { + return stub.listAssetsCallable(); + } + + // 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).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 UnaryCallable + listFindingsPagedCallable() { + return stub.listFindingsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable listFindingsCallable() { + return stub.listFindingsCallable(); + } + + // 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).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 UnaryCallable + listNotificationConfigsPagedCallable() { + return stub.listNotificationConfigsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable + listNotificationConfigsCallable() { + return stub.listNotificationConfigsCallable(); + } + + // 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).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 UnaryCallable + listSourcesPagedCallable() { + return stub.listSourcesPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable listSourcesCallable() { + return stub.listSourcesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This 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 OperationFuture runAssetDiscoveryAsync( + OrganizationName parent) { + RunAssetDiscoveryRequest request = + RunAssetDiscoveryRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return runAssetDiscoveryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This 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 OperationFuture runAssetDiscoveryAsync( + String parent) { + RunAssetDiscoveryRequest request = + RunAssetDiscoveryRequest.newBuilder().setParent(parent).build(); + return runAssetDiscoveryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This 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 OperationFuture runAssetDiscoveryAsync( + RunAssetDiscoveryRequest request) { + return runAssetDiscoveryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This 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 OperationCallable + runAssetDiscoveryOperationCallable() { + return stub.runAssetDiscoveryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This 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 UnaryCallable runAssetDiscoveryCallable() { + return stub.runAssetDiscoveryCallable(); + } + + // 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, 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 UnaryCallable setFindingStateCallable() { + return stub.setFindingStateCallable(); + } + + // 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, 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 UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // 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<>();
+   *   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, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(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<>();
+   *   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, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(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();
+   *   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 UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + // 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();
+   *   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 UnaryCallable updateFindingCallable() { + return stub.updateFindingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a notification config. + * + *

Sample 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 UnaryCallable + updateNotificationConfigCallable() { + return stub.updateNotificationConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an organization's settings. + * + *

Sample 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 UnaryCallable + updateOrganizationSettingsCallable() { + return stub.updateOrganizationSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a source. + * + *

Sample 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 UnaryCallable updateSourceCallable() { + return stub.updateSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates security marks. + * + *

Sample 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 UnaryCallable + updateSecurityMarksCallable() { + return stub.updateSecurityMarksCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class GroupAssetsPagedResponse + extends AbstractPagedListResponse< + GroupAssetsRequest, + GroupAssetsResponse, + GroupResult, + GroupAssetsPage, + GroupAssetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + GroupAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public GroupAssetsPagedResponse apply(GroupAssetsPage input) { + return new GroupAssetsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private GroupAssetsPagedResponse(GroupAssetsPage page) { + super(page, GroupAssetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class GroupAssetsPage + extends AbstractPage { + + private GroupAssetsPage( + PageContext context, + GroupAssetsResponse response) { + super(context, response); + } + + private static GroupAssetsPage createEmptyPage() { + return new GroupAssetsPage(null, null); + } + + @Override + protected GroupAssetsPage createPage( + PageContext context, + GroupAssetsResponse response) { + return new GroupAssetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class GroupAssetsFixedSizeCollection + extends AbstractFixedSizeCollection< + GroupAssetsRequest, + GroupAssetsResponse, + GroupResult, + GroupAssetsPage, + GroupAssetsFixedSizeCollection> { + + private GroupAssetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static GroupAssetsFixedSizeCollection createEmptyCollection() { + return new GroupAssetsFixedSizeCollection(null, 0); + } + + @Override + protected GroupAssetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new GroupAssetsFixedSizeCollection(pages, collectionSize); + } + } + + public static class GroupFindingsPagedResponse + extends AbstractPagedListResponse< + GroupFindingsRequest, + GroupFindingsResponse, + GroupResult, + GroupFindingsPage, + GroupFindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + GroupFindingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public GroupFindingsPagedResponse apply(GroupFindingsPage input) { + return new GroupFindingsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private GroupFindingsPagedResponse(GroupFindingsPage page) { + super(page, GroupFindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class GroupFindingsPage + extends AbstractPage< + GroupFindingsRequest, GroupFindingsResponse, GroupResult, GroupFindingsPage> { + + private GroupFindingsPage( + PageContext context, + GroupFindingsResponse response) { + super(context, response); + } + + private static GroupFindingsPage createEmptyPage() { + return new GroupFindingsPage(null, null); + } + + @Override + protected GroupFindingsPage createPage( + PageContext context, + GroupFindingsResponse response) { + return new GroupFindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class GroupFindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + GroupFindingsRequest, + GroupFindingsResponse, + GroupResult, + GroupFindingsPage, + GroupFindingsFixedSizeCollection> { + + private GroupFindingsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static GroupFindingsFixedSizeCollection createEmptyCollection() { + return new GroupFindingsFixedSizeCollection(null, 0); + } + + @Override + protected GroupFindingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new GroupFindingsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAssetsPagedResponse + extends AbstractPagedListResponse< + ListAssetsRequest, + ListAssetsResponse, + ListAssetsResponse.ListAssetsResult, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAssetsPagedResponse apply(ListAssetsPage input) { + return new ListAssetsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAssetsPagedResponse(ListAssetsPage page) { + super(page, ListAssetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAssetsPage + extends AbstractPage< + ListAssetsRequest, + ListAssetsResponse, + ListAssetsResponse.ListAssetsResult, + ListAssetsPage> { + + private ListAssetsPage( + PageContext + context, + ListAssetsResponse response) { + super(context, response); + } + + private static ListAssetsPage createEmptyPage() { + return new ListAssetsPage(null, null); + } + + @Override + protected ListAssetsPage createPage( + PageContext + context, + ListAssetsResponse response) { + return new ListAssetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAssetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAssetsRequest, + ListAssetsResponse, + ListAssetsResponse.ListAssetsResult, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + private ListAssetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAssetsFixedSizeCollection createEmptyCollection() { + return new ListAssetsFixedSizeCollection(null, 0); + } + + @Override + protected ListAssetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAssetsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListFindingsPagedResponse + extends AbstractPagedListResponse< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult, + ListFindingsPage, + ListFindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFindingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFindingsPagedResponse apply(ListFindingsPage input) { + return new ListFindingsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFindingsPagedResponse(ListFindingsPage page) { + super(page, ListFindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFindingsPage + extends AbstractPage< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult, + ListFindingsPage> { + + private ListFindingsPage( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ListFindingsResponse response) { + super(context, response); + } + + private static ListFindingsPage createEmptyPage() { + return new ListFindingsPage(null, null); + } + + @Override + protected ListFindingsPage createPage( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ListFindingsResponse response) { + return new ListFindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult, + ListFindingsPage, + ListFindingsFixedSizeCollection> { + + private ListFindingsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFindingsFixedSizeCollection createEmptyCollection() { + return new ListFindingsFixedSizeCollection(null, 0); + } + + @Override + protected ListFindingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFindingsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNotificationConfigsPagedResponse + extends AbstractPagedListResponse< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig, + ListNotificationConfigsPage, + ListNotificationConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNotificationConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNotificationConfigsPagedResponse apply(ListNotificationConfigsPage input) { + return new ListNotificationConfigsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListNotificationConfigsPagedResponse(ListNotificationConfigsPage page) { + super(page, ListNotificationConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNotificationConfigsPage + extends AbstractPage< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig, + ListNotificationConfigsPage> { + + private ListNotificationConfigsPage( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ListNotificationConfigsResponse response) { + super(context, response); + } + + private static ListNotificationConfigsPage createEmptyPage() { + return new ListNotificationConfigsPage(null, null); + } + + @Override + protected ListNotificationConfigsPage createPage( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ListNotificationConfigsResponse response) { + return new ListNotificationConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNotificationConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig, + ListNotificationConfigsPage, + ListNotificationConfigsFixedSizeCollection> { + + private ListNotificationConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNotificationConfigsFixedSizeCollection createEmptyCollection() { + return new ListNotificationConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListNotificationConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNotificationConfigsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSourcesPagedResponse + extends AbstractPagedListResponse< + ListSourcesRequest, + ListSourcesResponse, + Source, + ListSourcesPage, + ListSourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSourcesPagedResponse apply(ListSourcesPage input) { + return new ListSourcesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListSourcesPagedResponse(ListSourcesPage page) { + super(page, ListSourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSourcesPage + extends AbstractPage { + + private ListSourcesPage( + PageContext context, + ListSourcesResponse response) { + super(context, response); + } + + private static ListSourcesPage createEmptyPage() { + return new ListSourcesPage(null, null); + } + + @Override + protected ListSourcesPage createPage( + PageContext context, + ListSourcesResponse response) { + return new ListSourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSourcesRequest, + ListSourcesResponse, + Source, + ListSourcesPage, + ListSourcesFixedSizeCollection> { + + private ListSourcesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSourcesFixedSizeCollection createEmptyCollection() { + return new ListSourcesFixedSizeCollection(null, 0); + } + + @Override + protected ListSourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSourcesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterSettings.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterSettings.java new file mode 100644 index 000000000..a598bc4a2 --- /dev/null +++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterSettings.java @@ -0,0 +1,471 @@ +/* + * 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; + +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListNotificationConfigsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.securitycenter.v1p1beta1.stub.SecurityCenterStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SecurityCenterClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (securitycenter.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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 ClientSettings { + /** Returns the object with the settings used for calls to createSource. */ + public UnaryCallSettings createSourceSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).createSourceSettings(); + } + + /** Returns the object with the settings used for calls to createFinding. */ + public UnaryCallSettings createFindingSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).createFindingSettings(); + } + + /** Returns the object with the settings used for calls to createNotificationConfig. */ + public UnaryCallSettings + createNotificationConfigSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).createNotificationConfigSettings(); + } + + /** Returns the object with the settings used for calls to deleteNotificationConfig. */ + public UnaryCallSettings + deleteNotificationConfigSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).deleteNotificationConfigSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getNotificationConfig. */ + public UnaryCallSettings + getNotificationConfigSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getNotificationConfigSettings(); + } + + /** Returns the object with the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings + getOrganizationSettingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getOrganizationSettingsSettings(); + } + + /** Returns the object with the settings used for calls to getSource. */ + public UnaryCallSettings getSourceSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getSourceSettings(); + } + + /** Returns the object with the settings used for calls to groupAssets. */ + public PagedCallSettings + groupAssetsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).groupAssetsSettings(); + } + + /** Returns the object with the settings used for calls to groupFindings. */ + public PagedCallSettings + groupFindingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).groupFindingsSettings(); + } + + /** Returns the object with the settings used for calls to listAssets. */ + public PagedCallSettings + listAssetsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listAssetsSettings(); + } + + /** Returns the object with the settings used for calls to listFindings. */ + public PagedCallSettings + listFindingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listFindingsSettings(); + } + + /** Returns the object with the settings used for calls to listNotificationConfigs. */ + public PagedCallSettings< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listNotificationConfigsSettings(); + } + + /** Returns the object with the settings used for calls to listSources. */ + public PagedCallSettings + listSourcesSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listSourcesSettings(); + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings runAssetDiscoverySettings() { + return ((SecurityCenterStubSettings) getStubSettings()).runAssetDiscoverySettings(); + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + runAssetDiscoveryOperationSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).runAssetDiscoveryOperationSettings(); + } + + /** Returns the object with the settings used for calls to setFindingState. */ + public UnaryCallSettings setFindingStateSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).setFindingStateSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SecurityCenterStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to updateFinding. */ + public UnaryCallSettings updateFindingSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateFindingSettings(); + } + + /** Returns the object with the settings used for calls to updateNotificationConfig. */ + public UnaryCallSettings + updateNotificationConfigSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateNotificationConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings + updateOrganizationSettingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateOrganizationSettingsSettings(); + } + + /** Returns the object with the settings used for calls to updateSource. */ + public UnaryCallSettings updateSourceSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateSourceSettings(); + } + + /** Returns the object with the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings + updateSecurityMarksSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateSecurityMarksSettings(); + } + + public static final SecurityCenterSettings create(SecurityCenterStubSettings stub) + throws IOException { + return new SecurityCenterSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SecurityCenterStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SecurityCenterStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SecurityCenterStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SecurityCenterStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SecurityCenterStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SecurityCenterStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SecurityCenterStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SecurityCenterSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SecurityCenterSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SecurityCenterStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SecurityCenterStubSettings.newBuilder()); + } + + protected Builder(SecurityCenterSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SecurityCenterStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public SecurityCenterStubSettings.Builder getStubSettingsBuilder() { + return ((SecurityCenterStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSource. */ + public UnaryCallSettings.Builder createSourceSettings() { + return getStubSettingsBuilder().createSourceSettings(); + } + + /** Returns the builder for the settings used for calls to createFinding. */ + public UnaryCallSettings.Builder createFindingSettings() { + return getStubSettingsBuilder().createFindingSettings(); + } + + /** Returns the builder for the settings used for calls to createNotificationConfig. */ + public UnaryCallSettings.Builder + createNotificationConfigSettings() { + return getStubSettingsBuilder().createNotificationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNotificationConfig. */ + public UnaryCallSettings.Builder + deleteNotificationConfigSettings() { + return getStubSettingsBuilder().deleteNotificationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getNotificationConfig. */ + public UnaryCallSettings.Builder + getNotificationConfigSettings() { + return getStubSettingsBuilder().getNotificationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings.Builder + getOrganizationSettingsSettings() { + return getStubSettingsBuilder().getOrganizationSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to getSource. */ + public UnaryCallSettings.Builder getSourceSettings() { + return getStubSettingsBuilder().getSourceSettings(); + } + + /** Returns the builder for the settings used for calls to groupAssets. */ + public PagedCallSettings.Builder< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + groupAssetsSettings() { + return getStubSettingsBuilder().groupAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to groupFindings. */ + public PagedCallSettings.Builder< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings() { + return getStubSettingsBuilder().groupFindingsSettings(); + } + + /** Returns the builder for the settings used for calls to listAssets. */ + public PagedCallSettings.Builder + listAssetsSettings() { + return getStubSettingsBuilder().listAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to listFindings. */ + public PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings() { + return getStubSettingsBuilder().listFindingsSettings(); + } + + /** Returns the builder for the settings used for calls to listNotificationConfigs. */ + public PagedCallSettings.Builder< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return getStubSettingsBuilder().listNotificationConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to listSources. */ + public PagedCallSettings.Builder< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + listSourcesSettings() { + return getStubSettingsBuilder().listSourcesSettings(); + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings.Builder + runAssetDiscoverySettings() { + return getStubSettingsBuilder().runAssetDiscoverySettings(); + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + runAssetDiscoveryOperationSettings() { + return getStubSettingsBuilder().runAssetDiscoveryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setFindingState. */ + public UnaryCallSettings.Builder setFindingStateSettings() { + return getStubSettingsBuilder().setFindingStateSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateFinding. */ + public UnaryCallSettings.Builder updateFindingSettings() { + return getStubSettingsBuilder().updateFindingSettings(); + } + + /** Returns the builder for the settings used for calls to updateNotificationConfig. */ + public UnaryCallSettings.Builder + updateNotificationConfigSettings() { + return getStubSettingsBuilder().updateNotificationConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings.Builder + updateOrganizationSettingsSettings() { + return getStubSettingsBuilder().updateOrganizationSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to updateSource. */ + public UnaryCallSettings.Builder updateSourceSettings() { + return getStubSettingsBuilder().updateSourceSettings(); + } + + /** Returns the builder for the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings.Builder + updateSecurityMarksSettings() { + return getStubSettingsBuilder().updateSecurityMarksSettings(); + } + + @Override + public SecurityCenterSettings build() throws IOException { + return new SecurityCenterSettings(this); + } + } +} diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/package-info.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/package-info.java new file mode 100644 index 000000000..2168e0a47 --- /dev/null +++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/package-info.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * A client to Cloud Security Command Center API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

==================== SecurityCenterClient ==================== + * + *

Service Description: V1p1Beta1 APIs for Security Center service. + * + *

Sample for SecurityCenterClient: + * + *

+ * 
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ *   Source source = Source.newBuilder().build();
+ *   Source response = securityCenterClient.createSource(parent, source);
+ * }
+ * 
+ * 
+ */ +@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. + * + *

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 UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterStub.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterStub.java new file mode 100644 index 000000000..53bf003d8 --- /dev/null +++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/GrpcSecurityCenterStub.java @@ -0,0 +1,1003 @@ +/* + * 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 static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListNotificationConfigsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.Finding; +import com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1p1beta1.NotificationConfig; +import com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings; +import com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; +import com.google.cloud.securitycenter.v1p1beta1.SecurityMarks; +import com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1p1beta1.Source; +import com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Security Command Center API. + * + *

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 createSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/CreateSource") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Source.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createFindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/CreateFinding") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateFindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/CreateNotificationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(NotificationConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/DeleteNotificationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/GetNotificationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(NotificationConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getOrganizationSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/GetOrganizationSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OrganizationSettings.getDefaultInstance())) + .build(); + private static final MethodDescriptor getSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/GetSource") + .setRequestMarshaller(ProtoUtils.marshaller(GetSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Source.getDefaultInstance())) + .build(); + private static final MethodDescriptor + groupAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/GroupAssets") + .setRequestMarshaller(ProtoUtils.marshaller(GroupAssetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GroupAssetsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + groupFindingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/GroupFindings") + .setRequestMarshaller( + ProtoUtils.marshaller(GroupFindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GroupFindingsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/ListAssets") + .setRequestMarshaller(ProtoUtils.marshaller(ListAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListAssetsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listFindingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/ListFindings") + .setRequestMarshaller(ProtoUtils.marshaller(ListFindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFindingsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + ListNotificationConfigsRequest, ListNotificationConfigsResponse> + listNotificationConfigsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/ListNotificationConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListNotificationConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListNotificationConfigsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listSourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/ListSources") + .setRequestMarshaller(ProtoUtils.marshaller(ListSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSourcesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + runAssetDiscoveryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/RunAssetDiscovery") + .setRequestMarshaller( + ProtoUtils.marshaller(RunAssetDiscoveryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + setFindingStateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/SetFindingState") + .setRequestMarshaller( + ProtoUtils.marshaller(SetFindingStateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateFindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/UpdateFinding") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateFindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateNotificationConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/UpdateNotificationConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(NotificationConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateOrganizationSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/UpdateOrganizationSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OrganizationSettings.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1p1beta1.SecurityCenter/UpdateSource") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Source.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateSecurityMarksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter/UpdateSecurityMarks") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSecurityMarksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SecurityMarks.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createSourceCallable; + private final UnaryCallable createFindingCallable; + private final UnaryCallable + createNotificationConfigCallable; + private final UnaryCallable + deleteNotificationConfigCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + getNotificationConfigCallable; + private final UnaryCallable + getOrganizationSettingsCallable; + private final UnaryCallable getSourceCallable; + private final UnaryCallable groupAssetsCallable; + private final UnaryCallable + groupAssetsPagedCallable; + private final UnaryCallable groupFindingsCallable; + private final UnaryCallable + groupFindingsPagedCallable; + private final UnaryCallable listAssetsCallable; + private final UnaryCallable listAssetsPagedCallable; + private final UnaryCallable listFindingsCallable; + private final UnaryCallable + listFindingsPagedCallable; + private final UnaryCallable + listNotificationConfigsCallable; + private final UnaryCallable + listNotificationConfigsPagedCallable; + private final UnaryCallable listSourcesCallable; + private final UnaryCallable + listSourcesPagedCallable; + private final UnaryCallable runAssetDiscoveryCallable; + private final OperationCallable + runAssetDiscoveryOperationCallable; + private final UnaryCallable setFindingStateCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + private final UnaryCallable updateFindingCallable; + private final UnaryCallable + updateNotificationConfigCallable; + private final UnaryCallable + updateOrganizationSettingsCallable; + private final UnaryCallable updateSourceCallable; + private final UnaryCallable + updateSecurityMarksCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSecurityCenterStub create(SecurityCenterStubSettings settings) + throws IOException { + return new GrpcSecurityCenterStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSecurityCenterStub create(ClientContext clientContext) + throws IOException { + return new GrpcSecurityCenterStub( + SecurityCenterStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSecurityCenterStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSecurityCenterStub( + SecurityCenterStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSecurityCenterStub, 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 GrpcSecurityCenterStub(SecurityCenterStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSecurityCenterCallableFactory()); + } + + /** + * Constructs an instance of GrpcSecurityCenterStub, 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 GrpcSecurityCenterStub( + SecurityCenterStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSourceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateSourceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createFindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFindingMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateFindingRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createNotificationConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateNotificationConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNotificationConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteNotificationConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getNotificationConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetNotificationConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getOrganizationSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationSettingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetOrganizationSettingsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSourceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetSourceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings groupAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(groupAssetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GroupAssetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings groupFindingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(groupFindingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GroupFindingsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAssetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListAssetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listFindingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFindingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListFindingsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listNotificationConfigsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listNotificationConfigsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListNotificationConfigsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listSourcesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSourcesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListSourcesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings runAssetDiscoveryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(runAssetDiscoveryMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RunAssetDiscoveryRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setFindingStateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setFindingStateMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetFindingStateRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateFindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFindingMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateFindingRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("finding.name", String.valueOf(request.getFinding().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateNotificationConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateNotificationConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateNotificationConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "notification_config.name", + String.valueOf(request.getNotificationConfig().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateOrganizationSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateOrganizationSettingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + UpdateOrganizationSettingsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "organization_settings.name", + String.valueOf(request.getOrganizationSettings().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSourceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateSourceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("source.name", String.valueOf(request.getSource().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateSecurityMarksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSecurityMarksMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateSecurityMarksRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "security_marks.name", + String.valueOf(request.getSecurityMarks().getName())); + return params.build(); + } + }) + .build(); + + this.createSourceCallable = + callableFactory.createUnaryCallable( + createSourceTransportSettings, settings.createSourceSettings(), clientContext); + this.createFindingCallable = + callableFactory.createUnaryCallable( + createFindingTransportSettings, settings.createFindingSettings(), clientContext); + this.createNotificationConfigCallable = + callableFactory.createUnaryCallable( + createNotificationConfigTransportSettings, + settings.createNotificationConfigSettings(), + clientContext); + this.deleteNotificationConfigCallable = + callableFactory.createUnaryCallable( + deleteNotificationConfigTransportSettings, + settings.deleteNotificationConfigSettings(), + clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.getNotificationConfigCallable = + callableFactory.createUnaryCallable( + getNotificationConfigTransportSettings, + settings.getNotificationConfigSettings(), + clientContext); + this.getOrganizationSettingsCallable = + callableFactory.createUnaryCallable( + getOrganizationSettingsTransportSettings, + settings.getOrganizationSettingsSettings(), + clientContext); + this.getSourceCallable = + callableFactory.createUnaryCallable( + getSourceTransportSettings, settings.getSourceSettings(), clientContext); + this.groupAssetsCallable = + callableFactory.createUnaryCallable( + groupAssetsTransportSettings, settings.groupAssetsSettings(), clientContext); + this.groupAssetsPagedCallable = + callableFactory.createPagedCallable( + groupAssetsTransportSettings, settings.groupAssetsSettings(), clientContext); + this.groupFindingsCallable = + callableFactory.createUnaryCallable( + groupFindingsTransportSettings, settings.groupFindingsSettings(), clientContext); + this.groupFindingsPagedCallable = + callableFactory.createPagedCallable( + groupFindingsTransportSettings, settings.groupFindingsSettings(), clientContext); + this.listAssetsCallable = + callableFactory.createUnaryCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listAssetsPagedCallable = + callableFactory.createPagedCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listFindingsCallable = + callableFactory.createUnaryCallable( + listFindingsTransportSettings, settings.listFindingsSettings(), clientContext); + this.listFindingsPagedCallable = + callableFactory.createPagedCallable( + listFindingsTransportSettings, settings.listFindingsSettings(), clientContext); + this.listNotificationConfigsCallable = + callableFactory.createUnaryCallable( + listNotificationConfigsTransportSettings, + settings.listNotificationConfigsSettings(), + clientContext); + this.listNotificationConfigsPagedCallable = + callableFactory.createPagedCallable( + listNotificationConfigsTransportSettings, + settings.listNotificationConfigsSettings(), + clientContext); + this.listSourcesCallable = + callableFactory.createUnaryCallable( + listSourcesTransportSettings, settings.listSourcesSettings(), clientContext); + this.listSourcesPagedCallable = + callableFactory.createPagedCallable( + listSourcesTransportSettings, settings.listSourcesSettings(), clientContext); + this.runAssetDiscoveryCallable = + callableFactory.createUnaryCallable( + runAssetDiscoveryTransportSettings, + settings.runAssetDiscoverySettings(), + clientContext); + this.runAssetDiscoveryOperationCallable = + callableFactory.createOperationCallable( + runAssetDiscoveryTransportSettings, + settings.runAssetDiscoveryOperationSettings(), + clientContext, + this.operationsStub); + this.setFindingStateCallable = + callableFactory.createUnaryCallable( + setFindingStateTransportSettings, settings.setFindingStateSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + this.updateFindingCallable = + callableFactory.createUnaryCallable( + updateFindingTransportSettings, settings.updateFindingSettings(), clientContext); + this.updateNotificationConfigCallable = + callableFactory.createUnaryCallable( + updateNotificationConfigTransportSettings, + settings.updateNotificationConfigSettings(), + clientContext); + this.updateOrganizationSettingsCallable = + callableFactory.createUnaryCallable( + updateOrganizationSettingsTransportSettings, + settings.updateOrganizationSettingsSettings(), + clientContext); + this.updateSourceCallable = + callableFactory.createUnaryCallable( + updateSourceTransportSettings, settings.updateSourceSettings(), clientContext); + this.updateSecurityMarksCallable = + callableFactory.createUnaryCallable( + updateSecurityMarksTransportSettings, + settings.updateSecurityMarksSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable createSourceCallable() { + return createSourceCallable; + } + + public UnaryCallable createFindingCallable() { + return createFindingCallable; + } + + public UnaryCallable + createNotificationConfigCallable() { + return createNotificationConfigCallable; + } + + public UnaryCallable deleteNotificationConfigCallable() { + return deleteNotificationConfigCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable + getNotificationConfigCallable() { + return getNotificationConfigCallable; + } + + public UnaryCallable + getOrganizationSettingsCallable() { + return getOrganizationSettingsCallable; + } + + public UnaryCallable getSourceCallable() { + return getSourceCallable; + } + + public UnaryCallable groupAssetsPagedCallable() { + return groupAssetsPagedCallable; + } + + public UnaryCallable groupAssetsCallable() { + return groupAssetsCallable; + } + + public UnaryCallable + groupFindingsPagedCallable() { + return groupFindingsPagedCallable; + } + + public UnaryCallable groupFindingsCallable() { + return groupFindingsCallable; + } + + public UnaryCallable listAssetsPagedCallable() { + return listAssetsPagedCallable; + } + + public UnaryCallable listAssetsCallable() { + return listAssetsCallable; + } + + public UnaryCallable listFindingsPagedCallable() { + return listFindingsPagedCallable; + } + + public UnaryCallable listFindingsCallable() { + return listFindingsCallable; + } + + public UnaryCallable + listNotificationConfigsPagedCallable() { + return listNotificationConfigsPagedCallable; + } + + public UnaryCallable + listNotificationConfigsCallable() { + return listNotificationConfigsCallable; + } + + public UnaryCallable listSourcesPagedCallable() { + return listSourcesPagedCallable; + } + + public UnaryCallable listSourcesCallable() { + return listSourcesCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + runAssetDiscoveryOperationCallable() { + return runAssetDiscoveryOperationCallable; + } + + public UnaryCallable runAssetDiscoveryCallable() { + return runAssetDiscoveryCallable; + } + + public UnaryCallable setFindingStateCallable() { + return setFindingStateCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + public UnaryCallable updateFindingCallable() { + return updateFindingCallable; + } + + public UnaryCallable + updateNotificationConfigCallable() { + return updateNotificationConfigCallable; + } + + public UnaryCallable + updateOrganizationSettingsCallable() { + return updateOrganizationSettingsCallable; + } + + public UnaryCallable updateSourceCallable() { + return updateSourceCallable; + } + + public UnaryCallable updateSecurityMarksCallable() { + return updateSecurityMarksCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStub.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStub.java new file mode 100644 index 000000000..bd2517c43 --- /dev/null +++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStub.java @@ -0,0 +1,222 @@ +/* + * 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 static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListNotificationConfigsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.Finding; +import com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1p1beta1.NotificationConfig; +import com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings; +import com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; +import com.google.cloud.securitycenter.v1p1beta1.SecurityMarks; +import com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1p1beta1.Source; +import com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Security Command Center API. + * + *

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 abstract class SecurityCenterStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createSourceCallable() { + throw new UnsupportedOperationException("Not implemented: createSourceCallable()"); + } + + public UnaryCallable createFindingCallable() { + throw new UnsupportedOperationException("Not implemented: createFindingCallable()"); + } + + public UnaryCallable + createNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createNotificationConfigCallable()"); + } + + public UnaryCallable deleteNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNotificationConfigCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + getNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getNotificationConfigCallable()"); + } + + public UnaryCallable + getOrganizationSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getOrganizationSettingsCallable()"); + } + + public UnaryCallable getSourceCallable() { + throw new UnsupportedOperationException("Not implemented: getSourceCallable()"); + } + + public UnaryCallable groupAssetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: groupAssetsPagedCallable()"); + } + + public UnaryCallable groupAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: groupAssetsCallable()"); + } + + public UnaryCallable + groupFindingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: groupFindingsPagedCallable()"); + } + + public UnaryCallable groupFindingsCallable() { + throw new UnsupportedOperationException("Not implemented: groupFindingsCallable()"); + } + + public UnaryCallable listAssetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAssetsPagedCallable()"); + } + + public UnaryCallable listAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: listAssetsCallable()"); + } + + public UnaryCallable listFindingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingsPagedCallable()"); + } + + public UnaryCallable listFindingsCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingsCallable()"); + } + + public UnaryCallable + listNotificationConfigsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listNotificationConfigsPagedCallable()"); + } + + public UnaryCallable + listNotificationConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listNotificationConfigsCallable()"); + } + + public UnaryCallable listSourcesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSourcesPagedCallable()"); + } + + public UnaryCallable listSourcesCallable() { + throw new UnsupportedOperationException("Not implemented: listSourcesCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + runAssetDiscoveryOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: runAssetDiscoveryOperationCallable()"); + } + + public UnaryCallable runAssetDiscoveryCallable() { + throw new UnsupportedOperationException("Not implemented: runAssetDiscoveryCallable()"); + } + + public UnaryCallable setFindingStateCallable() { + throw new UnsupportedOperationException("Not implemented: setFindingStateCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + public UnaryCallable updateFindingCallable() { + throw new UnsupportedOperationException("Not implemented: updateFindingCallable()"); + } + + public UnaryCallable + updateNotificationConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateNotificationConfigCallable()"); + } + + public UnaryCallable + updateOrganizationSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateOrganizationSettingsCallable()"); + } + + public UnaryCallable updateSourceCallable() { + throw new UnsupportedOperationException("Not implemented: updateSourceCallable()"); + } + + public UnaryCallable updateSecurityMarksCallable() { + throw new UnsupportedOperationException("Not implemented: updateSecurityMarksCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStubSettings.java b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStubSettings.java new file mode 100644 index 000000000..b214ecae8 --- /dev/null +++ b/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1p1beta1/stub/SecurityCenterStubSettings.java @@ -0,0 +1,1319 @@ +/* + * 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 static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListNotificationConfigsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.Finding; +import com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1p1beta1.GroupResult; +import com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; +import com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1p1beta1.NotificationConfig; +import com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings; +import com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; +import com.google.cloud.securitycenter.v1p1beta1.SecurityMarks; +import com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1p1beta1.Source; +import com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SecurityCenterStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (securitycenter.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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: + * + *

+ * 
+ * SecurityCenterStubSettings.Builder securityCenterSettingsBuilder =
+ *     SecurityCenterStubSettings.newBuilder();
+ * securityCenterSettingsBuilder
+ *     .createSourceSettings()
+ *     .setRetrySettings(
+ *         securityCenterSettingsBuilder.createSourceSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SecurityCenterStubSettings securityCenterSettings = securityCenterSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SecurityCenterStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createSourceSettings; + private final UnaryCallSettings createFindingSettings; + private final UnaryCallSettings + createNotificationConfigSettings; + private final UnaryCallSettings + deleteNotificationConfigSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + getNotificationConfigSettings; + private final UnaryCallSettings + getOrganizationSettingsSettings; + private final UnaryCallSettings getSourceSettings; + private final PagedCallSettings + groupAssetsSettings; + private final PagedCallSettings< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings; + private final PagedCallSettings + listAssetsSettings; + private final PagedCallSettings< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings; + private final PagedCallSettings< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings; + private final PagedCallSettings + listSourcesSettings; + private final UnaryCallSettings runAssetDiscoverySettings; + private final OperationCallSettings + runAssetDiscoveryOperationSettings; + private final UnaryCallSettings setFindingStateSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + private final UnaryCallSettings updateFindingSettings; + private final UnaryCallSettings + updateNotificationConfigSettings; + private final UnaryCallSettings + updateOrganizationSettingsSettings; + private final UnaryCallSettings updateSourceSettings; + private final UnaryCallSettings + updateSecurityMarksSettings; + + /** Returns the object with the settings used for calls to createSource. */ + public UnaryCallSettings createSourceSettings() { + return createSourceSettings; + } + + /** Returns the object with the settings used for calls to createFinding. */ + public UnaryCallSettings createFindingSettings() { + return createFindingSettings; + } + + /** Returns the object with the settings used for calls to createNotificationConfig. */ + public UnaryCallSettings + createNotificationConfigSettings() { + return createNotificationConfigSettings; + } + + /** Returns the object with the settings used for calls to deleteNotificationConfig. */ + public UnaryCallSettings + deleteNotificationConfigSettings() { + return deleteNotificationConfigSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getNotificationConfig. */ + public UnaryCallSettings + getNotificationConfigSettings() { + return getNotificationConfigSettings; + } + + /** Returns the object with the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings + getOrganizationSettingsSettings() { + return getOrganizationSettingsSettings; + } + + /** Returns the object with the settings used for calls to getSource. */ + public UnaryCallSettings getSourceSettings() { + return getSourceSettings; + } + + /** Returns the object with the settings used for calls to groupAssets. */ + public PagedCallSettings + groupAssetsSettings() { + return groupAssetsSettings; + } + + /** Returns the object with the settings used for calls to groupFindings. */ + public PagedCallSettings + groupFindingsSettings() { + return groupFindingsSettings; + } + + /** Returns the object with the settings used for calls to listAssets. */ + public PagedCallSettings + listAssetsSettings() { + return listAssetsSettings; + } + + /** Returns the object with the settings used for calls to listFindings. */ + public PagedCallSettings + listFindingsSettings() { + return listFindingsSettings; + } + + /** Returns the object with the settings used for calls to listNotificationConfigs. */ + public PagedCallSettings< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return listNotificationConfigsSettings; + } + + /** Returns the object with the settings used for calls to listSources. */ + public PagedCallSettings + listSourcesSettings() { + return listSourcesSettings; + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings runAssetDiscoverySettings() { + return runAssetDiscoverySettings; + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + runAssetDiscoveryOperationSettings() { + return runAssetDiscoveryOperationSettings; + } + + /** Returns the object with the settings used for calls to setFindingState. */ + public UnaryCallSettings setFindingStateSettings() { + return setFindingStateSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the object with the settings used for calls to updateFinding. */ + public UnaryCallSettings updateFindingSettings() { + return updateFindingSettings; + } + + /** Returns the object with the settings used for calls to updateNotificationConfig. */ + public UnaryCallSettings + updateNotificationConfigSettings() { + return updateNotificationConfigSettings; + } + + /** Returns the object with the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings + updateOrganizationSettingsSettings() { + return updateOrganizationSettingsSettings; + } + + /** Returns the object with the settings used for calls to updateSource. */ + public UnaryCallSettings updateSourceSettings() { + return updateSourceSettings; + } + + /** Returns the object with the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings + updateSecurityMarksSettings() { + return updateSecurityMarksSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SecurityCenterStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSecurityCenterStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "securitycenter.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SecurityCenterStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SecurityCenterStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSourceSettings = settingsBuilder.createSourceSettings().build(); + createFindingSettings = settingsBuilder.createFindingSettings().build(); + createNotificationConfigSettings = settingsBuilder.createNotificationConfigSettings().build(); + deleteNotificationConfigSettings = settingsBuilder.deleteNotificationConfigSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + getNotificationConfigSettings = settingsBuilder.getNotificationConfigSettings().build(); + getOrganizationSettingsSettings = settingsBuilder.getOrganizationSettingsSettings().build(); + getSourceSettings = settingsBuilder.getSourceSettings().build(); + groupAssetsSettings = settingsBuilder.groupAssetsSettings().build(); + groupFindingsSettings = settingsBuilder.groupFindingsSettings().build(); + listAssetsSettings = settingsBuilder.listAssetsSettings().build(); + listFindingsSettings = settingsBuilder.listFindingsSettings().build(); + listNotificationConfigsSettings = settingsBuilder.listNotificationConfigsSettings().build(); + listSourcesSettings = settingsBuilder.listSourcesSettings().build(); + runAssetDiscoverySettings = settingsBuilder.runAssetDiscoverySettings().build(); + runAssetDiscoveryOperationSettings = + settingsBuilder.runAssetDiscoveryOperationSettings().build(); + setFindingStateSettings = settingsBuilder.setFindingStateSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + updateFindingSettings = settingsBuilder.updateFindingSettings().build(); + updateNotificationConfigSettings = settingsBuilder.updateNotificationConfigSettings().build(); + updateOrganizationSettingsSettings = + settingsBuilder.updateOrganizationSettingsSettings().build(); + updateSourceSettings = settingsBuilder.updateSourceSettings().build(); + updateSecurityMarksSettings = settingsBuilder.updateSecurityMarksSettings().build(); + } + + private static final PagedListDescriptor + GROUP_ASSETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public GroupAssetsRequest injectToken(GroupAssetsRequest payload, String token) { + return GroupAssetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public GroupAssetsRequest injectPageSize(GroupAssetsRequest payload, int pageSize) { + return GroupAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(GroupAssetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(GroupAssetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(GroupAssetsResponse payload) { + return payload.getGroupByResultsList() != null + ? payload.getGroupByResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + GROUP_FINDINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public GroupFindingsRequest injectToken(GroupFindingsRequest payload, String token) { + return GroupFindingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public GroupFindingsRequest injectPageSize(GroupFindingsRequest payload, int pageSize) { + return GroupFindingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(GroupFindingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(GroupFindingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(GroupFindingsResponse payload) { + return payload.getGroupByResultsList() != null + ? payload.getGroupByResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListAssetsRequest, ListAssetsResponse, ListAssetsResponse.ListAssetsResult> + LIST_ASSETS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAssetsRequest, ListAssetsResponse, ListAssetsResponse.ListAssetsResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAssetsRequest injectToken(ListAssetsRequest payload, String token) { + return ListAssetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAssetsRequest injectPageSize(ListAssetsRequest payload, int pageSize) { + return ListAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAssetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAssetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAssetsResponse payload) { + return payload.getListAssetsResultsList() != null + ? payload.getListAssetsResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + LIST_FINDINGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFindingsRequest injectToken(ListFindingsRequest payload, String token) { + return ListFindingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFindingsRequest injectPageSize(ListFindingsRequest payload, int pageSize) { + return ListFindingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFindingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFindingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListFindingsResponse payload) { + return payload.getListFindingsResultsList() != null + ? payload.getListFindingsResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListNotificationConfigsRequest, ListNotificationConfigsResponse, NotificationConfig> + LIST_NOTIFICATION_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNotificationConfigsRequest injectToken( + ListNotificationConfigsRequest payload, String token) { + return ListNotificationConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNotificationConfigsRequest injectPageSize( + ListNotificationConfigsRequest payload, int pageSize) { + return ListNotificationConfigsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListNotificationConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNotificationConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListNotificationConfigsResponse payload) { + return payload.getNotificationConfigsList() != null + ? payload.getNotificationConfigsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_SOURCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSourcesRequest injectToken(ListSourcesRequest payload, String token) { + return ListSourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSourcesRequest injectPageSize(ListSourcesRequest payload, int pageSize) { + return ListSourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSourcesResponse payload) { + return payload.getSourcesList() != null + ? payload.getSourcesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + GROUP_ASSETS_PAGE_STR_FACT = + new PagedListResponseFactory< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + GroupAssetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, GROUP_ASSETS_PAGE_STR_DESC, request, context); + return GroupAssetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + GROUP_FINDINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + GroupFindingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, GROUP_FINDINGS_PAGE_STR_DESC, request, context); + return GroupFindingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + LIST_ASSETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAssetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAssetsRequest, ListAssetsResponse, ListAssetsResponse.ListAssetsResult> + pageContext = + PageContext.create(callable, LIST_ASSETS_PAGE_STR_DESC, request, context); + return ListAssetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + LIST_FINDINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFindingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult> + pageContext = + PageContext.create(callable, LIST_FINDINGS_PAGE_STR_DESC, request, context); + return ListFindingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + LIST_NOTIFICATION_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListNotificationConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + NotificationConfig> + pageContext = + PageContext.create( + callable, LIST_NOTIFICATION_CONFIGS_PAGE_STR_DESC, request, context); + return ListNotificationConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + LIST_SOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SOURCES_PAGE_STR_DESC, request, context); + return ListSourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for SecurityCenterStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createSourceSettings; + private final UnaryCallSettings.Builder createFindingSettings; + private final UnaryCallSettings.Builder + createNotificationConfigSettings; + private final UnaryCallSettings.Builder + deleteNotificationConfigSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + getNotificationConfigSettings; + private final UnaryCallSettings.Builder + getOrganizationSettingsSettings; + private final UnaryCallSettings.Builder getSourceSettings; + private final PagedCallSettings.Builder< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + groupAssetsSettings; + private final PagedCallSettings.Builder< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings; + private final PagedCallSettings.Builder< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + listAssetsSettings; + private final PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings; + private final PagedCallSettings.Builder< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings; + private final PagedCallSettings.Builder< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + listSourcesSettings; + private final UnaryCallSettings.Builder + runAssetDiscoverySettings; + private final OperationCallSettings.Builder< + RunAssetDiscoveryRequest, RunAssetDiscoveryResponse, Empty> + runAssetDiscoveryOperationSettings; + private final UnaryCallSettings.Builder + setFindingStateSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private final UnaryCallSettings.Builder updateFindingSettings; + private final UnaryCallSettings.Builder + updateNotificationConfigSettings; + private final UnaryCallSettings.Builder + updateOrganizationSettingsSettings; + private final UnaryCallSettings.Builder updateSourceSettings; + private final UnaryCallSettings.Builder + updateSecurityMarksSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createFindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getOrganizationSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + groupAssetsSettings = PagedCallSettings.newBuilder(GROUP_ASSETS_PAGE_STR_FACT); + + groupFindingsSettings = PagedCallSettings.newBuilder(GROUP_FINDINGS_PAGE_STR_FACT); + + listAssetsSettings = PagedCallSettings.newBuilder(LIST_ASSETS_PAGE_STR_FACT); + + listFindingsSettings = PagedCallSettings.newBuilder(LIST_FINDINGS_PAGE_STR_FACT); + + listNotificationConfigsSettings = + PagedCallSettings.newBuilder(LIST_NOTIFICATION_CONFIGS_PAGE_STR_FACT); + + listSourcesSettings = PagedCallSettings.newBuilder(LIST_SOURCES_PAGE_STR_FACT); + + runAssetDiscoverySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + runAssetDiscoveryOperationSettings = OperationCallSettings.newBuilder(); + + setFindingStateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateFindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateNotificationConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateOrganizationSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateSecurityMarksSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSourceSettings, + createFindingSettings, + createNotificationConfigSettings, + deleteNotificationConfigSettings, + getIamPolicySettings, + getNotificationConfigSettings, + getOrganizationSettingsSettings, + getSourceSettings, + groupAssetsSettings, + groupFindingsSettings, + listAssetsSettings, + listFindingsSettings, + listNotificationConfigsSettings, + listSourcesSettings, + runAssetDiscoverySettings, + setFindingStateSettings, + setIamPolicySettings, + testIamPermissionsSettings, + updateFindingSettings, + updateNotificationConfigSettings, + updateOrganizationSettingsSettings, + updateSourceSettings, + updateSecurityMarksSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createFindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createNotificationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteNotificationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getNotificationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getOrganizationSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .groupAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .groupFindingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listFindingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNotificationConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listSourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .runAssetDiscoverySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setFindingStateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateFindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateNotificationConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateOrganizationSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateSecurityMarksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .runAssetDiscoveryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + RunAssetDiscoveryResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(SecurityCenterStubSettings settings) { + super(settings); + + createSourceSettings = settings.createSourceSettings.toBuilder(); + createFindingSettings = settings.createFindingSettings.toBuilder(); + createNotificationConfigSettings = settings.createNotificationConfigSettings.toBuilder(); + deleteNotificationConfigSettings = settings.deleteNotificationConfigSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + getNotificationConfigSettings = settings.getNotificationConfigSettings.toBuilder(); + getOrganizationSettingsSettings = settings.getOrganizationSettingsSettings.toBuilder(); + getSourceSettings = settings.getSourceSettings.toBuilder(); + groupAssetsSettings = settings.groupAssetsSettings.toBuilder(); + groupFindingsSettings = settings.groupFindingsSettings.toBuilder(); + listAssetsSettings = settings.listAssetsSettings.toBuilder(); + listFindingsSettings = settings.listFindingsSettings.toBuilder(); + listNotificationConfigsSettings = settings.listNotificationConfigsSettings.toBuilder(); + listSourcesSettings = settings.listSourcesSettings.toBuilder(); + runAssetDiscoverySettings = settings.runAssetDiscoverySettings.toBuilder(); + runAssetDiscoveryOperationSettings = settings.runAssetDiscoveryOperationSettings.toBuilder(); + setFindingStateSettings = settings.setFindingStateSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + updateFindingSettings = settings.updateFindingSettings.toBuilder(); + updateNotificationConfigSettings = settings.updateNotificationConfigSettings.toBuilder(); + updateOrganizationSettingsSettings = settings.updateOrganizationSettingsSettings.toBuilder(); + updateSourceSettings = settings.updateSourceSettings.toBuilder(); + updateSecurityMarksSettings = settings.updateSecurityMarksSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSourceSettings, + createFindingSettings, + createNotificationConfigSettings, + deleteNotificationConfigSettings, + getIamPolicySettings, + getNotificationConfigSettings, + getOrganizationSettingsSettings, + getSourceSettings, + groupAssetsSettings, + groupFindingsSettings, + listAssetsSettings, + listFindingsSettings, + listNotificationConfigsSettings, + listSourcesSettings, + runAssetDiscoverySettings, + setFindingStateSettings, + setIamPolicySettings, + testIamPermissionsSettings, + updateFindingSettings, + updateNotificationConfigSettings, + updateOrganizationSettingsSettings, + updateSourceSettings, + updateSecurityMarksSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSource. */ + public UnaryCallSettings.Builder createSourceSettings() { + return createSourceSettings; + } + + /** Returns the builder for the settings used for calls to createFinding. */ + public UnaryCallSettings.Builder createFindingSettings() { + return createFindingSettings; + } + + /** Returns the builder for the settings used for calls to createNotificationConfig. */ + public UnaryCallSettings.Builder + createNotificationConfigSettings() { + return createNotificationConfigSettings; + } + + /** Returns the builder for the settings used for calls to deleteNotificationConfig. */ + public UnaryCallSettings.Builder + deleteNotificationConfigSettings() { + return deleteNotificationConfigSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getNotificationConfig. */ + public UnaryCallSettings.Builder + getNotificationConfigSettings() { + return getNotificationConfigSettings; + } + + /** Returns the builder for the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings.Builder + getOrganizationSettingsSettings() { + return getOrganizationSettingsSettings; + } + + /** Returns the builder for the settings used for calls to getSource. */ + public UnaryCallSettings.Builder getSourceSettings() { + return getSourceSettings; + } + + /** Returns the builder for the settings used for calls to groupAssets. */ + public PagedCallSettings.Builder< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + groupAssetsSettings() { + return groupAssetsSettings; + } + + /** Returns the builder for the settings used for calls to groupFindings. */ + public PagedCallSettings.Builder< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings() { + return groupFindingsSettings; + } + + /** Returns the builder for the settings used for calls to listAssets. */ + public PagedCallSettings.Builder + listAssetsSettings() { + return listAssetsSettings; + } + + /** Returns the builder for the settings used for calls to listFindings. */ + public PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings() { + return listFindingsSettings; + } + + /** Returns the builder for the settings used for calls to listNotificationConfigs. */ + public PagedCallSettings.Builder< + ListNotificationConfigsRequest, + ListNotificationConfigsResponse, + ListNotificationConfigsPagedResponse> + listNotificationConfigsSettings() { + return listNotificationConfigsSettings; + } + + /** Returns the builder for the settings used for calls to listSources. */ + public PagedCallSettings.Builder< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + listSourcesSettings() { + return listSourcesSettings; + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings.Builder + runAssetDiscoverySettings() { + return runAssetDiscoverySettings; + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + runAssetDiscoveryOperationSettings() { + return runAssetDiscoveryOperationSettings; + } + + /** Returns the builder for the settings used for calls to setFindingState. */ + public UnaryCallSettings.Builder setFindingStateSettings() { + return setFindingStateSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the builder for the settings used for calls to updateFinding. */ + public UnaryCallSettings.Builder updateFindingSettings() { + return updateFindingSettings; + } + + /** Returns the builder for the settings used for calls to updateNotificationConfig. */ + public UnaryCallSettings.Builder + updateNotificationConfigSettings() { + return updateNotificationConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings.Builder + updateOrganizationSettingsSettings() { + return updateOrganizationSettingsSettings; + } + + /** Returns the builder for the settings used for calls to updateSource. */ + public UnaryCallSettings.Builder updateSourceSettings() { + return updateSourceSettings; + } + + /** Returns the builder for the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings.Builder + updateSecurityMarksSettings() { + return updateSecurityMarksSettings; + } + + @Override + public SecurityCenterStubSettings build() throws IOException { + return new SecurityCenterStubSettings(this); + } + } +} diff --git a/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenter.java b/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenter.java new file mode 100644 index 000000000..3e24d1ba4 --- /dev/null +++ b/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenter.java @@ -0,0 +1,57 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockSecurityCenter implements MockGrpcService { + private final MockSecurityCenterImpl serviceImpl; + + public MockSecurityCenter() { + serviceImpl = new MockSecurityCenterImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenterImpl.java b/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenterImpl.java new file mode 100644 index 000000000..2ae347d80 --- /dev/null +++ b/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/MockSecurityCenterImpl.java @@ -0,0 +1,411 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.securitycenter.v1p1beta1.SecurityCenterGrpc.SecurityCenterImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockSecurityCenterImpl extends SecurityCenterImplBase { + private List requests; + private Queue responses; + + public MockSecurityCenterImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createSource(CreateSourceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Source) { + requests.add(request); + responseObserver.onNext((Source) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createFinding( + CreateFindingRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createNotificationConfig( + CreateNotificationConfigRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof NotificationConfig) { + requests.add(request); + responseObserver.onNext((NotificationConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteNotificationConfig( + DeleteNotificationConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getNotificationConfig( + GetNotificationConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof NotificationConfig) { + requests.add(request); + responseObserver.onNext((NotificationConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getOrganizationSettings( + GetOrganizationSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof OrganizationSettings) { + requests.add(request); + responseObserver.onNext((OrganizationSettings) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getSource(GetSourceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Source) { + requests.add(request); + responseObserver.onNext((Source) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void groupAssets( + GroupAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GroupAssetsResponse) { + requests.add(request); + responseObserver.onNext((GroupAssetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void groupFindings( + GroupFindingsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GroupFindingsResponse) { + requests.add(request); + responseObserver.onNext((GroupFindingsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listAssets( + ListAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListAssetsResponse) { + requests.add(request); + responseObserver.onNext((ListAssetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listFindings( + ListFindingsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFindingsResponse) { + requests.add(request); + responseObserver.onNext((ListFindingsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listNotificationConfigs( + ListNotificationConfigsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListNotificationConfigsResponse) { + requests.add(request); + responseObserver.onNext((ListNotificationConfigsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listSources( + ListSourcesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListSourcesResponse) { + requests.add(request); + responseObserver.onNext((ListSourcesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void runAssetDiscovery( + RunAssetDiscoveryRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setFindingState( + SetFindingStateRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateFinding( + UpdateFindingRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateNotificationConfig( + UpdateNotificationConfigRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof NotificationConfig) { + requests.add(request); + responseObserver.onNext((NotificationConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateOrganizationSettings( + UpdateOrganizationSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof OrganizationSettings) { + requests.add(request); + responseObserver.onNext((OrganizationSettings) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateSource(UpdateSourceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Source) { + requests.add(request); + responseObserver.onNext((Source) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateSecurityMarks( + UpdateSecurityMarksRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SecurityMarks) { + requests.add(request); + responseObserver.onNext((SecurityMarks) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClientTest.java b/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClientTest.java new file mode 100644 index 000000000..15fb2e5b4 --- /dev/null +++ b/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterClientTest.java @@ -0,0 +1,1451 @@ +/* + * 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; + +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListNotificationConfigsPagedResponse; +import static com.google.cloud.securitycenter.v1p1beta1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SecurityCenterClientTest { + private static MockSecurityCenter mockSecurityCenter; + private static MockServiceHelper serviceHelper; + private SecurityCenterClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockSecurityCenter = new MockSecurityCenter(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSecurityCenter)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + SecurityCenterSettings settings = + SecurityCenterSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SecurityCenterClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createSourceTest() { + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + Source source = Source.newBuilder().build(); + + Source actualResponse = client.createSource(parent, source); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSourceRequest actualRequest = (CreateSourceRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + Source source = Source.newBuilder().build(); + + client.createSource(parent, source); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createFindingTest() { + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + String parent2 = "parent21175163357"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name.toString()) + .setParent(parent2) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String findingId = "findingId728776081"; + Finding finding = Finding.newBuilder().build(); + + Finding actualResponse = client.createFinding(parent, findingId, finding); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFindingRequest actualRequest = (CreateFindingRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SourceName.parse(actualRequest.getParent())); + Assert.assertEquals(findingId, actualRequest.getFindingId()); + Assert.assertEquals(finding, actualRequest.getFinding()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createFindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String findingId = "findingId728776081"; + Finding finding = Finding.newBuilder().build(); + + client.createFinding(parent, findingId, finding); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createNotificationConfigTest() { + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + String description = "description-1724546052"; + TopicName pubsubTopic = TopicName.of("[PROJECT]", "[TOPIC]"); + String serviceAccount = "serviceAccount-1948028253"; + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setPubsubTopic(pubsubTopic.toString()) + .setServiceAccount(serviceAccount) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + String configId = "configId-804450504"; + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + NotificationConfig actualResponse = + client.createNotificationConfig(parent, configId, notificationConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNotificationConfigRequest actualRequest = + (CreateNotificationConfigRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertEquals(configId, actualRequest.getConfigId()); + Assert.assertEquals(notificationConfig, actualRequest.getNotificationConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createNotificationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + String configId = "configId-804450504"; + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + client.createNotificationConfig(parent, configId, notificationConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createNotificationConfigTest2() { + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + String description = "description-1724546052"; + TopicName pubsubTopic = TopicName.of("[PROJECT]", "[TOPIC]"); + String serviceAccount = "serviceAccount-1948028253"; + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setPubsubTopic(pubsubTopic.toString()) + .setServiceAccount(serviceAccount) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + NotificationConfig actualResponse = client.createNotificationConfig(parent, notificationConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNotificationConfigRequest actualRequest = + (CreateNotificationConfigRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertEquals(notificationConfig, actualRequest.getNotificationConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createNotificationConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + client.createNotificationConfig(parent, notificationConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteNotificationConfigTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockSecurityCenter.addResponse(expectedResponse); + + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + + client.deleteNotificationConfig(name); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNotificationConfigRequest actualRequest = + (DeleteNotificationConfigRequest) actualRequests.get(0); + + Assert.assertEquals(name, NotificationConfigName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteNotificationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + + client.deleteNotificationConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockSecurityCenter.addResponse(expectedResponse); + + ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]"); + + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNotificationConfigTest() { + NotificationConfigName name2 = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + String description = "description-1724546052"; + TopicName pubsubTopic = TopicName.of("[PROJECT]", "[TOPIC]"); + String serviceAccount = "serviceAccount-1948028253"; + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setPubsubTopic(pubsubTopic.toString()) + .setServiceAccount(serviceAccount) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + + NotificationConfig actualResponse = client.getNotificationConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNotificationConfigRequest actualRequest = + (GetNotificationConfigRequest) actualRequests.get(0); + + Assert.assertEquals(name, NotificationConfigName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getNotificationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + + client.getNotificationConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getOrganizationSettingsTest() { + OrganizationSettingsName name2 = OrganizationSettingsName.of("[ORGANIZATION]"); + boolean enableAssetDiscovery = false; + OrganizationSettings expectedResponse = + OrganizationSettings.newBuilder() + .setName(name2.toString()) + .setEnableAssetDiscovery(enableAssetDiscovery) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]"); + + OrganizationSettings actualResponse = client.getOrganizationSettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationSettingsRequest actualRequest = + (GetOrganizationSettingsRequest) actualRequests.get(0); + + Assert.assertEquals(name, OrganizationSettingsName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getOrganizationSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]"); + + client.getOrganizationSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSourceTest() { + SourceName name2 = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + Source actualResponse = client.getSource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSourceRequest actualRequest = (GetSourceRequest) actualRequests.get(0); + + Assert.assertEquals(name, SourceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + client.getSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void groupAssetsTest() { + String nextPageToken = ""; + int totalSize = 705419236; + GroupResult groupByResultsElement = GroupResult.newBuilder().build(); + List groupByResults = Arrays.asList(groupByResultsElement); + GroupAssetsResponse expectedResponse = + GroupAssetsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .setTotalSize(totalSize) + .addAllGroupByResults(groupByResults) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + String groupBy = "groupBy506361367"; + GroupAssetsRequest request = + GroupAssetsRequest.newBuilder().setParent(parent.toString()).setGroupBy(groupBy).build(); + + GroupAssetsPagedResponse pagedListResponse = client.groupAssets(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getGroupByResultsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GroupAssetsRequest actualRequest = (GroupAssetsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertEquals(groupBy, actualRequest.getGroupBy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void groupAssetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + String groupBy = "groupBy506361367"; + GroupAssetsRequest request = + GroupAssetsRequest.newBuilder().setParent(parent.toString()).setGroupBy(groupBy).build(); + + client.groupAssets(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void groupFindingsTest() { + String nextPageToken = ""; + int totalSize = 705419236; + GroupResult groupByResultsElement = GroupResult.newBuilder().build(); + List groupByResults = Arrays.asList(groupByResultsElement); + GroupFindingsResponse expectedResponse = + GroupFindingsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .setTotalSize(totalSize) + .addAllGroupByResults(groupByResults) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String groupBy = "groupBy506361367"; + + GroupFindingsPagedResponse pagedListResponse = client.groupFindings(parent, groupBy); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getGroupByResultsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GroupFindingsRequest actualRequest = (GroupFindingsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SourceName.parse(actualRequest.getParent())); + Assert.assertEquals(groupBy, actualRequest.getGroupBy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void groupFindingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String groupBy = "groupBy506361367"; + + client.groupFindings(parent, groupBy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listAssetsTest() { + String nextPageToken = ""; + int totalSize = 705419236; + ListAssetsResponse.ListAssetsResult listAssetsResultsElement = + ListAssetsResponse.ListAssetsResult.newBuilder().build(); + List listAssetsResults = + Arrays.asList(listAssetsResultsElement); + ListAssetsResponse expectedResponse = + ListAssetsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .setTotalSize(totalSize) + .addAllListAssetsResults(listAssetsResults) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListAssetsPagedResponse pagedListResponse = client.listAssets(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getListAssetsResultsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAssetsRequest actualRequest = (ListAssetsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listAssetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + client.listAssets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listFindingsTest() { + String nextPageToken = ""; + int totalSize = 705419236; + ListFindingsResponse.ListFindingsResult listFindingsResultsElement = + ListFindingsResponse.ListFindingsResult.newBuilder().build(); + List listFindingsResults = + Arrays.asList(listFindingsResultsElement); + ListFindingsResponse expectedResponse = + ListFindingsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .setTotalSize(totalSize) + .addAllListFindingsResults(listFindingsResults) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + ListFindingsPagedResponse pagedListResponse = client.listFindings(parent); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getListFindingsResultsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFindingsRequest actualRequest = (ListFindingsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SourceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listFindingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + client.listFindings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNotificationConfigsTest() { + String nextPageToken = ""; + NotificationConfig notificationConfigsElement = NotificationConfig.newBuilder().build(); + List notificationConfigs = Arrays.asList(notificationConfigsElement); + ListNotificationConfigsResponse expectedResponse = + ListNotificationConfigsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllNotificationConfigs(notificationConfigs) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListNotificationConfigsPagedResponse pagedListResponse = client.listNotificationConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNotificationConfigsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNotificationConfigsRequest actualRequest = + (ListNotificationConfigsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listNotificationConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + client.listNotificationConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSourcesTest() { + String nextPageToken = ""; + Source sourcesElement = Source.newBuilder().build(); + List sources = Arrays.asList(sourcesElement); + ListSourcesResponse expectedResponse = + ListSourcesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllSources(sources) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListSourcesPagedResponse pagedListResponse = client.listSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSourcesList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSourcesRequest actualRequest = (ListSourcesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listSourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + client.listSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void runAssetDiscoveryTest() throws Exception { + RunAssetDiscoveryResponse expectedResponse = RunAssetDiscoveryResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("runAssetDiscoveryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityCenter.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + RunAssetDiscoveryResponse actualResponse = client.runAssetDiscoveryAsync(parent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RunAssetDiscoveryRequest actualRequest = (RunAssetDiscoveryRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void runAssetDiscoveryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + client.runAssetDiscoveryAsync(parent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void setFindingStateTest() { + FindingName name2 = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + String parent = "parent-995424086"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name2.toString()) + .setParent(parent) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + Finding.State state = Finding.State.STATE_UNSPECIFIED; + Timestamp startTime = Timestamp.newBuilder().build(); + + Finding actualResponse = client.setFindingState(name, state, startTime); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetFindingStateRequest actualRequest = (SetFindingStateRequest) actualRequests.get(0); + + Assert.assertEquals(name, FindingName.parse(actualRequest.getName())); + Assert.assertEquals(state, actualRequest.getState()); + Assert.assertEquals(startTime, actualRequest.getStartTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setFindingStateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + Finding.State state = Finding.State.STATE_UNSPECIFIED; + Timestamp startTime = Timestamp.newBuilder().build(); + + client.setFindingState(name, state, startTime); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockSecurityCenter.addResponse(expectedResponse); + + ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockSecurityCenter.addResponse(expectedResponse); + + ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + ResourceName resource = AssetName.of("[ORGANIZATION]", "[ASSET]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateFindingTest() { + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + String parent = "parent-995424086"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name.toString()) + .setParent(parent) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + Finding finding = Finding.newBuilder().build(); + + Finding actualResponse = client.updateFinding(finding); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFindingRequest actualRequest = (UpdateFindingRequest) actualRequests.get(0); + + Assert.assertEquals(finding, actualRequest.getFinding()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateFindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + Finding finding = Finding.newBuilder().build(); + + client.updateFinding(finding); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateFindingTest2() { + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + String parent = "parent-995424086"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name.toString()) + .setParent(parent) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + Finding finding = Finding.newBuilder().build(); + + Finding actualResponse = client.updateFinding(finding); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFindingRequest actualRequest = (UpdateFindingRequest) actualRequests.get(0); + + Assert.assertEquals(finding, actualRequest.getFinding()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateFindingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + Finding finding = Finding.newBuilder().build(); + + client.updateFinding(finding); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateNotificationConfigTest() { + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + String description = "description-1724546052"; + TopicName pubsubTopic = TopicName.of("[PROJECT]", "[TOPIC]"); + String serviceAccount = "serviceAccount-1948028253"; + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setPubsubTopic(pubsubTopic.toString()) + .setServiceAccount(serviceAccount) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + NotificationConfig actualResponse = client.updateNotificationConfig(notificationConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateNotificationConfigRequest actualRequest = + (UpdateNotificationConfigRequest) actualRequests.get(0); + + Assert.assertEquals(notificationConfig, actualRequest.getNotificationConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateNotificationConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + client.updateNotificationConfig(notificationConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateNotificationConfigTest2() { + NotificationConfigName name = + NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); + String description = "description-1724546052"; + TopicName pubsubTopic = TopicName.of("[PROJECT]", "[TOPIC]"); + String serviceAccount = "serviceAccount-1948028253"; + NotificationConfig expectedResponse = + NotificationConfig.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setPubsubTopic(pubsubTopic.toString()) + .setServiceAccount(serviceAccount) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + NotificationConfig actualResponse = client.updateNotificationConfig(notificationConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateNotificationConfigRequest actualRequest = + (UpdateNotificationConfigRequest) actualRequests.get(0); + + Assert.assertEquals(notificationConfig, actualRequest.getNotificationConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateNotificationConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); + + client.updateNotificationConfig(notificationConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateOrganizationSettingsTest() { + OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]"); + boolean enableAssetDiscovery = false; + OrganizationSettings expectedResponse = + OrganizationSettings.newBuilder() + .setName(name.toString()) + .setEnableAssetDiscovery(enableAssetDiscovery) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build(); + + OrganizationSettings actualResponse = client.updateOrganizationSettings(organizationSettings); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateOrganizationSettingsRequest actualRequest = + (UpdateOrganizationSettingsRequest) actualRequests.get(0); + + Assert.assertEquals(organizationSettings, actualRequest.getOrganizationSettings()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateOrganizationSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build(); + + client.updateOrganizationSettings(organizationSettings); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSourceTest() { + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + Source source = Source.newBuilder().build(); + + Source actualResponse = client.updateSource(source); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSourceRequest actualRequest = (UpdateSourceRequest) actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + Source source = Source.newBuilder().build(); + + client.updateSource(source); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSourceTest2() { + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + Source source = Source.newBuilder().build(); + + Source actualResponse = client.updateSource(source); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSourceRequest actualRequest = (UpdateSourceRequest) actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + Source source = Source.newBuilder().build(); + + client.updateSource(source); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSecurityMarksTest() { + String name = "name3373707"; + SecurityMarks expectedResponse = SecurityMarks.newBuilder().setName(name.toString()).build(); + mockSecurityCenter.addResponse(expectedResponse); + + SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); + + SecurityMarks actualResponse = client.updateSecurityMarks(securityMarks); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSecurityMarksRequest actualRequest = (UpdateSecurityMarksRequest) actualRequests.get(0); + + Assert.assertEquals(securityMarks, actualRequest.getSecurityMarks()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSecurityMarksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); + + client.updateSecurityMarks(securityMarks); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSecurityMarksTest2() { + String name = "name3373707"; + SecurityMarks expectedResponse = SecurityMarks.newBuilder().setName(name.toString()).build(); + mockSecurityCenter.addResponse(expectedResponse); + + SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); + + SecurityMarks actualResponse = client.updateSecurityMarks(securityMarks); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSecurityMarksRequest actualRequest = (UpdateSecurityMarksRequest) actualRequests.get(0); + + Assert.assertEquals(securityMarks, actualRequest.getSecurityMarks()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSecurityMarksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); + + client.updateSecurityMarks(securityMarks); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/grpc-google-cloud-securitycenter-v1p1beta1/pom.xml b/grpc-google-cloud-securitycenter-v1p1beta1/pom.xml new file mode 100644 index 000000000..c52814244 --- /dev/null +++ b/grpc-google-cloud-securitycenter-v1p1beta1/pom.xml @@ -0,0 +1,64 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-securitycenter-v1p1beta1 + 0.83.2-SNAPSHOT + grpc-google-cloud-securitycenter-v1p1beta1 + GRPC library for grpc-google-cloud-securitycenter-v1p1beta1 + + com.google.cloud + google-cloud-securitycenter-parent + 0.118.2-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-securitycenter-v1p1beta1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + proto-google-common-protos + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterGrpc.java b/grpc-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterGrpc.java new file mode 100644 index 000000000..d80b0452a --- /dev/null +++ b/grpc-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityCenterGrpc.java @@ -0,0 +1,3336 @@ +/* + * 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; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * V1p1Beta1 APIs for Security Center service.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto") +public final class SecurityCenterGrpc { + + private SecurityCenterGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.securitycenter.v1p1beta1.SecurityCenter"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateSourceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + METHOD_CREATE_SOURCE = getCreateSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getCreateSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getCreateSourceMethod() { + return getCreateSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getCreateSourceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getCreateSourceMethod; + if ((getCreateSourceMethod = SecurityCenterGrpc.getCreateSourceMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getCreateSourceMethod = SecurityCenterGrpc.getCreateSourceMethod) == null) { + SecurityCenterGrpc.getCreateSourceMethod = + getCreateSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "CreateSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.Source + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("CreateSource")) + .build(); + } + } + } + return getCreateSourceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateFindingMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + METHOD_CREATE_FINDING = getCreateFindingMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getCreateFindingMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getCreateFindingMethod() { + return getCreateFindingMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getCreateFindingMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getCreateFindingMethod; + if ((getCreateFindingMethod = SecurityCenterGrpc.getCreateFindingMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getCreateFindingMethod = SecurityCenterGrpc.getCreateFindingMethod) == null) { + SecurityCenterGrpc.getCreateFindingMethod = + getCreateFindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "CreateFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.Finding + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("CreateFinding")) + .build(); + } + } + } + return getCreateFindingMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateNotificationConfigMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + METHOD_CREATE_NOTIFICATION_CONFIG = getCreateNotificationConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getCreateNotificationConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getCreateNotificationConfigMethod() { + return getCreateNotificationConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getCreateNotificationConfigMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getCreateNotificationConfigMethod; + if ((getCreateNotificationConfigMethod = SecurityCenterGrpc.getCreateNotificationConfigMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getCreateNotificationConfigMethod = + SecurityCenterGrpc.getCreateNotificationConfigMethod) + == null) { + SecurityCenterGrpc.getCreateNotificationConfigMethod = + getCreateNotificationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "CreateNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .CreateNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("CreateNotificationConfig")) + .build(); + } + } + } + return getCreateNotificationConfigMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteNotificationConfigMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, + com.google.protobuf.Empty> + METHOD_DELETE_NOTIFICATION_CONFIG = getDeleteNotificationConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, + com.google.protobuf.Empty> + getDeleteNotificationConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, + com.google.protobuf.Empty> + getDeleteNotificationConfigMethod() { + return getDeleteNotificationConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, + com.google.protobuf.Empty> + getDeleteNotificationConfigMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, + com.google.protobuf.Empty> + getDeleteNotificationConfigMethod; + if ((getDeleteNotificationConfigMethod = SecurityCenterGrpc.getDeleteNotificationConfigMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getDeleteNotificationConfigMethod = + SecurityCenterGrpc.getDeleteNotificationConfigMethod) + == null) { + SecurityCenterGrpc.getDeleteNotificationConfigMethod = + getDeleteNotificationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "DeleteNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .DeleteNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("DeleteNotificationConfig")) + .build(); + } + } + } + return getDeleteNotificationConfigMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetIamPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + METHOD_GET_IAM_POLICY = getGetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + return getGetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = SecurityCenterGrpc.getGetIamPolicyMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetIamPolicyMethod = SecurityCenterGrpc.getGetIamPolicyMethod) == null) { + SecurityCenterGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetNotificationConfigMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + METHOD_GET_NOTIFICATION_CONFIG = getGetNotificationConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getGetNotificationConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getGetNotificationConfigMethod() { + return getGetNotificationConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getGetNotificationConfigMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getGetNotificationConfigMethod; + if ((getGetNotificationConfigMethod = SecurityCenterGrpc.getGetNotificationConfigMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetNotificationConfigMethod = SecurityCenterGrpc.getGetNotificationConfigMethod) + == null) { + SecurityCenterGrpc.getGetNotificationConfigMethod = + getGetNotificationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "GetNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GetNotificationConfig")) + .build(); + } + } + } + return getGetNotificationConfigMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetOrganizationSettingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + METHOD_GET_ORGANIZATION_SETTINGS = getGetOrganizationSettingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getGetOrganizationSettingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getGetOrganizationSettingsMethod() { + return getGetOrganizationSettingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getGetOrganizationSettingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getGetOrganizationSettingsMethod; + if ((getGetOrganizationSettingsMethod = SecurityCenterGrpc.getGetOrganizationSettingsMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetOrganizationSettingsMethod = SecurityCenterGrpc.getGetOrganizationSettingsMethod) + == null) { + SecurityCenterGrpc.getGetOrganizationSettingsMethod = + getGetOrganizationSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "GetOrganizationSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .GetOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GetOrganizationSettings")) + .build(); + } + } + } + return getGetOrganizationSettingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetSourceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + METHOD_GET_SOURCE = getGetSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getGetSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getGetSourceMethod() { + return getGetSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getGetSourceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getGetSourceMethod; + if ((getGetSourceMethod = SecurityCenterGrpc.getGetSourceMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetSourceMethod = SecurityCenterGrpc.getGetSourceMethod) == null) { + SecurityCenterGrpc.getGetSourceMethod = + getGetSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", "GetSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.Source + .getDefaultInstance())) + .setSchemaDescriptor(new SecurityCenterMethodDescriptorSupplier("GetSource")) + .build(); + } + } + } + return getGetSourceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGroupAssetsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse> + METHOD_GROUP_ASSETS = getGroupAssetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse> + getGroupAssetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse> + getGroupAssetsMethod() { + return getGroupAssetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse> + getGroupAssetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse> + getGroupAssetsMethod; + if ((getGroupAssetsMethod = SecurityCenterGrpc.getGroupAssetsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGroupAssetsMethod = SecurityCenterGrpc.getGroupAssetsMethod) == null) { + SecurityCenterGrpc.getGroupAssetsMethod = + getGroupAssetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "GroupAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GroupAssets")) + .build(); + } + } + } + return getGroupAssetsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGroupFindingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse> + METHOD_GROUP_FINDINGS = getGroupFindingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse> + getGroupFindingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse> + getGroupFindingsMethod() { + return getGroupFindingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse> + getGroupFindingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse> + getGroupFindingsMethod; + if ((getGroupFindingsMethod = SecurityCenterGrpc.getGroupFindingsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGroupFindingsMethod = SecurityCenterGrpc.getGroupFindingsMethod) == null) { + SecurityCenterGrpc.getGroupFindingsMethod = + getGroupFindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "GroupFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GroupFindings")) + .build(); + } + } + } + return getGroupFindingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListAssetsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse> + METHOD_LIST_ASSETS = getListAssetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse> + getListAssetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse> + getListAssetsMethod() { + return getListAssetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse> + getListAssetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse> + getListAssetsMethod; + if ((getListAssetsMethod = SecurityCenterGrpc.getListAssetsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListAssetsMethod = SecurityCenterGrpc.getListAssetsMethod) == null) { + SecurityCenterGrpc.getListAssetsMethod = + getListAssetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", "ListAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SecurityCenterMethodDescriptorSupplier("ListAssets")) + .build(); + } + } + } + return getListAssetsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListFindingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse> + METHOD_LIST_FINDINGS = getListFindingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse> + getListFindingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse> + getListFindingsMethod() { + return getListFindingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse> + getListFindingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse> + getListFindingsMethod; + if ((getListFindingsMethod = SecurityCenterGrpc.getListFindingsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListFindingsMethod = SecurityCenterGrpc.getListFindingsMethod) == null) { + SecurityCenterGrpc.getListFindingsMethod = + getListFindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "ListFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("ListFindings")) + .build(); + } + } + } + return getListFindingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListNotificationConfigsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + METHOD_LIST_NOTIFICATION_CONFIGS = getListNotificationConfigsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + getListNotificationConfigsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + getListNotificationConfigsMethod() { + return getListNotificationConfigsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + getListNotificationConfigsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + getListNotificationConfigsMethod; + if ((getListNotificationConfigsMethod = SecurityCenterGrpc.getListNotificationConfigsMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListNotificationConfigsMethod = SecurityCenterGrpc.getListNotificationConfigsMethod) + == null) { + SecurityCenterGrpc.getListNotificationConfigsMethod = + getListNotificationConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "ListNotificationConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .ListNotificationConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .ListNotificationConfigsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("ListNotificationConfigs")) + .build(); + } + } + } + return getListNotificationConfigsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListSourcesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse> + METHOD_LIST_SOURCES = getListSourcesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse> + getListSourcesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse> + getListSourcesMethod() { + return getListSourcesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse> + getListSourcesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse> + getListSourcesMethod; + if ((getListSourcesMethod = SecurityCenterGrpc.getListSourcesMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListSourcesMethod = SecurityCenterGrpc.getListSourcesMethod) == null) { + SecurityCenterGrpc.getListSourcesMethod = + getListSourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "ListSources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("ListSources")) + .build(); + } + } + } + return getListSourcesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRunAssetDiscoveryMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + METHOD_RUN_ASSET_DISCOVERY = getRunAssetDiscoveryMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethod() { + return getRunAssetDiscoveryMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethod; + if ((getRunAssetDiscoveryMethod = SecurityCenterGrpc.getRunAssetDiscoveryMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getRunAssetDiscoveryMethod = SecurityCenterGrpc.getRunAssetDiscoveryMethod) == null) { + SecurityCenterGrpc.getRunAssetDiscoveryMethod = + getRunAssetDiscoveryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "RunAssetDiscovery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("RunAssetDiscovery")) + .build(); + } + } + } + return getRunAssetDiscoveryMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSetFindingStateMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + METHOD_SET_FINDING_STATE = getSetFindingStateMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getSetFindingStateMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getSetFindingStateMethod() { + return getSetFindingStateMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getSetFindingStateMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getSetFindingStateMethod; + if ((getSetFindingStateMethod = SecurityCenterGrpc.getSetFindingStateMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getSetFindingStateMethod = SecurityCenterGrpc.getSetFindingStateMethod) == null) { + SecurityCenterGrpc.getSetFindingStateMethod = + getSetFindingStateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "SetFindingState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.Finding + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("SetFindingState")) + .build(); + } + } + } + return getSetFindingStateMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSetIamPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + METHOD_SET_IAM_POLICY = getSetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + return getSetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = SecurityCenterGrpc.getSetIamPolicyMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getSetIamPolicyMethod = SecurityCenterGrpc.getSetIamPolicyMethod) == null) { + SecurityCenterGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getTestIamPermissionsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + METHOD_TEST_IAM_PERMISSIONS = getTestIamPermissionsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + return getTestIamPermissionsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = SecurityCenterGrpc.getTestIamPermissionsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getTestIamPermissionsMethod = SecurityCenterGrpc.getTestIamPermissionsMethod) + == null) { + SecurityCenterGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateFindingMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + METHOD_UPDATE_FINDING = getUpdateFindingMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getUpdateFindingMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getUpdateFindingMethod() { + return getUpdateFindingMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getUpdateFindingMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding> + getUpdateFindingMethod; + if ((getUpdateFindingMethod = SecurityCenterGrpc.getUpdateFindingMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateFindingMethod = SecurityCenterGrpc.getUpdateFindingMethod) == null) { + SecurityCenterGrpc.getUpdateFindingMethod = + getUpdateFindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "UpdateFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.Finding + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateFinding")) + .build(); + } + } + } + return getUpdateFindingMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateNotificationConfigMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + METHOD_UPDATE_NOTIFICATION_CONFIG = getUpdateNotificationConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getUpdateNotificationConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getUpdateNotificationConfigMethod() { + return getUpdateNotificationConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getUpdateNotificationConfigMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getUpdateNotificationConfigMethod; + if ((getUpdateNotificationConfigMethod = SecurityCenterGrpc.getUpdateNotificationConfigMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateNotificationConfigMethod = + SecurityCenterGrpc.getUpdateNotificationConfigMethod) + == null) { + SecurityCenterGrpc.getUpdateNotificationConfigMethod = + getUpdateNotificationConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "UpdateNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .UpdateNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateNotificationConfig")) + .build(); + } + } + } + return getUpdateNotificationConfigMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateOrganizationSettingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + METHOD_UPDATE_ORGANIZATION_SETTINGS = getUpdateOrganizationSettingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getUpdateOrganizationSettingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getUpdateOrganizationSettingsMethod() { + return getUpdateOrganizationSettingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getUpdateOrganizationSettingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getUpdateOrganizationSettingsMethod; + if ((getUpdateOrganizationSettingsMethod = + SecurityCenterGrpc.getUpdateOrganizationSettingsMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateOrganizationSettingsMethod = + SecurityCenterGrpc.getUpdateOrganizationSettingsMethod) + == null) { + SecurityCenterGrpc.getUpdateOrganizationSettingsMethod = + getUpdateOrganizationSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "UpdateOrganizationSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1 + .UpdateOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateOrganizationSettings")) + .build(); + } + } + } + return getUpdateOrganizationSettingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateSourceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + METHOD_UPDATE_SOURCE = getUpdateSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getUpdateSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getUpdateSourceMethod() { + return getUpdateSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getUpdateSourceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source> + getUpdateSourceMethod; + if ((getUpdateSourceMethod = SecurityCenterGrpc.getUpdateSourceMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateSourceMethod = SecurityCenterGrpc.getUpdateSourceMethod) == null) { + SecurityCenterGrpc.getUpdateSourceMethod = + getUpdateSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "UpdateSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.Source + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateSource")) + .build(); + } + } + } + return getUpdateSourceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateSecurityMarksMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks> + METHOD_UPDATE_SECURITY_MARKS = getUpdateSecurityMarksMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks> + getUpdateSecurityMarksMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks> + getUpdateSecurityMarksMethod() { + return getUpdateSecurityMarksMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks> + getUpdateSecurityMarksMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks> + getUpdateSecurityMarksMethod; + if ((getUpdateSecurityMarksMethod = SecurityCenterGrpc.getUpdateSecurityMarksMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateSecurityMarksMethod = SecurityCenterGrpc.getUpdateSecurityMarksMethod) + == null) { + SecurityCenterGrpc.getUpdateSecurityMarksMethod = + getUpdateSecurityMarksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1p1beta1.SecurityCenter", + "UpdateSecurityMarks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateSecurityMarks")) + .build(); + } + } + } + return getUpdateSecurityMarksMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SecurityCenterStub newStub(io.grpc.Channel channel) { + return new SecurityCenterStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SecurityCenterBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new SecurityCenterBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SecurityCenterFutureStub newFutureStub(io.grpc.Channel channel) { + return new SecurityCenterFutureStub(channel); + } + + /** + * + * + *
+   * V1p1Beta1 APIs for Security Center service.
+   * 
+ */ + public abstract static class SecurityCenterImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public void createSource( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateSourceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding
+     * creation to succeed.
+     * 
+ */ + public void createFinding( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateFindingMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a notification config.
+     * 
+ */ + public void createNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateNotificationConfigMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a notification config.
+     * 
+ */ + public void deleteNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteNotificationConfigMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIamPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a notification config.
+     * 
+ */ + public void getNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetNotificationConfigMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public void getOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetOrganizationSettingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public void getSource( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetSourceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public void groupAssets( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGroupAssetsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public void groupFindings( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGroupFindingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public void listAssets( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListAssetsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public void listFindings( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListFindingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists notification configs.
+     * 
+ */ + public void listNotificationConfigs( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListNotificationConfigsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public void listSources( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListSourcesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This 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.
+     * 
+ */ + public void runAssetDiscovery( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRunAssetDiscoveryMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public void setFindingState( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getSetFindingStateMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetIamPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getTestIamPermissionsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public void updateFinding( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateFindingMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a notification config.
+     * 
+ */ + public void updateNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateNotificationConfigMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public void updateOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateOrganizationSettingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public void updateSource( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSourceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public void updateSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSecurityMarksMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source>( + this, METHODID_CREATE_SOURCE))) + .addMethod( + getCreateFindingMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding>( + this, METHODID_CREATE_FINDING))) + .addMethod( + getCreateNotificationConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>( + this, METHODID_CREATE_NOTIFICATION_CONFIG))) + .addMethod( + getDeleteNotificationConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_NOTIFICATION_CONFIG))) + .addMethod( + getGetIamPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getGetNotificationConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>( + this, METHODID_GET_NOTIFICATION_CONFIG))) + .addMethod( + getGetOrganizationSettingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings>( + this, METHODID_GET_ORGANIZATION_SETTINGS))) + .addMethod( + getGetSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source>(this, METHODID_GET_SOURCE))) + .addMethod( + getGroupAssetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse>( + this, METHODID_GROUP_ASSETS))) + .addMethod( + getGroupFindingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse>( + this, METHODID_GROUP_FINDINGS))) + .addMethod( + getListAssetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse>( + this, METHODID_LIST_ASSETS))) + .addMethod( + getListFindingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse>( + this, METHODID_LIST_FINDINGS))) + .addMethod( + getListNotificationConfigsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse>( + this, METHODID_LIST_NOTIFICATION_CONFIGS))) + .addMethod( + getListSourcesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse>( + this, METHODID_LIST_SOURCES))) + .addMethod( + getRunAssetDiscoveryMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation>(this, METHODID_RUN_ASSET_DISCOVERY))) + .addMethod( + getSetFindingStateMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding>( + this, METHODID_SET_FINDING_STATE))) + .addMethod( + getSetIamPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .addMethod( + getUpdateFindingMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1p1beta1.Finding>( + this, METHODID_UPDATE_FINDING))) + .addMethod( + getUpdateNotificationConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>( + this, METHODID_UPDATE_NOTIFICATION_CONFIG))) + .addMethod( + getUpdateOrganizationSettingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings>( + this, METHODID_UPDATE_ORGANIZATION_SETTINGS))) + .addMethod( + getUpdateSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1p1beta1.Source>( + this, METHODID_UPDATE_SOURCE))) + .addMethod( + getUpdateSecurityMarksMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks>( + this, METHODID_UPDATE_SECURITY_MARKS))) + .build(); + } + } + + /** + * + * + *
+   * V1p1Beta1 APIs for Security Center service.
+   * 
+ */ + public static final class SecurityCenterStub + extends io.grpc.stub.AbstractStub { + private SecurityCenterStub(io.grpc.Channel channel) { + super(channel); + } + + private SecurityCenterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityCenterStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityCenterStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public void createSource( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateSourceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding
+     * creation to succeed.
+     * 
+ */ + public void createFinding( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateFindingMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a notification config.
+     * 
+ */ + public void createNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateNotificationConfigMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a notification config.
+     * 
+ */ + public void deleteNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteNotificationConfigMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a notification config.
+     * 
+ */ + public void getNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetNotificationConfigMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public void getOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetOrganizationSettingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public void getSource( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetSourceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public void groupAssets( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGroupAssetsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public void groupFindings( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGroupFindingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public void listAssets( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListAssetsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public void listFindings( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFindingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists notification configs.
+     * 
+ */ + public void listNotificationConfigs( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListNotificationConfigsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public void listSources( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListSourcesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This 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.
+     * 
+ */ + public void runAssetDiscovery( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRunAssetDiscoveryMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public void setFindingState( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetFindingStateMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public void updateFinding( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateFindingMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a notification config.
+     * 
+ */ + public void updateNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateNotificationConfigMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public void updateOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateOrganizationSettingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public void updateSource( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSourceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public void updateSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSecurityMarksMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * V1p1Beta1 APIs for Security Center service.
+   * 
+ */ + public static final class SecurityCenterBlockingStub + extends io.grpc.stub.AbstractStub { + private SecurityCenterBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private SecurityCenterBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityCenterBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityCenterBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.Source createSource( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest request) { + return blockingUnaryCall( + getChannel(), getCreateSourceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding
+     * creation to succeed.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.Finding createFinding( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest request) { + return blockingUnaryCall( + getChannel(), getCreateFindingMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a notification config.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig createNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest request) { + return blockingUnaryCall( + getChannel(), getCreateNotificationConfigMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a notification config.
+     * 
+ */ + public com.google.protobuf.Empty deleteNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteNotificationConfigMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getGetIamPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a notification config.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest request) { + return blockingUnaryCall( + getChannel(), getGetNotificationConfigMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings getOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest request) { + return blockingUnaryCall( + getChannel(), getGetOrganizationSettingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSource( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest request) { + return blockingUnaryCall(getChannel(), getGetSourceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse groupAssets( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest request) { + return blockingUnaryCall( + getChannel(), getGroupAssetsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse groupFindings( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest request) { + return blockingUnaryCall( + getChannel(), getGroupFindingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse listAssets( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest request) { + return blockingUnaryCall( + getChannel(), getListAssetsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse listFindings( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest request) { + return blockingUnaryCall( + getChannel(), getListFindingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists notification configs.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + listNotificationConfigs( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest request) { + return blockingUnaryCall( + getChannel(), getListNotificationConfigsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse listSources( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest request) { + return blockingUnaryCall( + getChannel(), getListSourcesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This 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.
+     * 
+ */ + public com.google.longrunning.Operation runAssetDiscovery( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest request) { + return blockingUnaryCall( + getChannel(), getRunAssetDiscoveryMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.Finding setFindingState( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest request) { + return blockingUnaryCall( + getChannel(), getSetFindingStateMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getSetIamPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return blockingUnaryCall( + getChannel(), getTestIamPermissionsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.Finding updateFinding( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateFindingMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a notification config.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig updateNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateNotificationConfigMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + updateOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateOrganizationSettingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.Source updateSource( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSourceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks updateSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSecurityMarksMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * V1p1Beta1 APIs for Security Center service.
+   * 
+ */ + public static final class SecurityCenterFutureStub + extends io.grpc.stub.AbstractStub { + private SecurityCenterFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private SecurityCenterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityCenterFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityCenterFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.Source> + createSource(com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateSourceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding
+     * creation to succeed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.Finding> + createFinding(com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateFindingMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a notification config.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + createNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateNotificationConfigMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Deletes a notification config.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteNotificationConfigMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a notification config.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + getNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetNotificationConfigMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + getOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetOrganizationSettingsMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.Source> + getSource(com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetSourceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse> + groupAssets(com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGroupAssetsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse> + groupFindings(com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGroupFindingsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse> + listAssets(com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListAssetsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse> + listFindings(com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFindingsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists notification configs.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse> + listNotificationConfigs( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListNotificationConfigsMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse> + listSources(com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListSourcesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + runAssetDiscovery( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest request) { + return futureUnaryCall( + getChannel().newCall(getRunAssetDiscoveryMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.Finding> + setFindingState(com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetFindingStateMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.Finding> + updateFinding(com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateFindingMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a notification config.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig> + updateNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateNotificationConfigMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings> + updateOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateOrganizationSettingsMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.Source> + updateSource(com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSourceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks> + updateSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSecurityMarksMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SOURCE = 0; + private static final int METHODID_CREATE_FINDING = 1; + private static final int METHODID_CREATE_NOTIFICATION_CONFIG = 2; + private static final int METHODID_DELETE_NOTIFICATION_CONFIG = 3; + private static final int METHODID_GET_IAM_POLICY = 4; + private static final int METHODID_GET_NOTIFICATION_CONFIG = 5; + private static final int METHODID_GET_ORGANIZATION_SETTINGS = 6; + private static final int METHODID_GET_SOURCE = 7; + private static final int METHODID_GROUP_ASSETS = 8; + private static final int METHODID_GROUP_FINDINGS = 9; + private static final int METHODID_LIST_ASSETS = 10; + private static final int METHODID_LIST_FINDINGS = 11; + private static final int METHODID_LIST_NOTIFICATION_CONFIGS = 12; + private static final int METHODID_LIST_SOURCES = 13; + private static final int METHODID_RUN_ASSET_DISCOVERY = 14; + private static final int METHODID_SET_FINDING_STATE = 15; + private static final int METHODID_SET_IAM_POLICY = 16; + private static final int METHODID_TEST_IAM_PERMISSIONS = 17; + private static final int METHODID_UPDATE_FINDING = 18; + private static final int METHODID_UPDATE_NOTIFICATION_CONFIG = 19; + private static final int METHODID_UPDATE_ORGANIZATION_SETTINGS = 20; + private static final int METHODID_UPDATE_SOURCE = 21; + private static final int METHODID_UPDATE_SECURITY_MARKS = 22; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SecurityCenterImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SecurityCenterImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SOURCE: + serviceImpl.createSource( + (com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_FINDING: + serviceImpl.createFinding( + (com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_NOTIFICATION_CONFIG: + serviceImpl.createNotificationConfig( + (com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>) + responseObserver); + break; + case METHODID_DELETE_NOTIFICATION_CONFIG: + serviceImpl.deleteNotificationConfig( + (com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_NOTIFICATION_CONFIG: + serviceImpl.getNotificationConfig( + (com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>) + responseObserver); + break; + case METHODID_GET_ORGANIZATION_SETTINGS: + serviceImpl.getOrganizationSettings( + (com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings>) + responseObserver); + break; + case METHODID_GET_SOURCE: + serviceImpl.getSource( + (com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GROUP_ASSETS: + serviceImpl.groupAssets( + (com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse>) + responseObserver); + break; + case METHODID_GROUP_FINDINGS: + serviceImpl.groupFindings( + (com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse>) + responseObserver); + break; + case METHODID_LIST_ASSETS: + serviceImpl.listAssets( + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse>) + responseObserver); + break; + case METHODID_LIST_FINDINGS: + serviceImpl.listFindings( + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse>) + responseObserver); + break; + case METHODID_LIST_NOTIFICATION_CONFIGS: + serviceImpl.listNotificationConfigs( + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse>) + responseObserver); + break; + case METHODID_LIST_SOURCES: + serviceImpl.listSources( + (com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse>) + responseObserver); + break; + case METHODID_RUN_ASSET_DISCOVERY: + serviceImpl.runAssetDiscovery( + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_FINDING_STATE: + serviceImpl.setFindingState( + (com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_FINDING: + serviceImpl.updateFinding( + (com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_NOTIFICATION_CONFIG: + serviceImpl.updateNotificationConfig( + (com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>) + responseObserver); + break; + case METHODID_UPDATE_ORGANIZATION_SETTINGS: + serviceImpl.updateOrganizationSettings( + (com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings>) + responseObserver); + break; + case METHODID_UPDATE_SOURCE: + serviceImpl.updateSource( + (com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SECURITY_MARKS: + serviceImpl.updateSecurityMarks( + (com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class SecurityCenterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SecurityCenterBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SecurityCenter"); + } + } + + private static final class SecurityCenterFileDescriptorSupplier + extends SecurityCenterBaseDescriptorSupplier { + SecurityCenterFileDescriptorSupplier() {} + } + + private static final class SecurityCenterMethodDescriptorSupplier + extends SecurityCenterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SecurityCenterMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SecurityCenterGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SecurityCenterFileDescriptorSupplier()) + .addMethod(getCreateSourceMethodHelper()) + .addMethod(getCreateFindingMethodHelper()) + .addMethod(getCreateNotificationConfigMethodHelper()) + .addMethod(getDeleteNotificationConfigMethodHelper()) + .addMethod(getGetIamPolicyMethodHelper()) + .addMethod(getGetNotificationConfigMethodHelper()) + .addMethod(getGetOrganizationSettingsMethodHelper()) + .addMethod(getGetSourceMethodHelper()) + .addMethod(getGroupAssetsMethodHelper()) + .addMethod(getGroupFindingsMethodHelper()) + .addMethod(getListAssetsMethodHelper()) + .addMethod(getListFindingsMethodHelper()) + .addMethod(getListNotificationConfigsMethodHelper()) + .addMethod(getListSourcesMethodHelper()) + .addMethod(getRunAssetDiscoveryMethodHelper()) + .addMethod(getSetFindingStateMethodHelper()) + .addMethod(getSetIamPolicyMethodHelper()) + .addMethod(getTestIamPermissionsMethodHelper()) + .addMethod(getUpdateFindingMethodHelper()) + .addMethod(getUpdateNotificationConfigMethodHelper()) + .addMethod(getUpdateOrganizationSettingsMethodHelper()) + .addMethod(getUpdateSourceMethodHelper()) + .addMethod(getUpdateSecurityMarksMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 34cc9558e..d47317c56 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,11 @@ proto-google-cloud-securitycenter-v1beta1 0.83.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-securitycenter-v1p1beta1 + 0.83.2-SNAPSHOT + com.google.api.grpc grpc-google-cloud-securitycenter-v1 @@ -99,6 +104,11 @@ grpc-google-cloud-securitycenter-v1beta1 0.83.2-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1p1beta1 + 0.83.2-SNAPSHOT + com.google.cloud google-cloud-securitycenter @@ -197,8 +207,10 @@ proto-google-cloud-securitycenter-v1 proto-google-cloud-securitycenter-v1beta1 + proto-google-cloud-securitycenter-v1p1beta1 grpc-google-cloud-securitycenter-v1 grpc-google-cloud-securitycenter-v1beta1 + grpc-google-cloud-securitycenter-v1p1beta1 google-cloud-securitycenter google-cloud-securitycenter-bom diff --git a/proto-google-cloud-securitycenter-v1p1beta1/pom.xml b/proto-google-cloud-securitycenter-v1p1beta1/pom.xml new file mode 100644 index 000000000..826fdf17e --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-securitycenter-v1p1beta1 + 0.83.2-SNAPSHOT + proto-google-cloud-securitycenter-v1p1beta1 + PROTO library for proto-google-cloud-securitycenter-v1p1beta1 + + com.google.cloud + google-cloud-securitycenter-parent + 0.118.2-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + + \ No newline at end of file diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Asset.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Asset.java new file mode 100644 index 000000000..f8514d48a --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Asset.java @@ -0,0 +1,5449 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/asset.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud
+ * Platform (GCP) resource.
+ * The Asset is a Cloud SCC resource that captures information about a single
+ * GCP resource. All modifications to an Asset are only within the context of
+ * Cloud SCC and don't affect the referenced GCP resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Asset} + */ +public final class Asset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.Asset) + AssetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Asset.newBuilder() to construct. + private Asset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Asset() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Asset(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Asset( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder + subBuilder = null; + if (securityCenterProperties_ != null) { + subBuilder = securityCenterProperties_.toBuilder(); + } + securityCenterProperties_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityCenterProperties_); + securityCenterProperties_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + resourceProperties_ = + com.google.protobuf.MapField.newMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + resourceProperties__ = + input.readMessage( + ResourcePropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + resourceProperties_ + .getMutableMap() + .put(resourceProperties__.getKey(), resourceProperties__.getValue()); + break; + } + case 66: + { + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityMarks_); + securityMarks_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder subBuilder = null; + if (iamPolicy_ != null) { + subBuilder = iamPolicy_.toBuilder(); + } + iamPolicy_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(iamPolicy_); + iamPolicy_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetResourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Asset.class, + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder.class); + } + + public interface SecurityCenterPropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + * + * @return The resourceName. + */ + java.lang.String getResourceName(); + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + * + * @return The bytes for resourceName. + */ + com.google.protobuf.ByteString getResourceNameBytes(); + + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + * + * @return The resourceType. + */ + java.lang.String getResourceType(); + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + * + * @return The bytes for resourceType. + */ + com.google.protobuf.ByteString getResourceTypeBytes(); + + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + * + * @return The resourceParent. + */ + java.lang.String getResourceParent(); + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + * + * @return The bytes for resourceParent. + */ + com.google.protobuf.ByteString getResourceParentBytes(); + + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + * + * @return The resourceProject. + */ + java.lang.String getResourceProject(); + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + * + * @return The bytes for resourceProject. + */ + com.google.protobuf.ByteString getResourceProjectBytes(); + + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @return A list containing the resourceOwners. + */ + java.util.List getResourceOwnersList(); + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @return The count of resourceOwners. + */ + int getResourceOwnersCount(); + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index of the element to return. + * @return The resourceOwners at the given index. + */ + java.lang.String getResourceOwners(int index); + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index of the value to return. + * @return The bytes of the resourceOwners at the given index. + */ + com.google.protobuf.ByteString getResourceOwnersBytes(int index); + + /** + * + * + *
+     * The user defined display name for this resource.
+     * 
+ * + * string resource_display_name = 6; + * + * @return The resourceDisplayName. + */ + java.lang.String getResourceDisplayName(); + /** + * + * + *
+     * The user defined display name for this resource.
+     * 
+ * + * string resource_display_name = 6; + * + * @return The bytes for resourceDisplayName. + */ + com.google.protobuf.ByteString getResourceDisplayNameBytes(); + + /** + * + * + *
+     * The user defined display name for the parent of this resource.
+     * 
+ * + * string resource_parent_display_name = 7; + * + * @return The resourceParentDisplayName. + */ + java.lang.String getResourceParentDisplayName(); + /** + * + * + *
+     * The user defined display name for the parent of this resource.
+     * 
+ * + * string resource_parent_display_name = 7; + * + * @return The bytes for resourceParentDisplayName. + */ + com.google.protobuf.ByteString getResourceParentDisplayNameBytes(); + + /** + * + * + *
+     * The user defined display name for the project of this resource.
+     * 
+ * + * string resource_project_display_name = 8; + * + * @return The resourceProjectDisplayName. + */ + java.lang.String getResourceProjectDisplayName(); + /** + * + * + *
+     * The user defined display name for the project of this resource.
+     * 
+ * + * string resource_project_display_name = 8; + * + * @return The bytes for resourceProjectDisplayName. + */ + com.google.protobuf.ByteString getResourceProjectDisplayNameBytes(); + } + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by Cloud SCC and
+   * cannot be modified by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} + */ + public static final class SecurityCenterProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + SecurityCenterPropertiesOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityCenterProperties.newBuilder() to construct. + private SecurityCenterProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityCenterProperties() { + resourceName_ = ""; + resourceType_ = ""; + resourceParent_ = ""; + resourceProject_ = ""; + resourceOwners_ = com.google.protobuf.LazyStringArrayList.EMPTY; + resourceDisplayName_ = ""; + resourceParentDisplayName_ = ""; + resourceProjectDisplayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecurityCenterProperties(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecurityCenterProperties( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceParent_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceProject_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + resourceOwners_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + resourceOwners_.add(s); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceDisplayName_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceParentDisplayName_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceProjectDisplayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + resourceOwners_ = resourceOwners_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.class, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder + .class); + } + + public static final int RESOURCE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceName_; + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + * + * @return The resourceName. + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } + } + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + * + * @return The bytes for resourceName. + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceType_; + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + * + * @return The resourceType. + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } + } + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + * + * @return The bytes for resourceType. + */ + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PARENT_FIELD_NUMBER = 3; + private volatile java.lang.Object resourceParent_; + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + * + * @return The resourceParent. + */ + public java.lang.String getResourceParent() { + java.lang.Object ref = resourceParent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceParent_ = s; + return s; + } + } + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + * + * @return The bytes for resourceParent. + */ + public com.google.protobuf.ByteString getResourceParentBytes() { + java.lang.Object ref = resourceParent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PROJECT_FIELD_NUMBER = 4; + private volatile java.lang.Object resourceProject_; + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + * + * @return The resourceProject. + */ + public java.lang.String getResourceProject() { + java.lang.Object ref = resourceProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceProject_ = s; + return s; + } + } + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + * + * @return The bytes for resourceProject. + */ + public com.google.protobuf.ByteString getResourceProjectBytes() { + java.lang.Object ref = resourceProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_OWNERS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList resourceOwners_; + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @return A list containing the resourceOwners. + */ + public com.google.protobuf.ProtocolStringList getResourceOwnersList() { + return resourceOwners_; + } + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @return The count of resourceOwners. + */ + public int getResourceOwnersCount() { + return resourceOwners_.size(); + } + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index of the element to return. + * @return The resourceOwners at the given index. + */ + public java.lang.String getResourceOwners(int index) { + return resourceOwners_.get(index); + } + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index of the value to return. + * @return The bytes of the resourceOwners at the given index. + */ + public com.google.protobuf.ByteString getResourceOwnersBytes(int index) { + return resourceOwners_.getByteString(index); + } + + public static final int RESOURCE_DISPLAY_NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object resourceDisplayName_; + /** + * + * + *
+     * The user defined display name for this resource.
+     * 
+ * + * string resource_display_name = 6; + * + * @return The resourceDisplayName. + */ + public java.lang.String getResourceDisplayName() { + java.lang.Object ref = resourceDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceDisplayName_ = s; + return s; + } + } + /** + * + * + *
+     * The user defined display name for this resource.
+     * 
+ * + * string resource_display_name = 6; + * + * @return The bytes for resourceDisplayName. + */ + public com.google.protobuf.ByteString getResourceDisplayNameBytes() { + java.lang.Object ref = resourceDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PARENT_DISPLAY_NAME_FIELD_NUMBER = 7; + private volatile java.lang.Object resourceParentDisplayName_; + /** + * + * + *
+     * The user defined display name for the parent of this resource.
+     * 
+ * + * string resource_parent_display_name = 7; + * + * @return The resourceParentDisplayName. + */ + public java.lang.String getResourceParentDisplayName() { + java.lang.Object ref = resourceParentDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceParentDisplayName_ = s; + return s; + } + } + /** + * + * + *
+     * The user defined display name for the parent of this resource.
+     * 
+ * + * string resource_parent_display_name = 7; + * + * @return The bytes for resourceParentDisplayName. + */ + public com.google.protobuf.ByteString getResourceParentDisplayNameBytes() { + java.lang.Object ref = resourceParentDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceParentDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PROJECT_DISPLAY_NAME_FIELD_NUMBER = 8; + private volatile java.lang.Object resourceProjectDisplayName_; + /** + * + * + *
+     * The user defined display name for the project of this resource.
+     * 
+ * + * string resource_project_display_name = 8; + * + * @return The resourceProjectDisplayName. + */ + public java.lang.String getResourceProjectDisplayName() { + java.lang.Object ref = resourceProjectDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceProjectDisplayName_ = s; + return s; + } + } + /** + * + * + *
+     * The user defined display name for the project of this resource.
+     * 
+ * + * string resource_project_display_name = 8; + * + * @return The bytes for resourceProjectDisplayName. + */ + public com.google.protobuf.ByteString getResourceProjectDisplayNameBytes() { + java.lang.Object ref = resourceProjectDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceProjectDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_); + } + if (!getResourceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceType_); + } + if (!getResourceParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resourceParent_); + } + if (!getResourceProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resourceProject_); + } + for (int i = 0; i < resourceOwners_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resourceOwners_.getRaw(i)); + } + if (!getResourceDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, resourceDisplayName_); + } + if (!getResourceParentDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, resourceParentDisplayName_); + } + if (!getResourceProjectDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, resourceProjectDisplayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_); + } + if (!getResourceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceType_); + } + if (!getResourceParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resourceParent_); + } + if (!getResourceProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resourceProject_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceOwners_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceOwners_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceOwnersList().size(); + } + if (!getResourceDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, resourceDisplayName_); + } + if (!getResourceParentDisplayNameBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(7, resourceParentDisplayName_); + } + if (!getResourceProjectDisplayNameBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 8, resourceProjectDisplayName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties other = + (com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) obj; + + if (!getResourceName().equals(other.getResourceName())) return false; + if (!getResourceType().equals(other.getResourceType())) return false; + if (!getResourceParent().equals(other.getResourceParent())) return false; + if (!getResourceProject().equals(other.getResourceProject())) return false; + if (!getResourceOwnersList().equals(other.getResourceOwnersList())) return false; + if (!getResourceDisplayName().equals(other.getResourceDisplayName())) return false; + if (!getResourceParentDisplayName().equals(other.getResourceParentDisplayName())) + return false; + if (!getResourceProjectDisplayName().equals(other.getResourceProjectDisplayName())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getResourceType().hashCode(); + hash = (37 * hash) + RESOURCE_PARENT_FIELD_NUMBER; + hash = (53 * hash) + getResourceParent().hashCode(); + hash = (37 * hash) + RESOURCE_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getResourceProject().hashCode(); + if (getResourceOwnersCount() > 0) { + hash = (37 * hash) + RESOURCE_OWNERS_FIELD_NUMBER; + hash = (53 * hash) + getResourceOwnersList().hashCode(); + } + hash = (37 * hash) + RESOURCE_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceDisplayName().hashCode(); + hash = (37 * hash) + RESOURCE_PARENT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceParentDisplayName().hashCode(); + hash = (37 * hash) + RESOURCE_PROJECT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceProjectDisplayName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by Cloud SCC and
+     * cannot be modified by the user.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.class, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + resourceName_ = ""; + + resourceType_ = ""; + + resourceParent_ = ""; + + resourceProject_ = ""; + + resourceOwners_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + resourceDisplayName_ = ""; + + resourceParentDisplayName_ = ""; + + resourceProjectDisplayName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties build() { + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties result = + new com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties(this); + int from_bitField0_ = bitField0_; + result.resourceName_ = resourceName_; + result.resourceType_ = resourceType_; + result.resourceParent_ = resourceParent_; + result.resourceProject_ = resourceProject_; + if (((bitField0_ & 0x00000001) != 0)) { + resourceOwners_ = resourceOwners_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resourceOwners_ = resourceOwners_; + result.resourceDisplayName_ = resourceDisplayName_; + result.resourceParentDisplayName_ = resourceParentDisplayName_; + result.resourceProjectDisplayName_ = resourceProjectDisplayName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + .getDefaultInstance()) return this; + if (!other.getResourceName().isEmpty()) { + resourceName_ = other.resourceName_; + onChanged(); + } + if (!other.getResourceType().isEmpty()) { + resourceType_ = other.resourceType_; + onChanged(); + } + if (!other.getResourceParent().isEmpty()) { + resourceParent_ = other.resourceParent_; + onChanged(); + } + if (!other.getResourceProject().isEmpty()) { + resourceProject_ = other.resourceProject_; + onChanged(); + } + if (!other.resourceOwners_.isEmpty()) { + if (resourceOwners_.isEmpty()) { + resourceOwners_ = other.resourceOwners_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourceOwnersIsMutable(); + resourceOwners_.addAll(other.resourceOwners_); + } + onChanged(); + } + if (!other.getResourceDisplayName().isEmpty()) { + resourceDisplayName_ = other.resourceDisplayName_; + onChanged(); + } + if (!other.getResourceParentDisplayName().isEmpty()) { + resourceParentDisplayName_ = other.resourceParentDisplayName_; + onChanged(); + } + if (!other.getResourceProjectDisplayName().isEmpty()) { + resourceProjectDisplayName_ = other.resourceProjectDisplayName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object resourceName_ = ""; + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + * + * @return The resourceName. + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + * + * @return The bytes for resourceName. + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + * + * @param value The resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearResourceName() { + + resourceName_ = getDefaultInstance().getResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + * + * @param value The bytes for resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceType_ = ""; + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + * + * @return The resourceType. + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + * + * @return The bytes for resourceType. + */ + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + * + * @param value The resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearResourceType() { + + resourceType_ = getDefaultInstance().getResourceType(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + * + * @param value The bytes for resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceParent_ = ""; + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + * + * @return The resourceParent. + */ + public java.lang.String getResourceParent() { + java.lang.Object ref = resourceParent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceParent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + * + * @return The bytes for resourceParent. + */ + public com.google.protobuf.ByteString getResourceParentBytes() { + java.lang.Object ref = resourceParent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + * + * @param value The resourceParent to set. + * @return This builder for chaining. + */ + public Builder setResourceParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceParent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + * + * @return This builder for chaining. + */ + public Builder clearResourceParent() { + + resourceParent_ = getDefaultInstance().getResourceParent(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + * + * @param value The bytes for resourceParent to set. + * @return This builder for chaining. + */ + public Builder setResourceParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceParent_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceProject_ = ""; + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + * + * @return The resourceProject. + */ + public java.lang.String getResourceProject() { + java.lang.Object ref = resourceProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + * + * @return The bytes for resourceProject. + */ + public com.google.protobuf.ByteString getResourceProjectBytes() { + java.lang.Object ref = resourceProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + * + * @param value The resourceProject to set. + * @return This builder for chaining. + */ + public Builder setResourceProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceProject_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + * + * @return This builder for chaining. + */ + public Builder clearResourceProject() { + + resourceProject_ = getDefaultInstance().getResourceProject(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + * + * @param value The bytes for resourceProject to set. + * @return This builder for chaining. + */ + public Builder setResourceProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceProject_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList resourceOwners_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureResourceOwnersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + resourceOwners_ = new com.google.protobuf.LazyStringArrayList(resourceOwners_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @return A list containing the resourceOwners. + */ + public com.google.protobuf.ProtocolStringList getResourceOwnersList() { + return resourceOwners_.getUnmodifiableView(); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @return The count of resourceOwners. + */ + public int getResourceOwnersCount() { + return resourceOwners_.size(); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index of the element to return. + * @return The resourceOwners at the given index. + */ + public java.lang.String getResourceOwners(int index) { + return resourceOwners_.get(index); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index of the value to return. + * @return The bytes of the resourceOwners at the given index. + */ + public com.google.protobuf.ByteString getResourceOwnersBytes(int index) { + return resourceOwners_.getByteString(index); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @param index The index to set the value at. + * @param value The resourceOwners to set. + * @return This builder for chaining. + */ + public Builder setResourceOwners(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceOwnersIsMutable(); + resourceOwners_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @param value The resourceOwners to add. + * @return This builder for chaining. + */ + public Builder addResourceOwners(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceOwnersIsMutable(); + resourceOwners_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @param values The resourceOwners to add. + * @return This builder for chaining. + */ + public Builder addAllResourceOwners(java.lang.Iterable values) { + ensureResourceOwnersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceOwners_); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @return This builder for chaining. + */ + public Builder clearResourceOwners() { + resourceOwners_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + * + * @param value The bytes of the resourceOwners to add. + * @return This builder for chaining. + */ + public Builder addResourceOwnersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceOwnersIsMutable(); + resourceOwners_.add(value); + onChanged(); + return this; + } + + private java.lang.Object resourceDisplayName_ = ""; + /** + * + * + *
+       * The user defined display name for this resource.
+       * 
+ * + * string resource_display_name = 6; + * + * @return The resourceDisplayName. + */ + public java.lang.String getResourceDisplayName() { + java.lang.Object ref = resourceDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user defined display name for this resource.
+       * 
+ * + * string resource_display_name = 6; + * + * @return The bytes for resourceDisplayName. + */ + public com.google.protobuf.ByteString getResourceDisplayNameBytes() { + java.lang.Object ref = resourceDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user defined display name for this resource.
+       * 
+ * + * string resource_display_name = 6; + * + * @param value The resourceDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceDisplayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user defined display name for this resource.
+       * 
+ * + * string resource_display_name = 6; + * + * @return This builder for chaining. + */ + public Builder clearResourceDisplayName() { + + resourceDisplayName_ = getDefaultInstance().getResourceDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user defined display name for this resource.
+       * 
+ * + * string resource_display_name = 6; + * + * @param value The bytes for resourceDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceDisplayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceParentDisplayName_ = ""; + /** + * + * + *
+       * The user defined display name for the parent of this resource.
+       * 
+ * + * string resource_parent_display_name = 7; + * + * @return The resourceParentDisplayName. + */ + public java.lang.String getResourceParentDisplayName() { + java.lang.Object ref = resourceParentDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceParentDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user defined display name for the parent of this resource.
+       * 
+ * + * string resource_parent_display_name = 7; + * + * @return The bytes for resourceParentDisplayName. + */ + public com.google.protobuf.ByteString getResourceParentDisplayNameBytes() { + java.lang.Object ref = resourceParentDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceParentDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user defined display name for the parent of this resource.
+       * 
+ * + * string resource_parent_display_name = 7; + * + * @param value The resourceParentDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceParentDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceParentDisplayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user defined display name for the parent of this resource.
+       * 
+ * + * string resource_parent_display_name = 7; + * + * @return This builder for chaining. + */ + public Builder clearResourceParentDisplayName() { + + resourceParentDisplayName_ = getDefaultInstance().getResourceParentDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user defined display name for the parent of this resource.
+       * 
+ * + * string resource_parent_display_name = 7; + * + * @param value The bytes for resourceParentDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceParentDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceParentDisplayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceProjectDisplayName_ = ""; + /** + * + * + *
+       * The user defined display name for the project of this resource.
+       * 
+ * + * string resource_project_display_name = 8; + * + * @return The resourceProjectDisplayName. + */ + public java.lang.String getResourceProjectDisplayName() { + java.lang.Object ref = resourceProjectDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceProjectDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user defined display name for the project of this resource.
+       * 
+ * + * string resource_project_display_name = 8; + * + * @return The bytes for resourceProjectDisplayName. + */ + public com.google.protobuf.ByteString getResourceProjectDisplayNameBytes() { + java.lang.Object ref = resourceProjectDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceProjectDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user defined display name for the project of this resource.
+       * 
+ * + * string resource_project_display_name = 8; + * + * @param value The resourceProjectDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceProjectDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceProjectDisplayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user defined display name for the project of this resource.
+       * 
+ * + * string resource_project_display_name = 8; + * + * @return This builder for chaining. + */ + public Builder clearResourceProjectDisplayName() { + + resourceProjectDisplayName_ = getDefaultInstance().getResourceProjectDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user defined display name for the project of this resource.
+       * 
+ * + * string resource_project_display_name = 8; + * + * @param value The bytes for resourceProjectDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceProjectDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceProjectDisplayName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + private static final com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityCenterProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecurityCenterProperties(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IamPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+     * format details.
+     * 
+ * + * string policy_blob = 1; + * + * @return The policyBlob. + */ + java.lang.String getPolicyBlob(); + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+     * format details.
+     * 
+ * + * string policy_blob = 1; + * + * @return The bytes for policyBlob. + */ + com.google.protobuf.ByteString getPolicyBlobBytes(); + } + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} + */ + public static final class IamPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + IamPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use IamPolicy.newBuilder() to construct. + private IamPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IamPolicy() { + policyBlob_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IamPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IamPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + policyBlob_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.class, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder.class); + } + + public static final int POLICY_BLOB_FIELD_NUMBER = 1; + private volatile java.lang.Object policyBlob_; + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+     * format details.
+     * 
+ * + * string policy_blob = 1; + * + * @return The policyBlob. + */ + public java.lang.String getPolicyBlob() { + java.lang.Object ref = policyBlob_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyBlob_ = s; + return s; + } + } + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+     * format details.
+     * 
+ * + * string policy_blob = 1; + * + * @return The bytes for policyBlob. + */ + public com.google.protobuf.ByteString getPolicyBlobBytes() { + java.lang.Object ref = policyBlob_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBlob_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getPolicyBlobBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyBlob_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPolicyBlobBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyBlob_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy other = + (com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) obj; + + if (!getPolicyBlob().equals(other.getPolicyBlob())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + POLICY_BLOB_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBlob().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.class, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + policyBlob_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy build() { + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy result = + new com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy(this); + result.policyBlob_ = policyBlob_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.getDefaultInstance()) + return this; + if (!other.getPolicyBlob().isEmpty()) { + policyBlob_ = other.policyBlob_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object policyBlob_ = ""; + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+       * format details.
+       * 
+ * + * string policy_blob = 1; + * + * @return The policyBlob. + */ + public java.lang.String getPolicyBlob() { + java.lang.Object ref = policyBlob_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyBlob_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+       * format details.
+       * 
+ * + * string policy_blob = 1; + * + * @return The bytes for policyBlob. + */ + public com.google.protobuf.ByteString getPolicyBlobBytes() { + java.lang.Object ref = policyBlob_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBlob_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+       * format details.
+       * 
+ * + * string policy_blob = 1; + * + * @param value The policyBlob to set. + * @return This builder for chaining. + */ + public Builder setPolicyBlob(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + policyBlob_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+       * format details.
+       * 
+ * + * string policy_blob = 1; + * + * @return This builder for chaining. + */ + public Builder clearPolicyBlob() { + + policyBlob_ = getDefaultInstance().getPolicyBlob(); + onChanged(); + return this; + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for
+       * format details.
+       * 
+ * + * string policy_blob = 1; + * + * @param value The bytes for policyBlob to set. + * @return This builder for chaining. + */ + public Builder setPolicyBlobBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + policyBlob_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + private static final com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IamPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IamPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/assets/{asset_id}".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/assets/{asset_id}".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECURITY_CENTER_PROPERTIES_FIELD_NUMBER = 2; + private com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + securityCenterProperties_; + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + * + * @return Whether the securityCenterProperties field is set. + */ + public boolean hasSecurityCenterProperties() { + return securityCenterProperties_ != null; + } + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + * + * @return The securityCenterProperties. + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + getSecurityCenterProperties() { + return securityCenterProperties_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + .getDefaultInstance() + : securityCenterProperties_; + } + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder + getSecurityCenterPropertiesOrBuilder() { + return getSecurityCenterProperties(); + } + + public static final int RESOURCE_PROPERTIES_FIELD_NUMBER = 7; + + private static final class ResourcePropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_ResourcePropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + resourceProperties_; + + private com.google.protobuf.MapField + internalGetResourceProperties() { + if (resourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + } + return resourceProperties_; + } + + public int getResourcePropertiesCount() { + return internalGetResourceProperties().getMap().size(); + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public boolean containsResourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetResourceProperties().getMap().containsKey(key); + } + /** Use {@link #getResourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getResourceProperties() { + return getResourcePropertiesMap(); + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public java.util.Map getResourcePropertiesMap() { + return internalGetResourceProperties().getMap(); + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 8; + private com.google.cloud.securitycenter.v1p1beta1.SecurityMarks securityMarks_; + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + * + * @return Whether the securityMarks field is set. + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + * + * @return The securityMarks. + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder + getSecurityMarksOrBuilder() { + return getSecurityMarks(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int IAM_POLICY_FIELD_NUMBER = 11; + private com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iamPolicy_; + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + * + * @return Whether the iamPolicy field is set. + */ + public boolean hasIamPolicy() { + return iamPolicy_ != null; + } + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + * + * @return The iamPolicy. + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy getIamPolicy() { + return iamPolicy_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.getDefaultInstance() + : iamPolicy_; + } + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder + getIamPolicyOrBuilder() { + return getIamPolicy(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (securityCenterProperties_ != null) { + output.writeMessage(2, getSecurityCenterProperties()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetResourceProperties(), + ResourcePropertiesDefaultEntryHolder.defaultEntry, + 7); + if (securityMarks_ != null) { + output.writeMessage(8, getSecurityMarks()); + } + if (createTime_ != null) { + output.writeMessage(9, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(10, getUpdateTime()); + } + if (iamPolicy_ != null) { + output.writeMessage(11, getIamPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (securityCenterProperties_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getSecurityCenterProperties()); + } + for (java.util.Map.Entry entry : + internalGetResourceProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry + resourceProperties__ = + ResourcePropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, resourceProperties__); + } + if (securityMarks_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSecurityMarks()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + if (iamPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getIamPolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.Asset)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.Asset other = + (com.google.cloud.securitycenter.v1p1beta1.Asset) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSecurityCenterProperties() != other.hasSecurityCenterProperties()) return false; + if (hasSecurityCenterProperties()) { + if (!getSecurityCenterProperties().equals(other.getSecurityCenterProperties())) return false; + } + if (!internalGetResourceProperties().equals(other.internalGetResourceProperties())) + return false; + if (hasSecurityMarks() != other.hasSecurityMarks()) return false; + if (hasSecurityMarks()) { + if (!getSecurityMarks().equals(other.getSecurityMarks())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasIamPolicy() != other.hasIamPolicy()) return false; + if (hasIamPolicy()) { + if (!getIamPolicy().equals(other.getIamPolicy())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasSecurityCenterProperties()) { + hash = (37 * hash) + SECURITY_CENTER_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getSecurityCenterProperties().hashCode(); + } + if (!internalGetResourceProperties().getMap().isEmpty()) { + hash = (37 * hash) + RESOURCE_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetResourceProperties().hashCode(); + } + if (hasSecurityMarks()) { + hash = (37 * hash) + SECURITY_MARKS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityMarks().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasIamPolicy()) { + hash = (37 * hash) + IAM_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.securitycenter.v1p1beta1.Asset prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud
+   * Platform (GCP) resource.
+   * The Asset is a Cloud SCC resource that captures information about a single
+   * GCP resource. All modifications to an Asset are only within the context of
+   * Cloud SCC and don't affect the referenced GCP resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Asset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.Asset) + com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetResourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableResourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Asset.class, + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.Asset.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (securityCenterPropertiesBuilder_ == null) { + securityCenterProperties_ = null; + } else { + securityCenterProperties_ = null; + securityCenterPropertiesBuilder_ = null; + } + internalGetMutableResourceProperties().clear(); + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.Asset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset build() { + com.google.cloud.securitycenter.v1p1beta1.Asset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.Asset result = + new com.google.cloud.securitycenter.v1p1beta1.Asset(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (securityCenterPropertiesBuilder_ == null) { + result.securityCenterProperties_ = securityCenterProperties_; + } else { + result.securityCenterProperties_ = securityCenterPropertiesBuilder_.build(); + } + result.resourceProperties_ = internalGetResourceProperties(); + result.resourceProperties_.makeImmutable(); + if (securityMarksBuilder_ == null) { + result.securityMarks_ = securityMarks_; + } else { + result.securityMarks_ = securityMarksBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (iamPolicyBuilder_ == null) { + result.iamPolicy_ = iamPolicy_; + } else { + result.iamPolicy_ = iamPolicyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.Asset) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.Asset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.Asset other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.Asset.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasSecurityCenterProperties()) { + mergeSecurityCenterProperties(other.getSecurityCenterProperties()); + } + internalGetMutableResourceProperties().mergeFrom(other.internalGetResourceProperties()); + if (other.hasSecurityMarks()) { + mergeSecurityMarks(other.getSecurityMarks()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasIamPolicy()) { + mergeIamPolicy(other.getIamPolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.Asset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1p1beta1.Asset) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/assets/{asset_id}".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/assets/{asset_id}".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/assets/{asset_id}".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/assets/{asset_id}".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/assets/{asset_id}".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + securityCenterProperties_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder> + securityCenterPropertiesBuilder_; + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + * + * @return Whether the securityCenterProperties field is set. + */ + public boolean hasSecurityCenterProperties() { + return securityCenterPropertiesBuilder_ != null || securityCenterProperties_ != null; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + * + * @return The securityCenterProperties. + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + getSecurityCenterProperties() { + if (securityCenterPropertiesBuilder_ == null) { + return securityCenterProperties_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + .getDefaultInstance() + : securityCenterProperties_; + } else { + return securityCenterPropertiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder setSecurityCenterProperties( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties value) { + if (securityCenterPropertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityCenterProperties_ = value; + onChanged(); + } else { + securityCenterPropertiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder setSecurityCenterProperties( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder + builderForValue) { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterProperties_ = builderForValue.build(); + onChanged(); + } else { + securityCenterPropertiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder mergeSecurityCenterProperties( + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties value) { + if (securityCenterPropertiesBuilder_ == null) { + if (securityCenterProperties_ != null) { + securityCenterProperties_ = + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.newBuilder( + securityCenterProperties_) + .mergeFrom(value) + .buildPartial(); + } else { + securityCenterProperties_ = value; + } + onChanged(); + } else { + securityCenterPropertiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder clearSecurityCenterProperties() { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterProperties_ = null; + onChanged(); + } else { + securityCenterProperties_ = null; + securityCenterPropertiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder + getSecurityCenterPropertiesBuilder() { + + onChanged(); + return getSecurityCenterPropertiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder + getSecurityCenterPropertiesOrBuilder() { + if (securityCenterPropertiesBuilder_ != null) { + return securityCenterPropertiesBuilder_.getMessageOrBuilder(); + } else { + return securityCenterProperties_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + .getDefaultInstance() + : securityCenterProperties_; + } + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder> + getSecurityCenterPropertiesFieldBuilder() { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterPropertiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.Builder, + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder>( + getSecurityCenterProperties(), getParentForChildren(), isClean()); + securityCenterProperties_ = null; + } + return securityCenterPropertiesBuilder_; + } + + private com.google.protobuf.MapField + resourceProperties_; + + private com.google.protobuf.MapField + internalGetResourceProperties() { + if (resourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + } + return resourceProperties_; + } + + private com.google.protobuf.MapField + internalGetMutableResourceProperties() { + onChanged(); + ; + if (resourceProperties_ == null) { + resourceProperties_ = + com.google.protobuf.MapField.newMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + } + if (!resourceProperties_.isMutable()) { + resourceProperties_ = resourceProperties_.copy(); + } + return resourceProperties_; + } + + public int getResourcePropertiesCount() { + return internalGetResourceProperties().getMap().size(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public boolean containsResourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetResourceProperties().getMap().containsKey(key); + } + /** Use {@link #getResourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getResourceProperties() { + return getResourcePropertiesMap(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public java.util.Map getResourcePropertiesMap() { + return internalGetResourceProperties().getMap(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearResourceProperties() { + internalGetMutableResourceProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public Builder removeResourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableResourceProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableResourceProperties() { + return internalGetMutableResourceProperties().getMutableMap(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public Builder putResourceProperties(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableResourceProperties().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public Builder putAllResourceProperties( + java.util.Map values) { + internalGetMutableResourceProperties().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.SecurityMarks securityMarks_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder> + securityMarksBuilder_; + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + * + * @return Whether the securityMarks field is set. + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + * + * @return The securityMarks. + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1p1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityMarks_ = value; + onChanged(); + } else { + securityMarksBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder builderForValue) { + if (securityMarksBuilder_ == null) { + securityMarks_ = builderForValue.build(); + onChanged(); + } else { + securityMarksBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public Builder mergeSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.newBuilder(securityMarks_) + .mergeFrom(value) + .buildPartial(); + } else { + securityMarks_ = value; + } + onChanged(); + } else { + securityMarksBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public Builder clearSecurityMarks() { + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + onChanged(); + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder + getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder + getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder>( + getSecurityMarks(), getParentForChildren(), isClean()); + securityMarks_ = null; + } + return securityMarksBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iamPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder> + iamPolicyBuilder_; + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + * + * @return Whether the iamPolicy field is set. + */ + public boolean hasIamPolicy() { + return iamPolicyBuilder_ != null || iamPolicy_ != null; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + * + * @return The iamPolicy. + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy getIamPolicy() { + if (iamPolicyBuilder_ == null) { + return iamPolicy_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.getDefaultInstance() + : iamPolicy_; + } else { + return iamPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public Builder setIamPolicy(com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy value) { + if (iamPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicy_ = value; + onChanged(); + } else { + iamPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public Builder setIamPolicy( + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder builderForValue) { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = builderForValue.build(); + onChanged(); + } else { + iamPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public Builder mergeIamPolicy(com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy value) { + if (iamPolicyBuilder_ == null) { + if (iamPolicy_ != null) { + iamPolicy_ = + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.newBuilder(iamPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + iamPolicy_ = value; + } + onChanged(); + } else { + iamPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public Builder clearIamPolicy() { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + onChanged(); + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder getIamPolicyBuilder() { + + onChanged(); + return getIamPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder + getIamPolicyOrBuilder() { + if (iamPolicyBuilder_ != null) { + return iamPolicyBuilder_.getMessageOrBuilder(); + } else { + return iamPolicy_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.getDefaultInstance() + : iamPolicy_; + } + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder> + getIamPolicyFieldBuilder() { + if (iamPolicyBuilder_ == null) { + iamPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.Builder, + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder>( + getIamPolicy(), getParentForChildren(), isClean()); + iamPolicy_ = null; + } + return iamPolicyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.Asset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.Asset) + private static final com.google.cloud.securitycenter.v1p1beta1.Asset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.Asset(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Asset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Asset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Asset(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Asset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetName.java new file mode 100644 index 000000000..b71a6a611 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetName.java @@ -0,0 +1,182 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AssetName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/assets/{asset}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String asset; + + public String getOrganization() { + return organization; + } + + public String getAsset() { + return asset; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AssetName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + asset = Preconditions.checkNotNull(builder.getAsset()); + } + + public static AssetName of(String organization, String asset) { + return newBuilder().setOrganization(organization).setAsset(asset).build(); + } + + public static String format(String organization, String asset) { + return newBuilder().setOrganization(organization).setAsset(asset).build().toString(); + } + + public static AssetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AssetName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("asset")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (AssetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("asset", asset); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "asset", asset); + } + + /** Builder for AssetName. */ + public static class Builder { + + private String organization; + private String asset; + + public String getOrganization() { + return organization; + } + + public String getAsset() { + return asset; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setAsset(String asset) { + this.asset = asset; + return this; + } + + private Builder() {} + + private Builder(AssetName assetName) { + organization = assetName.organization; + asset = assetName.asset; + } + + public AssetName build() { + return new AssetName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AssetName) { + AssetName that = (AssetName) o; + return (this.organization.equals(that.organization)) && (this.asset.equals(that.asset)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= asset.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOrBuilder.java new file mode 100644 index 000000000..485fe0e6f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOrBuilder.java @@ -0,0 +1,314 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/asset.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface AssetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.Asset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/assets/{asset_id}".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/assets/{asset_id}".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + * + * @return Whether the securityCenterProperties field is set. + */ + boolean hasSecurityCenterProperties(); + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + * + * @return The securityCenterProperties. + */ + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + getSecurityCenterProperties(); + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + com.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterPropertiesOrBuilder + getSecurityCenterPropertiesOrBuilder(); + + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + int getResourcePropertiesCount(); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + boolean containsResourceProperties(java.lang.String key); + /** Use {@link #getResourcePropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getResourceProperties(); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + java.util.Map getResourcePropertiesMap(); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + com.google.protobuf.Value getResourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + com.google.protobuf.Value getResourcePropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + * + * @return Whether the securityMarks field is set. + */ + boolean hasSecurityMarks(); + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + * + * @return The securityMarks. + */ + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks(); + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + * + * @return Whether the iamPolicy field is set. + */ + boolean hasIamPolicy(); + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + * + * @return The iamPolicy. + */ + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy getIamPolicy(); + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy iam_policy = 11; + */ + com.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicyOrBuilder getIamPolicyOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOuterClass.java new file mode 100644 index 000000000..0585b71cd --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/AssetOuterClass.java @@ -0,0 +1,167 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/asset.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class AssetOuterClass { + private AssetOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_ResourcePropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_ResourcePropertiesEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/securitycenter/v1p1beta1/" + + "asset.proto\022%google.cloud.securitycenter" + + ".v1p1beta1\032\034google/api/annotations.proto" + + "\032\031google/api/resource.proto\032:google/clou" + + "d/securitycenter/v1p1beta1/security_mark" + + "s.proto\032\034google/protobuf/struct.proto\032\037g" + + "oogle/protobuf/timestamp.proto\"\256\007\n\005Asset" + + "\022\014\n\004name\030\001 \001(\t\022i\n\032security_center_proper" + + "ties\030\002 \001(\0132E.google.cloud.securitycenter" + + ".v1p1beta1.Asset.SecurityCenterPropertie" + + "s\022a\n\023resource_properties\030\007 \003(\0132D.google." + + "cloud.securitycenter.v1p1beta1.Asset.Res" + + "ourcePropertiesEntry\022L\n\016security_marks\030\010" + + " \001(\01324.google.cloud.securitycenter.v1p1b" + + "eta1.SecurityMarks\022/\n\013create_time\030\t \001(\0132" + + "\032.google.protobuf.Timestamp\022/\n\013update_ti" + + "me\030\n \001(\0132\032.google.protobuf.Timestamp\022J\n\n" + + "iam_policy\030\013 \001(\01326.google.cloud.security" + + "center.v1p1beta1.Asset.IamPolicy\032\200\002\n\030Sec" + + "urityCenterProperties\022\025\n\rresource_name\030\001" + + " \001(\t\022\025\n\rresource_type\030\002 \001(\t\022\027\n\017resource_" + + "parent\030\003 \001(\t\022\030\n\020resource_project\030\004 \001(\t\022\027" + + "\n\017resource_owners\030\005 \003(\t\022\035\n\025resource_disp" + + "lay_name\030\006 \001(\t\022$\n\034resource_parent_displa" + + "y_name\030\007 \001(\t\022%\n\035resource_project_display" + + "_name\030\010 \001(\t\032 \n\tIamPolicy\022\023\n\013policy_blob\030" + + "\001 \001(\t\032Q\n\027ResourcePropertiesEntry\022\013\n\003key\030" + + "\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.V" + + "alue:\0028\001:U\352AR\n#securitycenter.googleapis" + + ".com/Asset\022+organizations/{organization}" + + "/assets/{asset}B\375\001\n)com.google.cloud.sec" + + "uritycenter.v1p1beta1P\001ZSgoogle.golang.o" + + "rg/genproto/googleapis/cloud/securitycen" + + "ter/v1p1beta1;securitycenter\252\002%Google.Cl" + + "oud.SecurityCenter.V1P1Beta1\312\002%Google\\Cl" + + "oud\\SecurityCenter\\V1p1beta1\352\002(Google::C" + + "loud::SecurityCenter::V1p1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor, + new java.lang.String[] { + "Name", + "SecurityCenterProperties", + "ResourceProperties", + "SecurityMarks", + "CreateTime", + "UpdateTime", + "IamPolicy", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_SecurityCenterProperties_descriptor, + new java.lang.String[] { + "ResourceName", + "ResourceType", + "ResourceParent", + "ResourceProject", + "ResourceOwners", + "ResourceDisplayName", + "ResourceParentDisplayName", + "ResourceProjectDisplayName", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_IamPolicy_descriptor, + new java.lang.String[] { + "PolicyBlob", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_ResourcePropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_ResourcePropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Asset_ResourcePropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequest.java new file mode 100644 index 000000000..0955616ac --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequest.java @@ -0,0 +1,1165 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for creating a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} + */ +public final class CreateFindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + CreateFindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFindingRequest.newBuilder() to construct. + private CreateFindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFindingRequest() { + parent_ = ""; + findingId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFindingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + findingId_ = s; + break; + } + case 26: + { + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Finding.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(finding_); + finding_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.class, + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINDING_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object 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.
+   * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The findingId. + */ + public java.lang.String getFindingId() { + java.lang.Object ref = findingId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for findingId. + */ + public com.google.protobuf.ByteString getFindingIdBytes() { + java.lang.Object ref = findingId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINDING_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v1p1beta1.Finding finding_; + /** + * + * + *
+   * Required. The Finding being created. The name and security_marks will be
+   * ignored as they are both output only fields on this resource.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return finding_ != null; + } + /** + * + * + *
+   * Required. The Finding being created. The name and security_marks will be
+   * ignored as they are both output only fields on this resource.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } + /** + * + * + *
+   * Required. The Finding being created. The name and security_marks will be
+   * ignored as they are both output only fields on this resource.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + return getFinding(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFindingIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, findingId_); + } + if (finding_ != null) { + output.writeMessage(3, getFinding()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFindingIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, findingId_); + } + if (finding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinding()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest other = + (com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFindingId().equals(other.getFindingId())) return false; + if (hasFinding() != other.hasFinding()) return false; + if (hasFinding()) { + if (!getFinding().equals(other.getFinding())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FINDING_ID_FIELD_NUMBER; + hash = (53 * hash) + getFindingId().hashCode(); + if (hasFinding()) { + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for creating a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.class, + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + findingId_ = ""; + + if (findingBuilder_ == null) { + finding_ = null; + } else { + finding_ = null; + findingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest build() { + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest result = + new com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest(this); + result.parent_ = parent_; + result.findingId_ = findingId_; + if (findingBuilder_ == null) { + result.finding_ = finding_; + } else { + result.finding_ = findingBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFindingId().isEmpty()) { + findingId_ = other.findingId_; + onChanged(); + } + if (other.hasFinding()) { + mergeFinding(other.getFinding()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The findingId. + */ + public java.lang.String getFindingId() { + java.lang.Object ref = findingId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for findingId. + */ + public com.google.protobuf.ByteString getFindingIdBytes() { + java.lang.Object ref = findingId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The findingId to set. + * @return This builder for chaining. + */ + public Builder setFindingId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + findingId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFindingId() { + + findingId_ = getDefaultInstance().getFindingId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for findingId to set. + * @return This builder for chaining. + */ + public Builder setFindingIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + findingId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Finding finding_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return findingBuilder_ != null || finding_ != null; + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } else { + return findingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finding_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + finding_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1p1beta1.Finding.newBuilder(finding_) + .mergeFrom(value) + .buildPartial(); + } else { + finding_ = value; + } + onChanged(); + } else { + findingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + finding_ = null; + onChanged(); + } else { + finding_ = null; + findingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.Builder getFindingBuilder() { + + onChanged(); + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } + } + /** + * + * + *
+     * Required. The Finding being created. The name and security_marks will be
+     * ignored as they are both output only fields on this resource.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder>( + getFinding(), getParentForChildren(), isClean()); + finding_ = null; + } + return findingBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequestOrBuilder.java new file mode 100644 index 000000000..7244c74df --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateFindingRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface CreateFindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The findingId. + */ + java.lang.String getFindingId(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string finding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for findingId. + */ + com.google.protobuf.ByteString getFindingIdBytes(); + + /** + * + * + *
+   * Required. The Finding being created. The name and security_marks will be
+   * ignored as they are both output only fields on this resource.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the finding field is set. + */ + boolean hasFinding(); + /** + * + * + *
+   * Required. The Finding being created. The name and security_marks will be
+   * ignored as they are both output only fields on this resource.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The finding. + */ + com.google.cloud.securitycenter.v1p1beta1.Finding getFinding(); + /** + * + * + *
+   * Required. The Finding being created. The name and security_marks will be
+   * ignored as they are both output only fields on this resource.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequest.java new file mode 100644 index 000000000..b4a3382f0 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequest.java @@ -0,0 +1,1205 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for creating a notification config.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} + */ +public final class CreateNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + CreateNotificationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateNotificationConfigRequest.newBuilder() to construct. + private CreateNotificationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateNotificationConfigRequest() { + parent_ = ""; + configId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateNotificationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateNotificationConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + configId_ = s; + break; + } + case 26: + { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder subBuilder = + null; + if (notificationConfig_ != null) { + subBuilder = notificationConfig_.toBuilder(); + } + notificationConfig_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(notificationConfig_); + notificationConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Resource name of the new notification config's parent. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the new notification config's parent. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIG_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object 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.
+   * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The configId. + */ + public java.lang.String getConfigId() { + java.lang.Object ref = configId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + configId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for configId. + */ + public com.google.protobuf.ByteString getConfigIdBytes() { + java.lang.Object ref = configId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + configId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTIFICATION_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v1p1beta1.NotificationConfig 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationConfig field is set. + */ + public boolean hasNotificationConfig() { + return notificationConfig_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig() { + return notificationConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance() + : 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigOrBuilder() { + return getNotificationConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getConfigIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, configId_); + } + if (notificationConfig_ != null) { + output.writeMessage(3, getNotificationConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getConfigIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, configId_); + } + if (notificationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getNotificationConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest other = + (com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getConfigId().equals(other.getConfigId())) return false; + if (hasNotificationConfig() != other.hasNotificationConfig()) return false; + if (hasNotificationConfig()) { + if (!getNotificationConfig().equals(other.getNotificationConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getConfigId().hashCode(); + if (hasNotificationConfig()) { + hash = (37 * hash) + NOTIFICATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNotificationConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for creating a notification config.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + configId_ = ""; + + if (notificationConfigBuilder_ == null) { + notificationConfig_ = null; + } else { + notificationConfig_ = null; + notificationConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest build() { + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest result = + new com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest(this); + result.parent_ = parent_; + result.configId_ = configId_; + if (notificationConfigBuilder_ == null) { + result.notificationConfig_ = notificationConfig_; + } else { + result.notificationConfig_ = notificationConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getConfigId().isEmpty()) { + configId_ = other.configId_; + onChanged(); + } + if (other.hasNotificationConfig()) { + mergeNotificationConfig(other.getNotificationConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Resource name of the new notification config's parent. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the new notification config's parent. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the new notification config's parent. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the new notification config's parent. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the new notification config's parent. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The configId. + */ + public java.lang.String getConfigId() { + java.lang.Object ref = configId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + configId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for configId. + */ + public com.google.protobuf.ByteString getConfigIdBytes() { + java.lang.Object ref = configId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + configId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The configId to set. + * @return This builder for chaining. + */ + public Builder setConfigId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + configId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearConfigId() { + + configId_ = getDefaultInstance().getConfigId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for configId to set. + * @return This builder for chaining. + */ + public Builder setConfigIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + configId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.NotificationConfig notificationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + notificationConfigBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationConfig field is set. + */ + public boolean hasNotificationConfig() { + return notificationConfigBuilder_ != null || notificationConfig_ != null; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig() { + if (notificationConfigBuilder_ == null) { + return notificationConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance() + : notificationConfig_; + } else { + return notificationConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notificationConfig_ = value; + onChanged(); + } else { + notificationConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder builderForValue) { + if (notificationConfigBuilder_ == null) { + notificationConfig_ = builderForValue.build(); + onChanged(); + } else { + notificationConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigBuilder_ == null) { + if (notificationConfig_ != null) { + notificationConfig_ = + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.newBuilder( + notificationConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + notificationConfig_ = value; + } + onChanged(); + } else { + notificationConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNotificationConfig() { + if (notificationConfigBuilder_ == null) { + notificationConfig_ = null; + onChanged(); + } else { + notificationConfig_ = null; + notificationConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder + getNotificationConfigBuilder() { + + onChanged(); + return getNotificationConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigOrBuilder() { + if (notificationConfigBuilder_ != null) { + return notificationConfigBuilder_.getMessageOrBuilder(); + } else { + return notificationConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance() + : 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + getNotificationConfigFieldBuilder() { + if (notificationConfigBuilder_ == null) { + notificationConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder>( + getNotificationConfig(), getParentForChildren(), isClean()); + notificationConfig_ = null; + } + return notificationConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNotificationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateNotificationConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..17c1b2c41 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateNotificationConfigRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface CreateNotificationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the new notification config's parent. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Resource name of the new notification config's parent. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The configId. + */ + java.lang.String getConfigId(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string config_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for configId. + */ + com.google.protobuf.ByteString getConfigIdBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationConfig field is set. + */ + boolean hasNotificationConfig(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationConfig. + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequest.java new file mode 100644 index 000000000..918d4fc98 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequest.java @@ -0,0 +1,971 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for creating a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} + */ +public final class CreateSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + CreateSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSourceRequest.newBuilder() to construct. + private CreateSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSourceRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSourceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSourceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.securitycenter.v1p1beta1.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.class, + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.securitycenter.v1p1beta1.Source source_; + /** + * + * + *
+   * Required. The Source being created, only the display_name and description
+   * will be used. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * Required. The Source being created, only the display_name and description
+   * will be used. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The source. + */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSource() { + return source_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance() + : source_; + } + /** + * + * + *
+   * Required. The Source being created, only the display_name and description
+   * will be used. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (source_ != null) { + output.writeMessage(2, getSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest other = + (com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (!getSource().equals(other.getSource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for creating a source.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.class, + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest build() { + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest result = + new com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest(this); + result.parent_ = parent_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSource()) { + mergeSource(other.getSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Source source_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The source. + */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSource(com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSource( + com.google.cloud.securitycenter.v1p1beta1.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSource(com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.securitycenter.v1p1beta1.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * Required. The Source being created, only the display_name and description
+     * will be used. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSourceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequestOrBuilder.java new file mode 100644 index 000000000..a1a0cc233 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/CreateSourceRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface CreateSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Source being created, only the display_name and description
+   * will be used. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + * + * + *
+   * Required. The Source being created, only the display_name and description
+   * will be used. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The source. + */ + com.google.cloud.securitycenter.v1p1beta1.Source getSource(); + /** + * + * + *
+   * Required. The Source being created, only the display_name and description
+   * will be used. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourceOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequest.java new file mode 100644 index 000000000..b89a76e34 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequest.java @@ -0,0 +1,676 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for deleting a notification config.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} + */ +public final class DeleteNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + DeleteNotificationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteNotificationConfigRequest.newBuilder() to construct. + private DeleteNotificationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteNotificationConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteNotificationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteNotificationConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the notification config to delete. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the notification config to delete. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest other = + (com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for deleting a notification config.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest build() { + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest result = + new com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the notification config to delete. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the notification config to delete. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the notification config to delete. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the notification config to delete. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the notification config to delete. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteNotificationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteNotificationConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..4ce3a2177 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/DeleteNotificationConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface DeleteNotificationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the notification config to delete. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the notification config to delete. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Finding.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Finding.java new file mode 100644 index 000000000..88b4a29fb --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Finding.java @@ -0,0 +1,3024 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/finding.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Cloud Security Command Center (Cloud SCC) finding.
+ * A finding is a record of assessment data (security, risk, health or privacy)
+ * ingested into Cloud SCC for presentation, notification, analysis,
+ * policy testing, and enforcement. For example, an XSS vulnerability in an
+ * App Engine application is a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Finding} + */ +public final class Finding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.Finding) + FindingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Finding.newBuilder() to construct. + private Finding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Finding() { + name_ = ""; + parent_ = ""; + resourceName_ = ""; + state_ = 0; + category_ = ""; + externalUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Finding(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Finding( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceName_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + category_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + externalUri_ = s; + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sourceProperties_ = + com.google.protobuf.MapField.newMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + sourceProperties__ = + input.readMessage( + SourcePropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + sourceProperties_ + .getMutableMap() + .put(sourceProperties__.getKey(), sourceProperties__.getValue()); + break; + } + case 66: + { + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityMarks_); + securityMarks_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (eventTime_ != null) { + subBuilder = eventTime_.toBuilder(); + } + eventTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTime_); + eventTime_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetSourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Finding.class, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder.class); + } + + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v1p1beta1.Finding.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The finding requires attention and has not been addressed yet.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The finding has been fixed, triaged as a non-issue or otherwise addressed
+     * and is no longer active.
+     * 
+ * + * INACTIVE = 2; + */ + INACTIVE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The finding requires attention and has not been addressed yet.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The finding has been fixed, triaged as a non-issue or otherwise addressed
+     * and is no longer active.
+     * 
+ * + * INACTIVE = 2; + */ + public static final int INACTIVE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return INACTIVE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1p1beta1.Finding.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object resourceName_; + /** + * + * + *
+   * For findings on Google Cloud Platform (GCP) resources, the full resource
+   * name of the GCP resource this finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * When the finding is for a non-GCP resource, the resourceName can be a
+   * customer or partner defined string.
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + * + * @return The resourceName. + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } + } + /** + * + * + *
+   * For findings on Google Cloud Platform (GCP) resources, the full resource
+   * name of the GCP resource this finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * When the finding is for a non-GCP resource, the resourceName can be a
+   * customer or partner defined string.
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + * + * @return The bytes for resourceName. + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return The state. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.Finding.State result = + com.google.cloud.securitycenter.v1p1beta1.Finding.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.State.UNRECOGNIZED + : result; + } + + public static final int CATEGORY_FIELD_NUMBER = 5; + private volatile java.lang.Object category_; + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } + } + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + * + * @return The bytes for category. + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTERNAL_URI_FIELD_NUMBER = 6; + private volatile java.lang.Object externalUri_; + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + * + * @return The externalUri. + */ + public java.lang.String getExternalUri() { + java.lang.Object ref = externalUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + * + * @return The bytes for externalUri. + */ + public com.google.protobuf.ByteString getExternalUriBytes() { + java.lang.Object ref = externalUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_PROPERTIES_FIELD_NUMBER = 7; + + private static final class SourcePropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Finding_SourcePropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + sourceProperties_; + + private com.google.protobuf.MapField + internalGetSourceProperties() { + if (sourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + } + return sourceProperties_; + } + + public int getSourcePropertiesCount() { + return internalGetSourceProperties().getMap().size(); + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public boolean containsSourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetSourceProperties().getMap().containsKey(key); + } + /** Use {@link #getSourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getSourceProperties() { + return getSourcePropertiesMap(); + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public java.util.Map getSourcePropertiesMap() { + return internalGetSourceProperties().getMap(); + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 8; + private com.google.cloud.securitycenter.v1p1beta1.SecurityMarks securityMarks_; + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the securityMarks field is set. + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The securityMarks. + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder + getSecurityMarksOrBuilder() { + return getSecurityMarks(); + } + + public static final int EVENT_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp eventTime_; + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the detector believes
+   * the firewall became open. The accuracy is determined by the detector.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTime_ != null; + } + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the detector believes
+   * the firewall became open. The accuracy is determined by the detector.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the detector believes
+   * the firewall became open. The accuracy is determined by the detector.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + return getEventTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resourceName_); + } + if (state_ + != com.google.cloud.securitycenter.v1p1beta1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!getCategoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, category_); + } + if (!getExternalUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, externalUri_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetSourceProperties(), SourcePropertiesDefaultEntryHolder.defaultEntry, 7); + if (securityMarks_ != null) { + output.writeMessage(8, getSecurityMarks()); + } + if (eventTime_ != null) { + output.writeMessage(9, getEventTime()); + } + if (createTime_ != null) { + output.writeMessage(10, getCreateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resourceName_); + } + if (state_ + != com.google.cloud.securitycenter.v1p1beta1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getCategoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, category_); + } + if (!getExternalUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, externalUri_); + } + for (java.util.Map.Entry entry : + internalGetSourceProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry sourceProperties__ = + SourcePropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, sourceProperties__); + } + if (securityMarks_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSecurityMarks()); + } + if (eventTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getEventTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCreateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.Finding)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.Finding other = + (com.google.cloud.securitycenter.v1p1beta1.Finding) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getResourceName().equals(other.getResourceName())) return false; + if (state_ != other.state_) return false; + if (!getCategory().equals(other.getCategory())) return false; + if (!getExternalUri().equals(other.getExternalUri())) return false; + if (!internalGetSourceProperties().equals(other.internalGetSourceProperties())) return false; + if (hasSecurityMarks() != other.hasSecurityMarks()) return false; + if (hasSecurityMarks()) { + if (!getSecurityMarks().equals(other.getSecurityMarks())) return false; + } + if (hasEventTime() != other.hasEventTime()) return false; + if (hasEventTime()) { + if (!getEventTime().equals(other.getEventTime())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + hash = (37 * hash) + EXTERNAL_URI_FIELD_NUMBER; + hash = (53 * hash) + getExternalUri().hashCode(); + if (!internalGetSourceProperties().getMap().isEmpty()) { + hash = (37 * hash) + SOURCE_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetSourceProperties().hashCode(); + } + if (hasSecurityMarks()) { + hash = (37 * hash) + SECURITY_MARKS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityMarks().hashCode(); + } + if (hasEventTime()) { + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEventTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.securitycenter.v1p1beta1.Finding prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Cloud Security Command Center (Cloud SCC) finding.
+   * A finding is a record of assessment data (security, risk, health or privacy)
+   * ingested into Cloud SCC for presentation, notification, analysis,
+   * policy testing, and enforcement. For example, an XSS vulnerability in an
+   * App Engine application is a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Finding} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.Finding) + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetSourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableSourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Finding.class, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.Finding.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + resourceName_ = ""; + + state_ = 0; + + category_ = ""; + + externalUri_ = ""; + + internalGetMutableSourceProperties().clear(); + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + if (eventTimeBuilder_ == null) { + eventTime_ = null; + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Finding getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Finding build() { + com.google.cloud.securitycenter.v1p1beta1.Finding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Finding buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.Finding result = + new com.google.cloud.securitycenter.v1p1beta1.Finding(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.parent_ = parent_; + result.resourceName_ = resourceName_; + result.state_ = state_; + result.category_ = category_; + result.externalUri_ = externalUri_; + result.sourceProperties_ = internalGetSourceProperties(); + result.sourceProperties_.makeImmutable(); + if (securityMarksBuilder_ == null) { + result.securityMarks_ = securityMarks_; + } else { + result.securityMarks_ = securityMarksBuilder_.build(); + } + if (eventTimeBuilder_ == null) { + result.eventTime_ = eventTime_; + } else { + result.eventTime_ = eventTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.Finding) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.Finding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.Finding other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getResourceName().isEmpty()) { + resourceName_ = other.resourceName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + onChanged(); + } + if (!other.getExternalUri().isEmpty()) { + externalUri_ = other.externalUri_; + onChanged(); + } + internalGetMutableSourceProperties().mergeFrom(other.internalGetSourceProperties()); + if (other.hasSecurityMarks()) { + mergeSecurityMarks(other.getSecurityMarks()); + } + if (other.hasEventTime()) { + mergeEventTime(other.getEventTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.Finding parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.Finding) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string parent = 2; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceName_ = ""; + /** + * + * + *
+     * For findings on Google Cloud Platform (GCP) resources, the full resource
+     * name of the GCP resource this finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * When the finding is for a non-GCP resource, the resourceName can be a
+     * customer or partner defined string.
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + * + * @return The resourceName. + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For findings on Google Cloud Platform (GCP) resources, the full resource
+     * name of the GCP resource this finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * When the finding is for a non-GCP resource, the resourceName can be a
+     * customer or partner defined string.
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + * + * @return The bytes for resourceName. + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For findings on Google Cloud Platform (GCP) resources, the full resource
+     * name of the GCP resource this finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * When the finding is for a non-GCP resource, the resourceName can be a
+     * customer or partner defined string.
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + * + * @param value The resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * For findings on Google Cloud Platform (GCP) resources, the full resource
+     * name of the GCP resource this finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * When the finding is for a non-GCP resource, the resourceName can be a
+     * customer or partner defined string.
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearResourceName() { + + resourceName_ = getDefaultInstance().getResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * For findings on Google Cloud Platform (GCP) resources, the full resource
+     * name of the GCP resource this finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * When the finding is for a non-GCP resource, the resourceName can be a
+     * customer or partner defined string.
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + * + * @param value The bytes for resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceName_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return The state. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.Finding.State result = + com.google.cloud.securitycenter.v1p1beta1.Finding.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.securitycenter.v1p1beta1.Finding.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + * + * @return The bytes for category. + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + category_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + * + * @param value The bytes for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + category_ = value; + onChanged(); + return this; + } + + private java.lang.Object externalUri_ = ""; + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + * + * @return The externalUri. + */ + public java.lang.String getExternalUri() { + java.lang.Object ref = externalUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + * + * @return The bytes for externalUri. + */ + public com.google.protobuf.ByteString getExternalUriBytes() { + java.lang.Object ref = externalUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + * + * @param value The externalUri to set. + * @return This builder for chaining. + */ + public Builder setExternalUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + externalUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + * + * @return This builder for chaining. + */ + public Builder clearExternalUri() { + + externalUri_ = getDefaultInstance().getExternalUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + * + * @param value The bytes for externalUri to set. + * @return This builder for chaining. + */ + public Builder setExternalUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + externalUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + sourceProperties_; + + private com.google.protobuf.MapField + internalGetSourceProperties() { + if (sourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + } + return sourceProperties_; + } + + private com.google.protobuf.MapField + internalGetMutableSourceProperties() { + onChanged(); + ; + if (sourceProperties_ == null) { + sourceProperties_ = + com.google.protobuf.MapField.newMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + } + if (!sourceProperties_.isMutable()) { + sourceProperties_ = sourceProperties_.copy(); + } + return sourceProperties_; + } + + public int getSourcePropertiesCount() { + return internalGetSourceProperties().getMap().size(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public boolean containsSourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetSourceProperties().getMap().containsKey(key); + } + /** Use {@link #getSourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getSourceProperties() { + return getSourcePropertiesMap(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public java.util.Map getSourcePropertiesMap() { + return internalGetSourceProperties().getMap(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearSourceProperties() { + internalGetMutableSourceProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public Builder removeSourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableSourceProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableSourceProperties() { + return internalGetMutableSourceProperties().getMutableMap(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public Builder putSourceProperties(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableSourceProperties().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public Builder putAllSourceProperties( + java.util.Map values) { + internalGetMutableSourceProperties().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.SecurityMarks securityMarks_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder> + securityMarksBuilder_; + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the securityMarks field is set. + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The securityMarks. + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1p1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityMarks_ = value; + onChanged(); + } else { + securityMarksBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder builderForValue) { + if (securityMarksBuilder_ == null) { + securityMarks_ = builderForValue.build(); + onChanged(); + } else { + securityMarksBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.newBuilder(securityMarks_) + .mergeFrom(value) + .buildPartial(); + } else { + securityMarks_ = value; + } + onChanged(); + } else { + securityMarksBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSecurityMarks() { + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + onChanged(); + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder + getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder + getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder>( + getSecurityMarks(), getParentForChildren(), isClean()); + securityMarks_ = null; + } + return securityMarksBuilder_; + } + + private com.google.protobuf.Timestamp eventTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + eventTimeBuilder_; + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + * + * @return Whether the eventTime field is set. + */ + public boolean hasEventTime() { + return eventTimeBuilder_ != null || eventTime_ != null; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + * + * @return The eventTime. + */ + public com.google.protobuf.Timestamp getEventTime() { + if (eventTimeBuilder_ == null) { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } else { + return eventTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder setEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTime_ = value; + onChanged(); + } else { + eventTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder setEventTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (eventTimeBuilder_ == null) { + eventTime_ = builderForValue.build(); + onChanged(); + } else { + eventTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder mergeEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (eventTime_ != null) { + eventTime_ = + com.google.protobuf.Timestamp.newBuilder(eventTime_).mergeFrom(value).buildPartial(); + } else { + eventTime_ = value; + } + onChanged(); + } else { + eventTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder clearEventTime() { + if (eventTimeBuilder_ == null) { + eventTime_ = null; + onChanged(); + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { + + onChanged(); + return getEventTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + if (eventTimeBuilder_ != null) { + return eventTimeBuilder_.getMessageOrBuilder(); + } else { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the detector believes
+     * the firewall became open. The accuracy is determined by the detector.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEventTimeFieldBuilder() { + if (eventTimeBuilder_ == null) { + eventTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEventTime(), getParentForChildren(), isClean()); + eventTime_ = null; + } + return eventTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.Finding) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.Finding) + private static final com.google.cloud.securitycenter.v1p1beta1.Finding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.Finding(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Finding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Finding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Finding(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Finding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingName.java new file mode 100644 index 000000000..dbc3d3096 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingName.java @@ -0,0 +1,211 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FindingName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/sources/{source}/findings/{finding}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String source; + private final String finding; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FindingName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + source = Preconditions.checkNotNull(builder.getSource()); + finding = Preconditions.checkNotNull(builder.getFinding()); + } + + public static FindingName of(String organization, String source, String finding) { + return newBuilder().setOrganization(organization).setSource(source).setFinding(finding).build(); + } + + public static String format(String organization, String source, String finding) { + return newBuilder() + .setOrganization(organization) + .setSource(source) + .setFinding(finding) + .build() + .toString(); + } + + public static FindingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "FindingName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("source"), matchMap.get("finding")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FindingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("source", source); + fieldMapBuilder.put("finding", finding); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "organization", organization, "source", source, "finding", finding); + } + + /** Builder for FindingName. */ + public static class Builder { + + private String organization; + private String source; + private String finding; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + public Builder setFinding(String finding) { + this.finding = finding; + return this; + } + + private Builder() {} + + private Builder(FindingName findingName) { + organization = findingName.organization; + source = findingName.source; + finding = findingName.finding; + } + + public FindingName build() { + return new FindingName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FindingName) { + FindingName that = (FindingName) o; + return (this.organization.equals(that.organization)) + && (this.source.equals(that.source)) + && (this.finding.equals(that.finding)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= source.hashCode(); + h *= 1000003; + h ^= finding.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOrBuilder.java new file mode 100644 index 000000000..94e18affa --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOrBuilder.java @@ -0,0 +1,400 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/finding.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface FindingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.Finding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * For findings on Google Cloud Platform (GCP) resources, the full resource
+   * name of the GCP resource this finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * When the finding is for a non-GCP resource, the resourceName can be a
+   * customer or partner defined string.
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + * + * @return The resourceName. + */ + java.lang.String getResourceName(); + /** + * + * + *
+   * For findings on Google Cloud Platform (GCP) resources, the full resource
+   * name of the GCP resource this finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * When the finding is for a non-GCP resource, the resourceName can be a
+   * customer or partner defined string.
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + * + * @return The bytes for resourceName. + */ + com.google.protobuf.ByteString getResourceNameBytes(); + + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 4; + * + * @return The state. + */ + com.google.cloud.securitycenter.v1p1beta1.Finding.State getState(); + + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + * + * @return The category. + */ + java.lang.String getCategory(); + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + * + * @return The bytes for category. + */ + com.google.protobuf.ByteString getCategoryBytes(); + + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + * + * @return The externalUri. + */ + java.lang.String getExternalUri(); + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + * + * @return The bytes for externalUri. + */ + com.google.protobuf.ByteString getExternalUriBytes(); + + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + int getSourcePropertiesCount(); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + boolean containsSourceProperties(java.lang.String key); + /** Use {@link #getSourcePropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getSourceProperties(); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + java.util.Map getSourcePropertiesMap(); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + com.google.protobuf.Value getSourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + com.google.protobuf.Value getSourcePropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the securityMarks field is set. + */ + boolean hasSecurityMarks(); + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The securityMarks. + */ + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks(); + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the detector believes
+   * the firewall became open. The accuracy is determined by the detector.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + * + * @return Whether the eventTime field is set. + */ + boolean hasEventTime(); + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the detector believes
+   * the firewall became open. The accuracy is determined by the detector.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + * + * @return The eventTime. + */ + com.google.protobuf.Timestamp getEventTime(); + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the detector believes
+   * the firewall became open. The accuracy is determined by the detector.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOuterClass.java new file mode 100644 index 000000000..84569c7c5 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/FindingOuterClass.java @@ -0,0 +1,133 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/finding.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class FindingOuterClass { + private FindingOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_SourcePropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_SourcePropertiesEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/securitycenter/v1p1beta1/" + + "finding.proto\022%google.cloud.securitycent" + + "er.v1p1beta1\032\034google/api/annotations.pro" + + "to\032\037google/api/field_behavior.proto\032\031goo" + + "gle/api/resource.proto\032:google/cloud/sec" + + "uritycenter/v1p1beta1/security_marks.pro" + + "to\032\034google/protobuf/struct.proto\032\037google" + + "/protobuf/timestamp.proto\"\271\005\n\007Finding\022\014\n" + + "\004name\030\001 \001(\t\022\016\n\006parent\030\002 \001(\t\022\025\n\rresource_" + + "name\030\003 \001(\t\022C\n\005state\030\004 \001(\01624.google.cloud" + + ".securitycenter.v1p1beta1.Finding.State\022" + + "\020\n\010category\030\005 \001(\t\022\024\n\014external_uri\030\006 \001(\t\022" + + "_\n\021source_properties\030\007 \003(\0132D.google.clou" + + "d.securitycenter.v1p1beta1.Finding.Sourc" + + "ePropertiesEntry\022Q\n\016security_marks\030\010 \001(\013" + + "24.google.cloud.securitycenter.v1p1beta1" + + ".SecurityMarksB\003\340A\003\022.\n\nevent_time\030\t \001(\0132" + + "\032.google.protobuf.Timestamp\022/\n\013create_ti" + + "me\030\n \001(\0132\032.google.protobuf.Timestamp\032O\n\025" + + "SourcePropertiesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005va" + + "lue\030\002 \001(\0132\026.google.protobuf.Value:\0028\001\"8\n" + + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020" + + "\001\022\014\n\010INACTIVE\020\002:l\352Ai\n%securitycenter.goo" + + "gleapis.com/Finding\022@organizations/{orga" + + "nization}/sources/{source}/findings/{fin" + + "ding}B\375\001\n)com.google.cloud.securitycente" + + "r.v1p1beta1P\001ZSgoogle.golang.org/genprot" + + "o/googleapis/cloud/securitycenter/v1p1be" + + "ta1;securitycenter\252\002%Google.Cloud.Securi" + + "tyCenter.V1P1Beta1\312\002%Google\\Cloud\\Securi" + + "tyCenter\\V1p1beta1\352\002(Google::Cloud::Secu" + + "rityCenter::V1p1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor, + new java.lang.String[] { + "Name", + "Parent", + "ResourceName", + "State", + "Category", + "ExternalUri", + "SourceProperties", + "SecurityMarks", + "EventTime", + "CreateTime", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_SourcePropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_SourcePropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Finding_SourcePropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequest.java new file mode 100644 index 000000000..a6c6224d0 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequest.java @@ -0,0 +1,668 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for getting a notification config.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} + */ +public final class GetNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + GetNotificationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetNotificationConfigRequest.newBuilder() to construct. + private GetNotificationConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetNotificationConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetNotificationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetNotificationConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the notification config to get. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the notification config to get. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest other = + (com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for getting a notification config.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest build() { + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest result = + new com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the notification config to get. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the notification config to get. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the notification config to get. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the notification config to get. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the notification config to get. Its format is
+     * "organizations/[organization_id]/notificationConfigs/[config_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNotificationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNotificationConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..0ab8d93aa --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetNotificationConfigRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GetNotificationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the notification config to get. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the notification config to get. Its format is
+   * "organizations/[organization_id]/notificationConfigs/[config_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequest.java new file mode 100644 index 000000000..448608c8e --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequest.java @@ -0,0 +1,673 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for getting organization settings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} + */ +public final class GetOrganizationSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + GetOrganizationSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOrganizationSettingsRequest.newBuilder() to construct. + private GetOrganizationSettingsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetOrganizationSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOrganizationSettingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetOrganizationSettingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the organization to get organization settings for. Its
+   * format is "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the organization to get organization settings for. Its
+   * format is "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for getting organization settings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the organization to get organization settings for. Its
+     * format is "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to get organization settings for. Its
+     * format is "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to get organization settings for. Its
+     * format is "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to get organization settings for. Its
+     * format is "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to get organization settings for. Its
+     * format is "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOrganizationSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOrganizationSettingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequestOrBuilder.java new file mode 100644 index 000000000..a1a822e8e --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetOrganizationSettingsRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GetOrganizationSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the organization to get organization settings for. Its
+   * format is "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the organization to get organization settings for. Its
+   * format is "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequest.java new file mode 100644 index 000000000..b0dd1d59f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequest.java @@ -0,0 +1,656 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for getting a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GetSourceRequest} + */ +public final class GetSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + GetSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSourceRequest.newBuilder() to construct. + private GetSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSourceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSourceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest other = + (com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for getting a source.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GetSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest build() { + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest result = + new com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSourceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GetSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequestOrBuilder.java new file mode 100644 index 000000000..faa23ee35 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GetSourceRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GetSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequest.java new file mode 100644 index 000000000..8f2f1d9de --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequest.java @@ -0,0 +1,2698 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for grouping by assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} + */ +public final class GroupAssetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + GroupAssetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupAssetsRequest.newBuilder() to construct. + private GroupAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupAssetsRequest() { + parent_ = ""; + filter_ = ""; + groupBy_ = ""; + having_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroupAssetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupAssetsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + groupBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 64: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_name_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_name_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object groupBy_; + /** + * + * + *
+   * Required. Expression that defines what assets fields to use for grouping.
+   * The string value should follow SQL syntax: comma separated list of fields.
+   * For example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * * security_center_properties.resource_parent_display_name
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_parent_display_name
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The groupBy. + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Expression that defines what assets fields to use for grouping.
+   * The string value should follow SQL syntax: comma separated list of fields.
+   * For example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * * security_center_properties.resource_parent_display_name
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_parent_display_name
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for groupBy. + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int READ_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 7; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 8; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, groupBy_); + } + if (compareDuration_ != null) { + output.writeMessage(4, getCompareDuration()); + } + if (readTime_ != null) { + output.writeMessage(5, getReadTime()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(8, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, groupBy_); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCompareDuration()); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadTime()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getGroupBy().equals(other.getGroupBy())) return false; + if (hasCompareDuration() != other.hasCompareDuration()) return false; + if (hasCompareDuration()) { + if (!getCompareDuration().equals(other.getCompareDuration())) return false; + } + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getHaving().equals(other.getHaving())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + GROUP_BY_FIELD_NUMBER; + hash = (53 * hash) + getGroupBy().hashCode(); + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for grouping by assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + groupBy_ = ""; + + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + having_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.groupBy_ = groupBy_; + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.having_ = having_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getGroupBy().isEmpty()) { + groupBy_ = other.groupBy_; + onChanged(); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_name_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_name_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_name_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_name_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_name_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object groupBy_ = ""; + /** + * + * + *
+     * Required. Expression that defines what assets fields to use for grouping.
+     * The string value should follow SQL syntax: comma separated list of fields.
+     * For example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * * security_center_properties.resource_parent_display_name
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_parent_display_name
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The groupBy. + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Expression that defines what assets fields to use for grouping.
+     * The string value should follow SQL syntax: comma separated list of fields.
+     * For example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * * security_center_properties.resource_parent_display_name
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_parent_display_name
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for groupBy. + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Expression that defines what assets fields to use for grouping.
+     * The string value should follow SQL syntax: comma separated list of fields.
+     * For example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * * security_center_properties.resource_parent_display_name
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_parent_display_name
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The groupBy to set. + * @return This builder for chaining. + */ + public Builder setGroupBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + groupBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Expression that defines what assets fields to use for grouping.
+     * The string value should follow SQL syntax: comma separated list of fields.
+     * For example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * * security_center_properties.resource_parent_display_name
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_parent_display_name
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearGroupBy() { + + groupBy_ = getDefaultInstance().getGroupBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Expression that defines what assets fields to use for grouping.
+     * The string value should follow SQL syntax: comma separated list of fields.
+     * For example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * * security_center_properties.resource_parent_display_name
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_project_display_name
+     * * security_center_properties.resource_parent_display_name
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for groupBy to set. + * @return This builder for chaining. + */ + public Builder setGroupByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + groupBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Duration compareDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The having to set. + * @return This builder for chaining. + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return This builder for chaining. + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The bytes for having to set. + * @return This builder for chaining. + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupAssetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupAssetsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequestOrBuilder.java new file mode 100644 index 000000000..09e3c6b7a --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsRequestOrBuilder.java @@ -0,0 +1,430 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GroupAssetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_name_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_name_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Required. Expression that defines what assets fields to use for grouping.
+   * The string value should follow SQL syntax: comma separated list of fields.
+   * For example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * * security_center_properties.resource_parent_display_name
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_parent_display_name
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The groupBy. + */ + java.lang.String getGroupBy(); + /** + * + * + *
+   * Required. Expression that defines what assets fields to use for grouping.
+   * The string value should follow SQL syntax: comma separated list of fields.
+   * For example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * * security_center_properties.resource_parent_display_name
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_project_display_name
+   * * security_center_properties.resource_parent_display_name
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for groupBy. + */ + com.google.protobuf.ByteString getGroupByBytes(); + + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + * + * @return Whether the compareDuration field is set. + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + * + * @return The compareDuration. + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponse.java new file mode 100644 index 000000000..ffa6c636f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponse.java @@ -0,0 +1,1570 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response message for grouping by assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} + */ +public final class GroupAssetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + GroupAssetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupAssetsResponse.newBuilder() to construct. + private GroupAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupAssetsResponse() { + groupByResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroupAssetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupAssetsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + groupByResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.GroupResult>(); + mutable_bitField0_ |= 0x00000001; + } + groupByResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.GroupResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.Builder.class); + } + + public static final int GROUP_BY_RESULTS_FIELD_NUMBER = 1; + private java.util.List groupByResults_; + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public int getGroupByResultsCount() { + return groupByResults_.size(); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult getGroupByResults(int index) { + return groupByResults_.get(index); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index) { + return groupByResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < groupByResults_.size(); i++) { + output.writeMessage(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < groupByResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse other = + (com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) obj; + + if (!getGroupByResultsList().equals(other.getGroupByResultsList())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGroupByResultsCount() > 0) { + hash = (37 * hash) + GROUP_BY_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getGroupByResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for grouping by assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGroupByResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupByResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse build() { + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse result = + new com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse(this); + int from_bitField0_ = bitField0_; + if (groupByResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groupByResults_ = groupByResults_; + } else { + result.groupByResults_ = groupByResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.getDefaultInstance()) + return this; + if (groupByResultsBuilder_ == null) { + if (!other.groupByResults_.isEmpty()) { + if (groupByResults_.isEmpty()) { + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupByResultsIsMutable(); + groupByResults_.addAll(other.groupByResults_); + } + onChanged(); + } + } else { + if (!other.groupByResults_.isEmpty()) { + if (groupByResultsBuilder_.isEmpty()) { + groupByResultsBuilder_.dispose(); + groupByResultsBuilder_ = null; + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + groupByResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupByResultsFieldBuilder() + : null; + } else { + groupByResultsBuilder_.addAllMessages(other.groupByResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List groupByResults_ = + java.util.Collections.emptyList(); + + private void ensureGroupByResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + groupByResults_ = + new java.util.ArrayList( + groupByResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.GroupResult, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder> + groupByResultsBuilder_; + + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public java.util.List + getGroupByResultsList() { + if (groupByResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupByResults_); + } else { + return groupByResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public int getGroupByResultsCount() { + if (groupByResultsBuilder_ == null) { + return groupByResults_.size(); + } else { + return groupByResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult getGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, value); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults(com.google.cloud.securitycenter.v1p1beta1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults( + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addAllGroupByResults( + java.lang.Iterable + values) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupByResults_); + onChanged(); + } else { + groupByResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder clearGroupByResults() { + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupByResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder removeGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.remove(index); + onChanged(); + } else { + groupByResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder getGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder + getGroupByResultsOrBuilder(int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public java.util.List + getGroupByResultsOrBuilderList() { + if (groupByResultsBuilder_ != null) { + return groupByResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupByResults_); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder + addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v1p1beta1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder() + .addBuilder( + index, com.google.cloud.securitycenter.v1p1beta1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.GroupResult, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.GroupResult, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder>( + groupByResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + groupByResults_ = null; + } + return groupByResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupAssetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupAssetsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponseOrBuilder.java new file mode 100644 index 000000000..c655aa8c5 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupAssetsResponseOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GroupAssetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + java.util.List getGroupByResultsList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.GroupResult getGroupByResults(int index); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + int getGroupByResultsCount(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + java.util.List + getGroupByResultsOrBuilderList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index); + + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + int getTotalSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequest.java new file mode 100644 index 000000000..da7942025 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequest.java @@ -0,0 +1,2598 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for grouping by findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} + */ +public final class GroupFindingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + GroupFindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupFindingsRequest.newBuilder() to construct. + private GroupFindingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupFindingsRequest() { + parent_ = ""; + filter_ = ""; + groupBy_ = ""; + having_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroupFindingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupFindingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + groupBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 64: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * parent: `=`, `:`
+   * * resource_name: `=`, `:`
+   * * state: `=`, `:`
+   * * category: `=`, `:`
+   * * external_uri: `=`, `:`
+   * * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * * security_marks.marks: `=`, `:`
+   * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * parent: `=`, `:`
+   * * resource_name: `=`, `:`
+   * * state: `=`, `:`
+   * * category: `=`, `:`
+   * * external_uri: `=`, `:`
+   * * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * * security_marks.marks: `=`, `:`
+   * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object 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
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The groupBy. + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } + } + /** + * + * + *
+   * 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
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for groupBy. + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 7; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 8; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, groupBy_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (compareDuration_ != null) { + output.writeMessage(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(8, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, groupBy_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getGroupBy().equals(other.getGroupBy())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (hasCompareDuration() != other.hasCompareDuration()) return false; + if (hasCompareDuration()) { + if (!getCompareDuration().equals(other.getCompareDuration())) return false; + } + if (!getHaving().equals(other.getHaving())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + GROUP_BY_FIELD_NUMBER; + hash = (53 * hash) + getGroupBy().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for grouping by findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + groupBy_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + having_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.groupBy_ = groupBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + result.having_ = having_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getGroupBy().isEmpty()) { + groupBy_ = other.groupBy_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * parent: `=`, `:`
+     * * resource_name: `=`, `:`
+     * * state: `=`, `:`
+     * * category: `=`, `:`
+     * * external_uri: `=`, `:`
+     * * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * * security_marks.marks: `=`, `:`
+     * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * parent: `=`, `:`
+     * * resource_name: `=`, `:`
+     * * state: `=`, `:`
+     * * category: `=`, `:`
+     * * external_uri: `=`, `:`
+     * * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * * security_marks.marks: `=`, `:`
+     * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * parent: `=`, `:`
+     * * resource_name: `=`, `:`
+     * * state: `=`, `:`
+     * * category: `=`, `:`
+     * * external_uri: `=`, `:`
+     * * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * * security_marks.marks: `=`, `:`
+     * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * parent: `=`, `:`
+     * * resource_name: `=`, `:`
+     * * state: `=`, `:`
+     * * category: `=`, `:`
+     * * external_uri: `=`, `:`
+     * * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * * security_marks.marks: `=`, `:`
+     * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * * name: `=`
+     * * parent: `=`, `:`
+     * * resource_name: `=`, `:`
+     * * state: `=`, `:`
+     * * category: `=`, `:`
+     * * external_uri: `=`, `:`
+     * * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * * security_marks.marks: `=`, `:`
+     * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The groupBy. + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for groupBy. + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The groupBy to set. + * @return This builder for chaining. + */ + public Builder setGroupBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + groupBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearGroupBy() { + + groupBy_ = getDefaultInstance().getGroupBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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
+     * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for groupBy to set. + * @return This builder for chaining. + */ + public Builder setGroupByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + groupBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration compareDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The having to set. + * @return This builder for chaining. + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return This builder for chaining. + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The bytes for having to set. + * @return This builder for chaining. + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupFindingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupFindingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequestOrBuilder.java new file mode 100644 index 000000000..7c2332ee8 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsRequestOrBuilder.java @@ -0,0 +1,401 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GroupFindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * parent: `=`, `:`
+   * * resource_name: `=`, `:`
+   * * state: `=`, `:`
+   * * category: `=`, `:`
+   * * external_uri: `=`, `:`
+   * * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * * security_marks.marks: `=`, `:`
+   * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * * name: `=`
+   * * parent: `=`, `:`
+   * * resource_name: `=`, `:`
+   * * state: `=`, `:`
+   * * category: `=`, `:`
+   * * external_uri: `=`, `:`
+   * * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * * security_marks.marks: `=`, `:`
+   * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * 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
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The groupBy. + */ + java.lang.String getGroupBy(); + /** + * + * + *
+   * 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
+   * 
+ * + * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for groupBy. + */ + com.google.protobuf.ByteString getGroupByBytes(); + + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponse.java new file mode 100644 index 000000000..6bd357a63 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponse.java @@ -0,0 +1,1573 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response message for group by findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} + */ +public final class GroupFindingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + GroupFindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupFindingsResponse.newBuilder() to construct. + private GroupFindingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupFindingsResponse() { + groupByResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroupFindingsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupFindingsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + groupByResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.GroupResult>(); + mutable_bitField0_ |= 0x00000001; + } + groupByResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.GroupResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.Builder.class); + } + + public static final int GROUP_BY_RESULTS_FIELD_NUMBER = 1; + private java.util.List groupByResults_; + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public int getGroupByResultsCount() { + return groupByResults_.size(); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult getGroupByResults(int index) { + return groupByResults_.get(index); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index) { + return groupByResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < groupByResults_.size(); i++) { + output.writeMessage(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < groupByResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse other = + (com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) obj; + + if (!getGroupByResultsList().equals(other.getGroupByResultsList())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGroupByResultsCount() > 0) { + hash = (37 * hash) + GROUP_BY_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getGroupByResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for group by findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGroupByResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupByResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse build() { + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse result = + new com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse(this); + int from_bitField0_ = bitField0_; + if (groupByResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groupByResults_ = groupByResults_; + } else { + result.groupByResults_ = groupByResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.getDefaultInstance()) + return this; + if (groupByResultsBuilder_ == null) { + if (!other.groupByResults_.isEmpty()) { + if (groupByResults_.isEmpty()) { + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupByResultsIsMutable(); + groupByResults_.addAll(other.groupByResults_); + } + onChanged(); + } + } else { + if (!other.groupByResults_.isEmpty()) { + if (groupByResultsBuilder_.isEmpty()) { + groupByResultsBuilder_.dispose(); + groupByResultsBuilder_ = null; + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + groupByResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupByResultsFieldBuilder() + : null; + } else { + groupByResultsBuilder_.addAllMessages(other.groupByResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List groupByResults_ = + java.util.Collections.emptyList(); + + private void ensureGroupByResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + groupByResults_ = + new java.util.ArrayList( + groupByResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.GroupResult, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder> + groupByResultsBuilder_; + + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public java.util.List + getGroupByResultsList() { + if (groupByResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupByResults_); + } else { + return groupByResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public int getGroupByResultsCount() { + if (groupByResultsBuilder_ == null) { + return groupByResults_.size(); + } else { + return groupByResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult getGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, value); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults(com.google.cloud.securitycenter.v1p1beta1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults( + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder addAllGroupByResults( + java.lang.Iterable + values) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupByResults_); + onChanged(); + } else { + groupByResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder clearGroupByResults() { + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupByResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public Builder removeGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.remove(index); + onChanged(); + } else { + groupByResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder getGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder + getGroupByResultsOrBuilder(int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public java.util.List + getGroupByResultsOrBuilderList() { + if (groupByResultsBuilder_ != null) { + return groupByResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupByResults_); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder + addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v1p1beta1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder() + .addBuilder( + index, com.google.cloud.securitycenter.v1p1beta1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + * + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.GroupResult, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.GroupResult, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder>( + groupByResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + groupByResults_ = null; + } + return groupByResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupFindingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupFindingsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponseOrBuilder.java new file mode 100644 index 000000000..7497748ff --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupFindingsResponseOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GroupFindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + java.util.List getGroupByResultsList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.GroupResult getGroupByResults(int index); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + int getGroupByResultsCount(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + java.util.List + getGroupByResultsOrBuilderList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index); + + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + int getTotalSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResult.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResult.java new file mode 100644 index 000000000..5777c2bb4 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResult.java @@ -0,0 +1,874 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Result containing the properties and count of a groupBy request.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupResult} + */ +public final class GroupResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.GroupResult) + GroupResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupResult.newBuilder() to construct. + private GroupResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupResult() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroupResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + properties_ = + com.google.protobuf.MapField.newMapField( + PropertiesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + properties__ = + input.readMessage( + PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + properties_.getMutableMap().put(properties__.getKey(), properties__.getValue()); + break; + } + case 16: + { + count_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupResult.class, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder.class); + } + + public static final int PROPERTIES_FIELD_NUMBER = 1; + + private static final class PropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_PropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField properties_; + + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField(PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public boolean containsProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetProperties().getMap().containsKey(key); + } + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int COUNT_FIELD_NUMBER = 2; + private long count_; + /** + * + * + *
+   * Total count of resources for the given properties.
+   * 
+ * + * int64 count = 2; + * + * @return The count. + */ + public long getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetProperties(), PropertiesDefaultEntryHolder.defaultEntry, 1); + if (count_ != 0L) { + output.writeInt64(2, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry properties__ = + PropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, properties__); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, count_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.GroupResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.GroupResult other = + (com.google.cloud.securitycenter.v1p1beta1.GroupResult) obj; + + if (!internalGetProperties().equals(other.internalGetProperties())) return false; + if (getCount() != other.getCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetProperties().getMap().isEmpty()) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetProperties().hashCode(); + } + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.GroupResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Result containing the properties and count of a groupBy request.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.GroupResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.GroupResult) + com.google.cloud.securitycenter.v1p1beta1.GroupResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.GroupResult.class, + com.google.cloud.securitycenter.v1p1beta1.GroupResult.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.GroupResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableProperties().clear(); + count_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupResult getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.GroupResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupResult build() { + com.google.cloud.securitycenter.v1p1beta1.GroupResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupResult buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.GroupResult result = + new com.google.cloud.securitycenter.v1p1beta1.GroupResult(this); + int from_bitField0_ = bitField0_; + result.properties_ = internalGetProperties(); + result.properties_.makeImmutable(); + result.count_ = count_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.GroupResult) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.GroupResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.GroupResult other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.GroupResult.getDefaultInstance()) + return this; + internalGetMutableProperties().mergeFrom(other.internalGetProperties()); + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.GroupResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.GroupResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField properties_; + + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + + private com.google.protobuf.MapField + internalGetMutableProperties() { + onChanged(); + ; + if (properties_ == null) { + properties_ = + com.google.protobuf.MapField.newMapField(PropertiesDefaultEntryHolder.defaultEntry); + } + if (!properties_.isMutable()) { + properties_ = properties_.copy(); + } + return properties_; + } + + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public boolean containsProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetProperties().getMap().containsKey(key); + } + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearProperties() { + internalGetMutableProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public Builder removeProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableProperties() { + return internalGetMutableProperties().getMutableMap(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public Builder putProperties(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableProperties().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public Builder putAllProperties( + java.util.Map values) { + internalGetMutableProperties().getMutableMap().putAll(values); + return this; + } + + private long count_; + /** + * + * + *
+     * Total count of resources for the given properties.
+     * 
+ * + * int64 count = 2; + * + * @return The count. + */ + public long getCount() { + return count_; + } + /** + * + * + *
+     * Total count of resources for the given properties.
+     * 
+ * + * int64 count = 2; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Total count of resources for the given properties.
+     * 
+ * + * int64 count = 2; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + + count_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.GroupResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.GroupResult) + private static final com.google.cloud.securitycenter.v1p1beta1.GroupResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.GroupResult(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.GroupResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.GroupResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResultOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResultOrBuilder.java new file mode 100644 index 000000000..0595b66fa --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/GroupResultOrBuilder.java @@ -0,0 +1,93 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface GroupResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.GroupResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + int getPropertiesCount(); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + boolean containsProperties(java.lang.String key); + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getProperties(); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + java.util.Map getPropertiesMap(); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + com.google.protobuf.Value getPropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + com.google.protobuf.Value getPropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Total count of resources for the given properties.
+   * 
+ * + * int64 count = 2; + * + * @return The count. + */ + long getCount(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequest.java new file mode 100644 index 000000000..95a8e33e1 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequest.java @@ -0,0 +1,3026 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for listing assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} + */ +public final class ListAssetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + ListAssetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsRequest.newBuilder() to construct. + private ListAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsRequest() { + parent_ = ""; + filter_ = ""; + orderBy_ = ""; + having_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (fieldMask_ != null) { + subBuilder = fieldMask_.toBuilder(); + } + fieldMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fieldMask_); + fieldMask_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following are the allowed field and operator combinations:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following are the allowed field and operator combinations:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * update_time
+   * resource_properties
+   * security_marks.marks
+   * security_center_properties.resource_name
+   * security_center_properties.resource_display_name
+   * security_center_properties.resource_parent
+   * security_center_properties.resource_parent_display_name
+   * security_center_properties.resource_project
+   * security_center_properties.resource_project_display_name
+   * security_center_properties.resource_type
+   * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * update_time
+   * resource_properties
+   * security_marks.marks
+   * security_center_properties.resource_name
+   * security_center_properties.resource_display_name
+   * security_center_properties.resource_parent
+   * security_center_properties.resource_parent_display_name
+   * security_center_properties.resource_project
+   * security_center_properties.resource_project_display_name
+   * security_center_properties.resource_type
+   * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELD_MASK_FIELD_NUMBER = 7; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return fieldMask_ != null; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 9; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (compareDuration_ != null) { + output.writeMessage(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (fieldMask_ != null) { + output.writeMessage(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(9, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (hasCompareDuration() != other.hasCompareDuration()) return false; + if (hasCompareDuration()) { + if (!getCompareDuration().equals(other.getCompareDuration())) return false; + } + if (!getHaving().equals(other.getHaving())) return false; + if (hasFieldMask() != other.hasFieldMask()) return false; + if (hasFieldMask()) { + if (!getFieldMask().equals(other.getFieldMask())) return false; + } + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for listing assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + having_ = ""; + + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + result.having_ = having_; + if (fieldMaskBuilder_ == null) { + result.fieldMask_ = fieldMask_; + } else { + result.fieldMask_ = fieldMaskBuilder_.build(); + } + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following are the allowed field and operator combinations:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following are the allowed field and operator combinations:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following are the allowed field and operator combinations:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following are the allowed field and operator combinations:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following are the allowed field and operator combinations:
+     * * name: `=`
+     * * update_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "update_time = \"2019-06-10T16:07:18-07:00\""
+     *     "update_time = 1560208038000"
+     * * create_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "create_time = \"2019-06-10T16:07:18-07:00\""
+     *     "create_time = 1560208038000"
+     * * iam_policy.policy_blob: `=`, `:`
+     * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * * security_marks.marks: `=`, `:`
+     * * security_center_properties.resource_name: `=`, `:`
+     * * security_center_properties.resource_display_name: `=`, `:`
+     * * security_center_properties.resource_type: `=`, `:`
+     * * security_center_properties.resource_parent: `=`, `:`
+     * * security_center_properties.resource_parent_display_name: `=`, `:`
+     * * security_center_properties.resource_project: `=`, `:`
+     * * security_center_properties.resource_project_display_name: `=`, `:`
+     * * security_center_properties.resource_owners: `=`, `:`
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * update_time
+     * resource_properties
+     * security_marks.marks
+     * security_center_properties.resource_name
+     * security_center_properties.resource_display_name
+     * security_center_properties.resource_parent
+     * security_center_properties.resource_parent_display_name
+     * security_center_properties.resource_project
+     * security_center_properties.resource_project_display_name
+     * security_center_properties.resource_type
+     * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * update_time
+     * resource_properties
+     * security_marks.marks
+     * security_center_properties.resource_name
+     * security_center_properties.resource_display_name
+     * security_center_properties.resource_parent
+     * security_center_properties.resource_parent_display_name
+     * security_center_properties.resource_project
+     * security_center_properties.resource_project_display_name
+     * security_center_properties.resource_type
+     * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * update_time
+     * resource_properties
+     * security_marks.marks
+     * security_center_properties.resource_name
+     * security_center_properties.resource_display_name
+     * security_center_properties.resource_parent
+     * security_center_properties.resource_parent_display_name
+     * security_center_properties.resource_project
+     * security_center_properties.resource_project_display_name
+     * security_center_properties.resource_type
+     * 
+ * + * string order_by = 3; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * update_time
+     * resource_properties
+     * security_marks.marks
+     * security_center_properties.resource_name
+     * security_center_properties.resource_display_name
+     * security_center_properties.resource_parent
+     * security_center_properties.resource_parent_display_name
+     * security_center_properties.resource_project
+     * security_center_properties.resource_project_display_name
+     * security_center_properties.resource_type
+     * 
+ * + * string order_by = 3; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * update_time
+     * resource_properties
+     * security_marks.marks
+     * security_center_properties.resource_name
+     * security_center_properties.resource_display_name
+     * security_center_properties.resource_parent
+     * security_center_properties.resource_parent_display_name
+     * security_center_properties.resource_project
+     * security_center_properties.resource_project_display_name
+     * security_center_properties.resource_type
+     * 
+ * + * string order_by = 3; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration compareDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The having to set. + * @return This builder for chaining. + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return This builder for chaining. + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `state_change` is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The bytes for having to set. + * @return This builder for chaining. + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask fieldMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return fieldMaskBuilder_ != null || fieldMask_ != null; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + onChanged(); + } else { + fieldMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + onChanged(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (fieldMask_ != null) { + fieldMask_ = + com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial(); + } else { + fieldMask_ = value; + } + onChanged(); + } else { + fieldMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFieldMask() { + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + onChanged(); + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequestOrBuilder.java new file mode 100644 index 000000000..a18896dc4 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsRequestOrBuilder.java @@ -0,0 +1,483 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListAssetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following are the allowed field and operator combinations:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following are the allowed field and operator combinations:
+   * * name: `=`
+   * * update_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "update_time = \"2019-06-10T16:07:18-07:00\""
+   *     "update_time = 1560208038000"
+   * * create_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "create_time = \"2019-06-10T16:07:18-07:00\""
+   *     "create_time = 1560208038000"
+   * * iam_policy.policy_blob: `=`, `:`
+   * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * * security_marks.marks: `=`, `:`
+   * * security_center_properties.resource_name: `=`, `:`
+   * * security_center_properties.resource_display_name: `=`, `:`
+   * * security_center_properties.resource_type: `=`, `:`
+   * * security_center_properties.resource_parent: `=`, `:`
+   * * security_center_properties.resource_parent_display_name: `=`, `:`
+   * * security_center_properties.resource_project: `=`, `:`
+   * * security_center_properties.resource_project_display_name: `=`, `:`
+   * * security_center_properties.resource_owners: `=`, `:`
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * update_time
+   * resource_properties
+   * security_marks.marks
+   * security_center_properties.resource_name
+   * security_center_properties.resource_display_name
+   * security_center_properties.resource_parent
+   * security_center_properties.resource_parent_display_name
+   * security_center_properties.resource_project
+   * security_center_properties.resource_project_display_name
+   * security_center_properties.resource_type
+   * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * update_time
+   * resource_properties
+   * security_marks.marks
+   * security_center_properties.resource_name
+   * security_center_properties.resource_display_name
+   * security_center_properties.resource_parent
+   * security_center_properties.resource_parent_display_name
+   * security_center_properties.resource_project
+   * security_center_properties.resource_project_display_name
+   * security_center_properties.resource_type
+   * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `state_change` is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); + + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponse.java new file mode 100644 index 000000000..671f11a4f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponse.java @@ -0,0 +1,2767 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response message for listing assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} + */ +public final class ListAssetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + ListAssetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsResponse.newBuilder() to construct. + private ListAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsResponse() { + listAssetsResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + listAssetsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .ListAssetsResult>(); + mutable_bitField0_ |= 0x00000001; + } + listAssetsResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + listAssetsResults_ = java.util.Collections.unmodifiableList(listAssetsResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.Builder.class); + } + + public interface ListAssetsResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + * + * @return Whether the asset field is set. + */ + boolean hasAsset(); + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + * + * @return The asset. + */ + com.google.cloud.securitycenter.v1p1beta1.Asset getAsset(); + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder getAssetOrBuilder(); + + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return The enum numeric value on the wire for stateChange. + */ + int getStateChangeValue(); + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return The stateChange. + */ + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + getStateChange(); + } + /** + * + * + *
+   * Result containing the Asset and its State.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} + */ + public static final class ListAssetsResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + ListAssetsResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsResult.newBuilder() to construct. + private ListAssetsResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsResult() { + stateChange_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssetsResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder subBuilder = null; + if (asset_ != null) { + subBuilder = asset_.toBuilder(); + } + asset_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Asset.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(asset_); + asset_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + stateChange_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.class, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + .class); + } + + /** + * + * + *
+     * The change in state of the asset.
+     * When querying across two points in time this describes
+     * the change between the two points: ADDED, REMOVED, or ACTIVE.
+     * If there was no compare_duration supplied in the request the state change
+     * will be: UNUSED
+     * 
+ * + * Protobuf enum {@code + * google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange} + */ + public enum StateChange implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + UNUSED(0), + /** + * + * + *
+       * Asset was added between the points in time.
+       * 
+ * + * ADDED = 1; + */ + ADDED(1), + /** + * + * + *
+       * Asset was removed between the points in time.
+       * 
+ * + * REMOVED = 2; + */ + REMOVED(2), + /** + * + * + *
+       * Asset was present at both point(s) in time.
+       * 
+ * + * ACTIVE = 3; + */ + ACTIVE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + public static final int UNUSED_VALUE = 0; + /** + * + * + *
+       * Asset was added between the points in time.
+       * 
+ * + * ADDED = 1; + */ + public static final int ADDED_VALUE = 1; + /** + * + * + *
+       * Asset was removed between the points in time.
+       * 
+ * + * REMOVED = 2; + */ + public static final int REMOVED_VALUE = 2; + /** + * + * + *
+       * Asset was present at both point(s) in time.
+       * 
+ * + * ACTIVE = 3; + */ + public static final int ACTIVE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StateChange valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static StateChange forNumber(int value) { + switch (value) { + case 0: + return UNUSED; + case 1: + return ADDED; + case 2: + return REMOVED; + case 3: + return ACTIVE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StateChange findValueByNumber(int number) { + return StateChange.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final StateChange[] VALUES = values(); + + public static StateChange valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StateChange(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange) + } + + public static final int ASSET_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.Asset asset_; + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + * + * @return Whether the asset field is set. + */ + public boolean hasAsset() { + return asset_ != null; + } + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + * + * @return The asset. + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset getAsset() { + return asset_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.getDefaultInstance() + : asset_; + } + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder getAssetOrBuilder() { + return getAsset(); + } + + public static final int STATE_CHANGE_FIELD_NUMBER = 2; + private int stateChange_; + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return The enum numeric value on the wire for stateChange. + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return The stateChange. + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + result = + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange.valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (asset_ != null) { + output.writeMessage(1, getAsset()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange.UNUSED + .getNumber()) { + output.writeEnum(2, stateChange_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (asset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAsset()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange.UNUSED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stateChange_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult other = + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) obj; + + if (hasAsset() != other.hasAsset()) return false; + if (hasAsset()) { + if (!getAsset().equals(other.getAsset())) return false; + } + if (stateChange_ != other.stateChange_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAsset()) { + hash = (37 * hash) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().hashCode(); + } + hash = (37 * hash) + STATE_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + stateChange_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Result containing the Asset and its State.
+     * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.class, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (assetBuilder_ == null) { + asset_ = null; + } else { + asset_ = null; + assetBuilder_ = null; + } + stateChange_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult build() { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult result = + new com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult(this); + if (assetBuilder_ == null) { + result.asset_ = asset_; + } else { + result.asset_ = assetBuilder_.build(); + } + result.stateChange_ = stateChange_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance()) return this; + if (other.hasAsset()) { + mergeAsset(other.getAsset()); + } + if (other.stateChange_ != 0) { + setStateChangeValue(other.getStateChangeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Asset asset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset, + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder, + com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder> + assetBuilder_; + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + * + * @return Whether the asset field is set. + */ + public boolean hasAsset() { + return assetBuilder_ != null || asset_ != null; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + * + * @return The asset. + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset getAsset() { + if (assetBuilder_ == null) { + return asset_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.getDefaultInstance() + : asset_; + } else { + return assetBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public Builder setAsset(com.google.cloud.securitycenter.v1p1beta1.Asset value) { + if (assetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + asset_ = value; + onChanged(); + } else { + assetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public Builder setAsset( + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder builderForValue) { + if (assetBuilder_ == null) { + asset_ = builderForValue.build(); + onChanged(); + } else { + assetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public Builder mergeAsset(com.google.cloud.securitycenter.v1p1beta1.Asset value) { + if (assetBuilder_ == null) { + if (asset_ != null) { + asset_ = + com.google.cloud.securitycenter.v1p1beta1.Asset.newBuilder(asset_) + .mergeFrom(value) + .buildPartial(); + } else { + asset_ = value; + } + onChanged(); + } else { + assetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public Builder clearAsset() { + if (assetBuilder_ == null) { + asset_ = null; + onChanged(); + } else { + asset_ = null; + assetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Asset.Builder getAssetBuilder() { + + onChanged(); + return getAssetFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder getAssetOrBuilder() { + if (assetBuilder_ != null) { + return assetBuilder_.getMessageOrBuilder(); + } else { + return asset_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Asset.getDefaultInstance() + : asset_; + } + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Asset asset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset, + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder, + com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder> + getAssetFieldBuilder() { + if (assetBuilder_ == null) { + assetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Asset, + com.google.cloud.securitycenter.v1p1beta1.Asset.Builder, + com.google.cloud.securitycenter.v1p1beta1.AssetOrBuilder>( + getAsset(), getParentForChildren(), isClean()); + asset_ = null; + } + return assetBuilder_; + } + + private int stateChange_ = 0; + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return The enum numeric value on the wire for stateChange. + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @param value The enum numeric value on the wire for stateChange to set. + * @return This builder for chaining. + */ + public Builder setStateChangeValue(int value) { + stateChange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return The stateChange. + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + result = + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange.valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .StateChange.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @param value The stateChange to set. + * @return This builder for chaining. + */ + public Builder setStateChange( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + value) { + if (value == null) { + throw new NullPointerException(); + } + + stateChange_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearStateChange() { + + stateChange_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + private static final com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .ListAssetsResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int LIST_ASSETS_RESULTS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult> + listAssetsResults_; + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult> + getListAssetsResultsList() { + return listAssetsResults_; + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .ListAssetsResultOrBuilder> + getListAssetsResultsOrBuilderList() { + return listAssetsResults_; + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public int getListAssetsResultsCount() { + return listAssetsResults_.size(); + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + getListAssetsResults(int index) { + return listAssetsResults_.get(index); + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResultOrBuilder + getListAssetsResultsOrBuilder(int index) { + return listAssetsResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of assets matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < listAssetsResults_.size(); i++) { + output.writeMessage(1, listAssetsResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < listAssetsResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, listAssetsResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse other = + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) obj; + + if (!getListAssetsResultsList().equals(other.getListAssetsResultsList())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getListAssetsResultsCount() > 0) { + hash = (37 * hash) + LIST_ASSETS_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getListAssetsResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for listing assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getListAssetsResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (listAssetsResultsBuilder_ == null) { + listAssetsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + listAssetsResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse build() { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse result = + new com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse(this); + int from_bitField0_ = bitField0_; + if (listAssetsResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + listAssetsResults_ = java.util.Collections.unmodifiableList(listAssetsResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.listAssetsResults_ = listAssetsResults_; + } else { + result.listAssetsResults_ = listAssetsResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.getDefaultInstance()) + return this; + if (listAssetsResultsBuilder_ == null) { + if (!other.listAssetsResults_.isEmpty()) { + if (listAssetsResults_.isEmpty()) { + listAssetsResults_ = other.listAssetsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.addAll(other.listAssetsResults_); + } + onChanged(); + } + } else { + if (!other.listAssetsResults_.isEmpty()) { + if (listAssetsResultsBuilder_.isEmpty()) { + listAssetsResultsBuilder_.dispose(); + listAssetsResultsBuilder_ = null; + listAssetsResults_ = other.listAssetsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + listAssetsResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getListAssetsResultsFieldBuilder() + : null; + } else { + listAssetsResultsBuilder_.addAllMessages(other.listAssetsResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult> + listAssetsResults_ = java.util.Collections.emptyList(); + + private void ensureListAssetsResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + listAssetsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult>( + listAssetsResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResultOrBuilder> + listAssetsResultsBuilder_; + + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult> + getListAssetsResultsList() { + if (listAssetsResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(listAssetsResults_); + } else { + return listAssetsResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public int getListAssetsResultsCount() { + if (listAssetsResultsBuilder_ == null) { + return listAssetsResults_.size(); + } else { + return listAssetsResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + getListAssetsResults(int index) { + if (listAssetsResultsBuilder_ == null) { + return listAssetsResults_.get(index); + } else { + return listAssetsResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder setListAssetsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult value) { + if (listAssetsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListAssetsResultsIsMutable(); + listAssetsResults_.set(index, value); + onChanged(); + } else { + listAssetsResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder setListAssetsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + builderForValue) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.set(index, builderForValue.build()); + onChanged(); + } else { + listAssetsResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult value) { + if (listAssetsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(value); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult value) { + if (listAssetsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(index, value); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + builderForValue) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(builderForValue.build()); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + builderForValue) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(index, builderForValue.build()); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addAllListAssetsResults( + java.lang.Iterable< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult> + values) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, listAssetsResults_); + onChanged(); + } else { + listAssetsResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder clearListAssetsResults() { + if (listAssetsResultsBuilder_ == null) { + listAssetsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + listAssetsResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder removeListAssetsResults(int index) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.remove(index); + onChanged(); + } else { + listAssetsResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + getListAssetsResultsBuilder(int index) { + return getListAssetsResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResultOrBuilder + getListAssetsResultsOrBuilder(int index) { + if (listAssetsResultsBuilder_ == null) { + return listAssetsResults_.get(index); + } else { + return listAssetsResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .ListAssetsResultOrBuilder> + getListAssetsResultsOrBuilderList() { + if (listAssetsResultsBuilder_ != null) { + return listAssetsResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listAssetsResults_); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + addListAssetsResultsBuilder() { + return getListAssetsResultsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder + addListAssetsResultsBuilder(int index) { + return getListAssetsResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder> + getListAssetsResultsBuilderList() { + return getListAssetsResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.Builder, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResultOrBuilder> + getListAssetsResultsFieldBuilder() { + if (listAssetsResultsBuilder_ == null) { + listAssetsResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + .Builder, + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .ListAssetsResultOrBuilder>( + listAssetsResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + listAssetsResults_ = null; + } + return listAssetsResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of assets matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of assets matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of assets matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponseOrBuilder.java new file mode 100644 index 000000000..32908982a --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListAssetsResponseOrBuilder.java @@ -0,0 +1,168 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListAssetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + java.util.List + getListAssetsResultsList(); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + getListAssetsResults(int index); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + int getListAssetsResultsCount(); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + .ListAssetsResultOrBuilder> + getListAssetsResultsOrBuilderList(); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + com.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResultOrBuilder + getListAssetsResultsOrBuilder(int index); + + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of assets matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + int getTotalSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequest.java new file mode 100644 index 000000000..e7492bd8f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequest.java @@ -0,0 +1,2934 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for listing findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} + */ +public final class ListFindingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + ListFindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsRequest.newBuilder() to construct. + private ListFindingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsRequest() { + parent_ = ""; + filter_ = ""; + orderBy_ = ""; + having_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (fieldMask_ != null) { + subBuilder = fieldMask_.toBuilder(); + } + fieldMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fieldMask_); + fieldMask_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * name: `=`
+   * parent: `=`, `:`
+   * resource_name: `=`, `:`
+   * state: `=`, `:`
+   * category: `=`, `:`
+   * external_uri: `=`, `:`
+   * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * security_marks.marks: `=`, `:`
+   * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * name: `=`
+   * parent: `=`, `:`
+   * resource_name: `=`, `:`
+   * state: `=`, `:`
+   * category: `=`, `:`
+   * external_uri: `=`, `:`
+   * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * security_marks.marks: `=`, `:`
+   * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * parent
+   * state
+   * category
+   * resource_name
+   * event_time
+   * source_properties
+   * security_marks.marks
+   * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * parent
+   * state
+   * category
+   * resource_name
+   * event_time
+   * source_properties
+   * security_marks.marks
+   * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELD_MASK_FIELD_NUMBER = 7; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return fieldMask_ != null; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 9; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (compareDuration_ != null) { + output.writeMessage(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (fieldMask_ != null) { + output.writeMessage(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(9, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (hasCompareDuration() != other.hasCompareDuration()) return false; + if (hasCompareDuration()) { + if (!getCompareDuration().equals(other.getCompareDuration())) return false; + } + if (!getHaving().equals(other.getHaving())) return false; + if (hasFieldMask() != other.hasFieldMask()) return false; + if (hasFieldMask()) { + if (!getFieldMask().equals(other.getFieldMask())) return false; + } + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for listing findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + having_ = ""; + + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + result.having_ = having_; + if (fieldMaskBuilder_ == null) { + result.fieldMask_ = fieldMask_; + } else { + result.fieldMask_ = fieldMaskBuilder_.build(); + } + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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/-
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * name: `=`
+     * parent: `=`, `:`
+     * resource_name: `=`, `:`
+     * state: `=`, `:`
+     * category: `=`, `:`
+     * external_uri: `=`, `:`
+     * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * security_marks.marks: `=`, `:`
+     * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * name: `=`
+     * parent: `=`, `:`
+     * resource_name: `=`, `:`
+     * state: `=`, `:`
+     * category: `=`, `:`
+     * external_uri: `=`, `:`
+     * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * security_marks.marks: `=`, `:`
+     * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * name: `=`
+     * parent: `=`, `:`
+     * resource_name: `=`, `:`
+     * state: `=`, `:`
+     * category: `=`, `:`
+     * external_uri: `=`, `:`
+     * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * security_marks.marks: `=`, `:`
+     * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * name: `=`
+     * parent: `=`, `:`
+     * resource_name: `=`, `:`
+     * state: `=`, `:`
+     * category: `=`, `:`
+     * external_uri: `=`, `:`
+     * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * security_marks.marks: `=`, `:`
+     * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * The following field and operator combinations are supported:
+     * name: `=`
+     * parent: `=`, `:`
+     * resource_name: `=`, `:`
+     * state: `=`, `:`
+     * category: `=`, `:`
+     * external_uri: `=`, `:`
+     * event_time: `=`, `>`, `<`, `>=`, `<=`
+     *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+     *   Examples:
+     *     "event_time = \"2019-06-10T16:07:18-07:00\""
+     *     "event_time = 1560208038000"
+     * security_marks.marks: `=`, `:`
+     * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * parent
+     * state
+     * category
+     * resource_name
+     * event_time
+     * source_properties
+     * security_marks.marks
+     * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * parent
+     * state
+     * category
+     * resource_name
+     * event_time
+     * source_properties
+     * security_marks.marks
+     * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * parent
+     * state
+     * category
+     * resource_name
+     * event_time
+     * source_properties
+     * security_marks.marks
+     * 
+ * + * string order_by = 3; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * parent
+     * state
+     * category
+     * resource_name
+     * event_time
+     * source_properties
+     * security_marks.marks
+     * 
+ * + * string order_by = 3; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * The following fields are supported:
+     * name
+     * parent
+     * state
+     * category
+     * resource_name
+     * event_time
+     * source_properties
+     * security_marks.marks
+     * 
+ * + * string order_by = 3; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration compareDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The having. + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The having to set. + * @return This builder for chaining. + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @return This builder for chaining. + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only `finding.state` and `state_change`
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + * + * @param value The bytes for having to set. + * @return This builder for chaining. + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask fieldMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + public boolean hasFieldMask() { + return fieldMaskBuilder_ != null || fieldMask_ != null; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + onChanged(); + } else { + fieldMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + onChanged(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (fieldMask_ != null) { + fieldMask_ = + com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial(); + } else { + fieldMask_ = value; + } + onChanged(); + } else { + fieldMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFieldMask() { + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + onChanged(); + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequestOrBuilder.java new file mode 100644 index 000000000..df4de4ce8 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsRequestOrBuilder.java @@ -0,0 +1,456 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListFindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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/-
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * name: `=`
+   * parent: `=`, `:`
+   * resource_name: `=`, `:`
+   * state: `=`, `:`
+   * category: `=`, `:`
+   * external_uri: `=`, `:`
+   * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * security_marks.marks: `=`, `:`
+   * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * The following field and operator combinations are supported:
+   * name: `=`
+   * parent: `=`, `:`
+   * resource_name: `=`, `:`
+   * state: `=`, `:`
+   * category: `=`, `:`
+   * external_uri: `=`, `:`
+   * event_time: `=`, `>`, `<`, `>=`, `<=`
+   *   Usage: This should be milliseconds since epoch or an RFC3339 string.
+   *   Examples:
+   *     "event_time = \"2019-06-10T16:07:18-07:00\""
+   *     "event_time = 1560208038000"
+   * security_marks.marks: `=`, `:`
+   * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * parent
+   * state
+   * category
+   * resource_name
+   * event_time
+   * source_properties
+   * security_marks.marks
+   * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * The following fields are supported:
+   * name
+   * parent
+   * state
+   * category
+   * resource_name
+   * event_time
+   * source_properties
+   * security_marks.marks
+   * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return Whether the compareDuration field is set. + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + * + * @return The compareDuration. + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The having. + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only `finding.state` and `state_change`
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + * + * @return The bytes for having. + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fieldMask field is set. + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fieldMask. + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); + + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponse.java new file mode 100644 index 000000000..60c72183f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponse.java @@ -0,0 +1,4732 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response message for listing findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} + */ +public final class ListFindingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + ListFindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsResponse.newBuilder() to construct. + private ListFindingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsResponse() { + listFindingsResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + listFindingsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult>(); + mutable_bitField0_ |= 0x00000001; + } + listFindingsResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + listFindingsResults_ = java.util.Collections.unmodifiableList(listFindingsResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.Builder.class); + } + + public interface ListFindingsResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + * + * @return Whether the finding field is set. + */ + boolean hasFinding(); + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + * + * @return The finding. + */ + com.google.cloud.securitycenter.v1p1beta1.Finding getFinding(); + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder(); + + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return The enum numeric value on the wire for stateChange. + */ + int getStateChangeValue(); + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return The stateChange. + */ + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange + getStateChange(); + + /** + * + * + *
+     * Output only. Resource that is associated with this finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+     * Output only. Resource that is associated with this finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + * + * @return The resource. + */ + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + getResource(); + /** + * + * + *
+     * Output only. Resource that is associated with this finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder + getResourceOrBuilder(); + } + /** + * + * + *
+   * Result containing the Finding and its StateChange.
+   * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} + */ + public static final class ListFindingsResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + ListFindingsResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsResult.newBuilder() to construct. + private ListFindingsResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsResult() { + stateChange_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingsResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Finding.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(finding_); + finding_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + stateChange_ = rawValue; + break; + } + case 26: + { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder + subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Builder.class); + } + + /** + * + * + *
+     * The change in state of the finding.
+     * When querying across two points in time this describes
+     * the change in the finding between the two points: CHANGED, UNCHANGED,
+     * ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that
+     * the finding at timestamp does not match the filter specified, but it did
+     * at timestamp - compare_duration. If there was no compare_duration
+     * supplied in the request the state change will be: UNUSED
+     * 
+ * + * Protobuf enum {@code + * google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange} + */ + public enum StateChange implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + UNUSED(0), + /** + * + * + *
+       * The finding has changed state in some way between the points in time
+       * and existed at both points.
+       * 
+ * + * CHANGED = 1; + */ + CHANGED(1), + /** + * + * + *
+       * The finding has not changed state between the points in time and
+       * existed at both points.
+       * 
+ * + * UNCHANGED = 2; + */ + UNCHANGED(2), + /** + * + * + *
+       * The finding was created between the points in time.
+       * 
+ * + * ADDED = 3; + */ + ADDED(3), + /** + * + * + *
+       * The finding at timestamp does not match the filter specified, but it
+       * did at timestamp - compare_duration.
+       * 
+ * + * REMOVED = 4; + */ + REMOVED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + public static final int UNUSED_VALUE = 0; + /** + * + * + *
+       * The finding has changed state in some way between the points in time
+       * and existed at both points.
+       * 
+ * + * CHANGED = 1; + */ + public static final int CHANGED_VALUE = 1; + /** + * + * + *
+       * The finding has not changed state between the points in time and
+       * existed at both points.
+       * 
+ * + * UNCHANGED = 2; + */ + public static final int UNCHANGED_VALUE = 2; + /** + * + * + *
+       * The finding was created between the points in time.
+       * 
+ * + * ADDED = 3; + */ + public static final int ADDED_VALUE = 3; + /** + * + * + *
+       * The finding at timestamp does not match the filter specified, but it
+       * did at timestamp - compare_duration.
+       * 
+ * + * REMOVED = 4; + */ + public static final int REMOVED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StateChange valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static StateChange forNumber(int value) { + switch (value) { + case 0: + return UNUSED; + case 1: + return CHANGED; + case 2: + return UNCHANGED; + case 3: + return ADDED; + case 4: + return REMOVED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StateChange findValueByNumber(int number) { + return StateChange.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final StateChange[] VALUES = values(); + + public static StateChange valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StateChange(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange) + } + + public interface ResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The full resource name of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+       * The full resource name of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+       * The full resource name of project that the resource belongs to.
+       * 
+ * + * string project_name = 2; + * + * @return The projectName. + */ + java.lang.String getProjectName(); + /** + * + * + *
+       * The full resource name of project that the resource belongs to.
+       * 
+ * + * string project_name = 2; + * + * @return The bytes for projectName. + */ + com.google.protobuf.ByteString getProjectNameBytes(); + + /** + * + * + *
+       * The human readable name of project that the resource belongs to.
+       * 
+ * + * string project_display_name = 3; + * + * @return The projectDisplayName. + */ + java.lang.String getProjectDisplayName(); + /** + * + * + *
+       * The human readable name of project that the resource belongs to.
+       * 
+ * + * string project_display_name = 3; + * + * @return The bytes for projectDisplayName. + */ + com.google.protobuf.ByteString getProjectDisplayNameBytes(); + + /** + * + * + *
+       * The full resource name of resource's parent.
+       * 
+ * + * string parent_name = 4; + * + * @return The parentName. + */ + java.lang.String getParentName(); + /** + * + * + *
+       * The full resource name of resource's parent.
+       * 
+ * + * string parent_name = 4; + * + * @return The bytes for parentName. + */ + com.google.protobuf.ByteString getParentNameBytes(); + + /** + * + * + *
+       * The human readable name of resource's parent.
+       * 
+ * + * string parent_display_name = 5; + * + * @return The parentDisplayName. + */ + java.lang.String getParentDisplayName(); + /** + * + * + *
+       * The human readable name of resource's parent.
+       * 
+ * + * string parent_display_name = 5; + * + * @return The bytes for parentDisplayName. + */ + com.google.protobuf.ByteString getParentDisplayNameBytes(); + } + /** + * + * + *
+     * Information related to the Google Cloud Platform (GCP) resource that is
+     * associated with this finding.
+     * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} + */ + public static final class Resource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + ResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Resource.newBuilder() to construct. + private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Resource() { + name_ = ""; + projectName_ = ""; + projectDisplayName_ = ""; + parentName_ = ""; + parentDisplayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Resource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Resource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectDisplayName_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + parentName_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + parentDisplayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+       * The full resource name of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+       * The full resource name of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object projectName_; + /** + * + * + *
+       * The full resource name of project that the resource belongs to.
+       * 
+ * + * string project_name = 2; + * + * @return The projectName. + */ + public java.lang.String getProjectName() { + java.lang.Object ref = projectName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectName_ = s; + return s; + } + } + /** + * + * + *
+       * The full resource name of project that the resource belongs to.
+       * 
+ * + * string project_name = 2; + * + * @return The bytes for projectName. + */ + public com.google.protobuf.ByteString getProjectNameBytes() { + java.lang.Object ref = projectName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_DISPLAY_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object projectDisplayName_; + /** + * + * + *
+       * The human readable name of project that the resource belongs to.
+       * 
+ * + * string project_display_name = 3; + * + * @return The projectDisplayName. + */ + public java.lang.String getProjectDisplayName() { + java.lang.Object ref = projectDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectDisplayName_ = s; + return s; + } + } + /** + * + * + *
+       * The human readable name of project that the resource belongs to.
+       * 
+ * + * string project_display_name = 3; + * + * @return The bytes for projectDisplayName. + */ + public com.google.protobuf.ByteString getProjectDisplayNameBytes() { + java.lang.Object ref = projectDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object parentName_; + /** + * + * + *
+       * The full resource name of resource's parent.
+       * 
+ * + * string parent_name = 4; + * + * @return The parentName. + */ + public java.lang.String getParentName() { + java.lang.Object ref = parentName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentName_ = s; + return s; + } + } + /** + * + * + *
+       * The full resource name of resource's parent.
+       * 
+ * + * string parent_name = 4; + * + * @return The bytes for parentName. + */ + public com.google.protobuf.ByteString getParentNameBytes() { + java.lang.Object ref = parentName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object parentDisplayName_; + /** + * + * + *
+       * The human readable name of resource's parent.
+       * 
+ * + * string parent_display_name = 5; + * + * @return The parentDisplayName. + */ + public java.lang.String getParentDisplayName() { + java.lang.Object ref = parentDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentDisplayName_ = s; + return s; + } + } + /** + * + * + *
+       * The human readable name of resource's parent.
+       * 
+ * + * string parent_display_name = 5; + * + * @return The bytes for parentDisplayName. + */ + public com.google.protobuf.ByteString getParentDisplayNameBytes() { + java.lang.Object ref = parentDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getProjectNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectName_); + } + if (!getProjectDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, projectDisplayName_); + } + if (!getParentNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, parentName_); + } + if (!getParentDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parentDisplayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getProjectNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectName_); + } + if (!getProjectDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, projectDisplayName_); + } + if (!getParentNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, parentName_); + } + if (!getParentDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parentDisplayName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + other = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource) + obj; + + if (!getName().equals(other.getName())) return false; + if (!getProjectName().equals(other.getProjectName())) return false; + if (!getProjectDisplayName().equals(other.getProjectDisplayName())) return false; + if (!getParentName().equals(other.getParentName())) return false; + if (!getParentDisplayName().equals(other.getParentDisplayName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PROJECT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getProjectName().hashCode(); + hash = (37 * hash) + PROJECT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getProjectDisplayName().hashCode(); + hash = (37 * hash) + PARENT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getParentName().hashCode(); + hash = (37 * hash) + PARENT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getParentDisplayName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Information related to the Google Cloud Platform (GCP) resource that is
+       * associated with this finding.
+       * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + projectName_ = ""; + + projectDisplayName_ = ""; + + parentName_ = ""; + + parentDisplayName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + build() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + result = + new com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource(this); + result.name_ = name_; + result.projectName_ = projectName_; + result.projectDisplayName_ = projectDisplayName_; + result.parentName_ = parentName_; + result.parentDisplayName_ = parentDisplayName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getProjectName().isEmpty()) { + projectName_ = other.projectName_; + onChanged(); + } + if (!other.getProjectDisplayName().isEmpty()) { + projectDisplayName_ = other.projectDisplayName_; + onChanged(); + } + if (!other.getParentName().isEmpty()) { + parentName_ = other.parentName_; + onChanged(); + } + if (!other.getParentDisplayName().isEmpty()) { + parentDisplayName_ = other.parentDisplayName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectName_ = ""; + /** + * + * + *
+         * The full resource name of project that the resource belongs to.
+         * 
+ * + * string project_name = 2; + * + * @return The projectName. + */ + public java.lang.String getProjectName() { + java.lang.Object ref = projectName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The full resource name of project that the resource belongs to.
+         * 
+ * + * string project_name = 2; + * + * @return The bytes for projectName. + */ + public com.google.protobuf.ByteString getProjectNameBytes() { + java.lang.Object ref = projectName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The full resource name of project that the resource belongs to.
+         * 
+ * + * string project_name = 2; + * + * @param value The projectName to set. + * @return This builder for chaining. + */ + public Builder setProjectName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of project that the resource belongs to.
+         * 
+ * + * string project_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectName() { + + projectName_ = getDefaultInstance().getProjectName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of project that the resource belongs to.
+         * 
+ * + * string project_name = 2; + * + * @param value The bytes for projectName to set. + * @return This builder for chaining. + */ + public Builder setProjectNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectName_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectDisplayName_ = ""; + /** + * + * + *
+         * The human readable name of project that the resource belongs to.
+         * 
+ * + * string project_display_name = 3; + * + * @return The projectDisplayName. + */ + public java.lang.String getProjectDisplayName() { + java.lang.Object ref = projectDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The human readable name of project that the resource belongs to.
+         * 
+ * + * string project_display_name = 3; + * + * @return The bytes for projectDisplayName. + */ + public com.google.protobuf.ByteString getProjectDisplayNameBytes() { + java.lang.Object ref = projectDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The human readable name of project that the resource belongs to.
+         * 
+ * + * string project_display_name = 3; + * + * @param value The projectDisplayName to set. + * @return This builder for chaining. + */ + public Builder setProjectDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectDisplayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The human readable name of project that the resource belongs to.
+         * 
+ * + * string project_display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearProjectDisplayName() { + + projectDisplayName_ = getDefaultInstance().getProjectDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The human readable name of project that the resource belongs to.
+         * 
+ * + * string project_display_name = 3; + * + * @param value The bytes for projectDisplayName to set. + * @return This builder for chaining. + */ + public Builder setProjectDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectDisplayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object parentName_ = ""; + /** + * + * + *
+         * The full resource name of resource's parent.
+         * 
+ * + * string parent_name = 4; + * + * @return The parentName. + */ + public java.lang.String getParentName() { + java.lang.Object ref = parentName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The full resource name of resource's parent.
+         * 
+ * + * string parent_name = 4; + * + * @return The bytes for parentName. + */ + public com.google.protobuf.ByteString getParentNameBytes() { + java.lang.Object ref = parentName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The full resource name of resource's parent.
+         * 
+ * + * string parent_name = 4; + * + * @param value The parentName to set. + * @return This builder for chaining. + */ + public Builder setParentName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parentName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of resource's parent.
+         * 
+ * + * string parent_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearParentName() { + + parentName_ = getDefaultInstance().getParentName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of resource's parent.
+         * 
+ * + * string parent_name = 4; + * + * @param value The bytes for parentName to set. + * @return This builder for chaining. + */ + public Builder setParentNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parentName_ = value; + onChanged(); + return this; + } + + private java.lang.Object parentDisplayName_ = ""; + /** + * + * + *
+         * The human readable name of resource's parent.
+         * 
+ * + * string parent_display_name = 5; + * + * @return The parentDisplayName. + */ + public java.lang.String getParentDisplayName() { + java.lang.Object ref = parentDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The human readable name of resource's parent.
+         * 
+ * + * string parent_display_name = 5; + * + * @return The bytes for parentDisplayName. + */ + public com.google.protobuf.ByteString getParentDisplayNameBytes() { + java.lang.Object ref = parentDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The human readable name of resource's parent.
+         * 
+ * + * string parent_display_name = 5; + * + * @param value The parentDisplayName to set. + * @return This builder for chaining. + */ + public Builder setParentDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parentDisplayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The human readable name of resource's parent.
+         * 
+ * + * string parent_display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearParentDisplayName() { + + parentDisplayName_ = getDefaultInstance().getParentDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The human readable name of resource's parent.
+         * 
+ * + * string parent_display_name = 5; + * + * @param value The bytes for parentDisplayName to set. + * @return This builder for chaining. + */ + public Builder setParentDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parentDisplayName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + private static final com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult.Resource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Resource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Resource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FINDING_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.Finding finding_; + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return finding_ != null; + } + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + return getFinding(); + } + + public static final int STATE_CHANGE_FIELD_NUMBER = 2; + private int stateChange_; + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return The enum numeric value on the wire for stateChange. + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return The stateChange. + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange + result = + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange.valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange.UNRECOGNIZED + : result; + } + + public static final int RESOURCE_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + resource_; + /** + * + * + *
+     * Output only. Resource that is associated with this finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return resource_ != null; + } + /** + * + * + *
+     * Output only. Resource that is associated with this finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + * + * @return The resource. + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + getResource() { + return resource_ == null + ? com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.getDefaultInstance() + : resource_; + } + /** + * + * + *
+     * Output only. Resource that is associated with this finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder + getResourceOrBuilder() { + return getResource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (finding_ != null) { + output.writeMessage(1, getFinding()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange.UNUSED + .getNumber()) { + output.writeEnum(2, stateChange_); + } + if (resource_ != null) { + output.writeMessage(3, getResource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (finding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFinding()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange.UNUSED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stateChange_); + } + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult other = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) obj; + + if (hasFinding() != other.hasFinding()) return false; + if (hasFinding()) { + if (!getFinding().equals(other.getFinding())) return false; + } + if (stateChange_ != other.stateChange_) return false; + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFinding()) { + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + } + hash = (37 * hash) + STATE_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + stateChange_; + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Result containing the Finding and its StateChange.
+     * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingBuilder_ == null) { + finding_ = null; + } else { + finding_ = null; + findingBuilder_ = null; + } + stateChange_ = 0; + + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + build() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult result = + new com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult( + this); + if (findingBuilder_ == null) { + result.finding_ = finding_; + } else { + result.finding_ = findingBuilder_.build(); + } + result.stateChange_ = stateChange_; + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance()) return this; + if (other.hasFinding()) { + mergeFinding(other.getFinding()); + } + if (other.stateChange_ != 0) { + setStateChangeValue(other.getStateChangeValue()); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Finding finding_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return findingBuilder_ != null || finding_ != null; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } else { + return findingBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finding_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + finding_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1p1beta1.Finding.newBuilder(finding_) + .mergeFrom(value) + .buildPartial(); + } else { + finding_ = value; + } + onChanged(); + } else { + findingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + finding_ = null; + onChanged(); + } else { + finding_ = null; + findingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.Builder getFindingBuilder() { + + onChanged(); + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder>( + getFinding(), getParentForChildren(), isClean()); + finding_ = null; + } + return findingBuilder_; + } + + private int stateChange_ = 0; + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return The enum numeric value on the wire for stateChange. + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @param value The enum numeric value on the wire for stateChange to set. + * @return This builder for chaining. + */ + public Builder setStateChangeValue(int value) { + stateChange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return The stateChange. + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange + result = + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange.valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @param value The stateChange to set. + * @return This builder for chaining. + */ + public Builder setStateChange( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .StateChange + value) { + if (value == null) { + throw new NullPointerException(); + } + + stateChange_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearStateChange() { + + stateChange_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder> + resourceBuilder_; + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + * + * @return The resource. + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource + getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public Builder setResource( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public Builder setResource( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + .Builder + builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public Builder mergeResource( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.newBuilder(resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder + getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder + getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.getDefaultInstance() + : resource_; + } + } + /** + * + * + *
+       * Output only. Resource that is associated with this finding.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource resource = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Resource.Builder, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder>(getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + private static final com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int LIST_FINDINGS_RESULTS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult> + listFindingsResults_; + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult> + getListFindingsResultsList() { + return listFindingsResults_; + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder> + getListFindingsResultsOrBuilderList() { + return listFindingsResults_; + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public int getListFindingsResultsCount() { + return listFindingsResults_.size(); + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + getListFindingsResults(int index) { + return listFindingsResults_.get(index); + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResultOrBuilder + getListFindingsResultsOrBuilder(int index) { + return listFindingsResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of findings matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < listFindingsResults_.size(); i++) { + output.writeMessage(1, listFindingsResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < listFindingsResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, listFindingsResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse other = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) obj; + + if (!getListFindingsResultsList().equals(other.getListFindingsResultsList())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (getTotalSize() != other.getTotalSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getListFindingsResultsCount() > 0) { + hash = (37 * hash) + LIST_FINDINGS_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getListFindingsResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for listing findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getListFindingsResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (listFindingsResultsBuilder_ == null) { + listFindingsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + listFindingsResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse build() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse result = + new com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse(this); + int from_bitField0_ = bitField0_; + if (listFindingsResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + listFindingsResults_ = java.util.Collections.unmodifiableList(listFindingsResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.listFindingsResults_ = listFindingsResults_; + } else { + result.listFindingsResults_ = listFindingsResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.getDefaultInstance()) + return this; + if (listFindingsResultsBuilder_ == null) { + if (!other.listFindingsResults_.isEmpty()) { + if (listFindingsResults_.isEmpty()) { + listFindingsResults_ = other.listFindingsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.addAll(other.listFindingsResults_); + } + onChanged(); + } + } else { + if (!other.listFindingsResults_.isEmpty()) { + if (listFindingsResultsBuilder_.isEmpty()) { + listFindingsResultsBuilder_.dispose(); + listFindingsResultsBuilder_ = null; + listFindingsResults_ = other.listFindingsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + listFindingsResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getListFindingsResultsFieldBuilder() + : null; + } else { + listFindingsResultsBuilder_.addAllMessages(other.listFindingsResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult> + listFindingsResults_ = java.util.Collections.emptyList(); + + private void ensureListFindingsResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + listFindingsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult>( + listFindingsResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Builder, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder> + listFindingsResultsBuilder_; + + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult> + getListFindingsResultsList() { + if (listFindingsResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(listFindingsResults_); + } else { + return listFindingsResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public int getListFindingsResultsCount() { + if (listFindingsResultsBuilder_ == null) { + return listFindingsResults_.size(); + } else { + return listFindingsResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + getListFindingsResults(int index) { + if (listFindingsResultsBuilder_ == null) { + return listFindingsResults_.get(index); + } else { + return listFindingsResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder setListFindingsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult value) { + if (listFindingsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListFindingsResultsIsMutable(); + listFindingsResults_.set(index, value); + onChanged(); + } else { + listFindingsResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder setListFindingsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Builder + builderForValue) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.set(index, builderForValue.build()); + onChanged(); + } else { + listFindingsResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult value) { + if (listFindingsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(value); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult value) { + if (listFindingsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(index, value); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Builder + builderForValue) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(builderForValue.build()); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + int index, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Builder + builderForValue) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(index, builderForValue.build()); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addAllListFindingsResults( + java.lang.Iterable< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResult> + values) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, listFindingsResults_); + onChanged(); + } else { + listFindingsResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder clearListFindingsResults() { + if (listFindingsResultsBuilder_ == null) { + listFindingsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + listFindingsResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder removeListFindingsResults(int index) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.remove(index); + onChanged(); + } else { + listFindingsResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Builder + getListFindingsResultsBuilder(int index) { + return getListFindingsResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder + getListFindingsResultsOrBuilder(int index) { + if (listFindingsResultsBuilder_ == null) { + return listFindingsResults_.get(index); + } else { + return listFindingsResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder> + getListFindingsResultsOrBuilderList() { + if (listFindingsResultsBuilder_ != null) { + return listFindingsResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listFindingsResults_); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Builder + addListFindingsResultsBuilder() { + return getListFindingsResultsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Builder + addListFindingsResultsBuilder(int index) { + return getListFindingsResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Builder> + getListFindingsResultsBuilderList() { + return getListFindingsResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Builder, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder> + getListFindingsResultsFieldBuilder() { + if (listFindingsResultsBuilder_ == null) { + listFindingsResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + .Builder, + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder>( + listFindingsResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + listFindingsResults_ = null; + } + return listFindingsResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of findings matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of findings matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @param value The totalSize to set. + * @return This builder for chaining. + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of findings matching the query.
+     * 
+ * + * int32 total_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponseOrBuilder.java new file mode 100644 index 000000000..ff89f0575 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListFindingsResponseOrBuilder.java @@ -0,0 +1,168 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListFindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + java.util.List + getListFindingsResultsList(); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + getListFindingsResults(int index); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + int getListFindingsResultsCount(); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + .ListFindingsResultOrBuilder> + getListFindingsResultsOrBuilderList(); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + com.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResultOrBuilder + getListFindingsResultsOrBuilder(int index); + + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of findings matching the query.
+   * 
+ * + * int32 total_size = 4; + * + * @return The totalSize. + */ + int getTotalSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequest.java new file mode 100644 index 000000000..a34adaa88 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequest.java @@ -0,0 +1,956 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for listing notification configs.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} + */ +public final class ListNotificationConfigsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + ListNotificationConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNotificationConfigsRequest.newBuilder() to construct. + private ListNotificationConfigsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNotificationConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNotificationConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListNotificationConfigsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the organization to list notification configs.
+   * Its format is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the organization to list notification configs.
+   * Its format is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListNotificationConfigsResponse`; indicates
+   * that this is a continuation of a prior `ListNotificationConfigs` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListNotificationConfigsResponse`; indicates
+   * that this is a continuation of a prior `ListNotificationConfigs` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for listing notification configs.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the organization to list notification configs.
+     * Its format is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to list notification configs.
+     * Its format is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to list notification configs.
+     * Its format is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to list notification configs.
+     * Its format is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to list notification configs.
+     * Its format is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListNotificationConfigsResponse`; indicates
+     * that this is a continuation of a prior `ListNotificationConfigs` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListNotificationConfigsResponse`; indicates
+     * that this is a continuation of a prior `ListNotificationConfigs` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListNotificationConfigsResponse`; indicates
+     * that this is a continuation of a prior `ListNotificationConfigs` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListNotificationConfigsResponse`; indicates
+     * that this is a continuation of a prior `ListNotificationConfigs` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListNotificationConfigsResponse`; indicates
+     * that this is a continuation of a prior `ListNotificationConfigs` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNotificationConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNotificationConfigsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequestOrBuilder.java new file mode 100644 index 000000000..a7852641f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListNotificationConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the organization to list notification configs.
+   * Its format is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the organization to list notification configs.
+   * Its format is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The value returned by the last `ListNotificationConfigsResponse`; indicates
+   * that this is a continuation of a prior `ListNotificationConfigs` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListNotificationConfigsResponse`; indicates
+   * that this is a continuation of a prior `ListNotificationConfigs` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponse.java new file mode 100644 index 000000000..62ec19636 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponse.java @@ -0,0 +1,1226 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response message for listing notification configs.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} + */ +public final class ListNotificationConfigsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + ListNotificationConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNotificationConfigsResponse.newBuilder() to construct. + private ListNotificationConfigsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNotificationConfigsResponse() { + notificationConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNotificationConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListNotificationConfigsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + notificationConfigs_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig>(); + mutable_bitField0_ |= 0x00000001; + } + notificationConfigs_.add( + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + notificationConfigs_ = java.util.Collections.unmodifiableList(notificationConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.Builder + .class); + } + + public static final int NOTIFICATION_CONFIGS_FIELD_NUMBER = 1; + private java.util.List + notificationConfigs_; + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public java.util.List + getNotificationConfigsList() { + return notificationConfigs_; + } + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + getNotificationConfigsOrBuilderList() { + return notificationConfigs_; + } + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public int getNotificationConfigsCount() { + return notificationConfigs_.size(); + } + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfigs( + int index) { + return notificationConfigs_.get(index); + } + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigsOrBuilder(int index) { + return notificationConfigs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < notificationConfigs_.size(); i++) { + output.writeMessage(1, notificationConfigs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < notificationConfigs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, notificationConfigs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse other = + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) obj; + + if (!getNotificationConfigsList().equals(other.getNotificationConfigsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNotificationConfigsCount() > 0) { + hash = (37 * hash) + NOTIFICATION_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getNotificationConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for listing notification configs.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNotificationConfigsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (notificationConfigsBuilder_ == null) { + notificationConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + notificationConfigsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse build() { + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse result = + new com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse(this); + int from_bitField0_ = bitField0_; + if (notificationConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + notificationConfigs_ = java.util.Collections.unmodifiableList(notificationConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.notificationConfigs_ = notificationConfigs_; + } else { + result.notificationConfigs_ = notificationConfigsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + .getDefaultInstance()) return this; + if (notificationConfigsBuilder_ == null) { + if (!other.notificationConfigs_.isEmpty()) { + if (notificationConfigs_.isEmpty()) { + notificationConfigs_ = other.notificationConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.addAll(other.notificationConfigs_); + } + onChanged(); + } + } else { + if (!other.notificationConfigs_.isEmpty()) { + if (notificationConfigsBuilder_.isEmpty()) { + notificationConfigsBuilder_.dispose(); + notificationConfigsBuilder_ = null; + notificationConfigs_ = other.notificationConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + notificationConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNotificationConfigsFieldBuilder() + : null; + } else { + notificationConfigsBuilder_.addAllMessages(other.notificationConfigs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + notificationConfigs_ = java.util.Collections.emptyList(); + + private void ensureNotificationConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + notificationConfigs_ = + new java.util.ArrayList( + notificationConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + notificationConfigsBuilder_; + + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public java.util.List + getNotificationConfigsList() { + if (notificationConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(notificationConfigs_); + } else { + return notificationConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public int getNotificationConfigsCount() { + if (notificationConfigsBuilder_ == null) { + return notificationConfigs_.size(); + } else { + return notificationConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfigs( + int index) { + if (notificationConfigsBuilder_ == null) { + return notificationConfigs_.get(index); + } else { + return notificationConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder setNotificationConfigs( + int index, com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationConfigsIsMutable(); + notificationConfigs_.set(index, value); + onChanged(); + } else { + notificationConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder setNotificationConfigs( + int index, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder builderForValue) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + notificationConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder addNotificationConfigs( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(value); + onChanged(); + } else { + notificationConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder addNotificationConfigs( + int index, com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(index, value); + onChanged(); + } else { + notificationConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder addNotificationConfigs( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder builderForValue) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(builderForValue.build()); + onChanged(); + } else { + notificationConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder addNotificationConfigs( + int index, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder builderForValue) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + notificationConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder addAllNotificationConfigs( + java.lang.Iterable + values) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notificationConfigs_); + onChanged(); + } else { + notificationConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder clearNotificationConfigs() { + if (notificationConfigsBuilder_ == null) { + notificationConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + notificationConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public Builder removeNotificationConfigs(int index) { + if (notificationConfigsBuilder_ == null) { + ensureNotificationConfigsIsMutable(); + notificationConfigs_.remove(index); + onChanged(); + } else { + notificationConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder + getNotificationConfigsBuilder(int index) { + return getNotificationConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigsOrBuilder(int index) { + if (notificationConfigsBuilder_ == null) { + return notificationConfigs_.get(index); + } else { + return notificationConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + getNotificationConfigsOrBuilderList() { + if (notificationConfigsBuilder_ != null) { + return notificationConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(notificationConfigs_); + } + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder + addNotificationConfigsBuilder() { + return getNotificationConfigsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder + addNotificationConfigsBuilder(int index) { + return getNotificationConfigsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Notification configs belonging to the requested parent.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + public java.util.List + getNotificationConfigsBuilderList() { + return getNotificationConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + getNotificationConfigsFieldBuilder() { + if (notificationConfigsBuilder_ == null) { + notificationConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder>( + notificationConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + notificationConfigs_ = null; + } + return notificationConfigsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNotificationConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNotificationConfigsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponseOrBuilder.java new file mode 100644 index 000000000..f36db4e0f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListNotificationConfigsResponseOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListNotificationConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + java.util.List + getNotificationConfigsList(); + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfigs(int index); + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + int getNotificationConfigsCount(); + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + java.util.List + getNotificationConfigsOrBuilderList(); + /** + * + * + *
+   * Notification configs belonging to the requested parent.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_configs = 1; + * + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequest.java new file mode 100644 index 000000000..e02572803 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequest.java @@ -0,0 +1,942 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for listing sources.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} + */ +public final class ListSourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + ListSourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSourcesRequest.newBuilder() to construct. + private ListSourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSourcesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSourcesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSourcesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 56: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Resource name of the parent of sources to list. Its format should
+   * be "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name of the parent of sources to list. Its format should
+   * be "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 7; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(7, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest other = + (com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for listing sources.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.class, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest build() { + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest result = + new com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Resource name of the parent of sources to list. Its format should
+     * be "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the parent of sources to list. Its format should
+     * be "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name of the parent of sources to list. Its format should
+     * be "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the parent of sources to list. Its format should
+     * be "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name of the parent of sources to list. Its format should
+     * be "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 7; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 7; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSourcesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSourcesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequestOrBuilder.java new file mode 100644 index 000000000..e10988047 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListSourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name of the parent of sources to list. Its format should
+   * be "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Resource name of the parent of sources to list. Its format should
+   * be "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 7; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponse.java new file mode 100644 index 000000000..e816b801e --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponse.java @@ -0,0 +1,1138 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response message for listing sources.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} + */ +public final class ListSourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + ListSourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSourcesResponse.newBuilder() to construct. + private ListSourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSourcesResponse() { + sources_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSourcesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSourcesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sources_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + sources_.add( + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Source.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sources_ = java.util.Collections.unmodifiableList(sources_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.Builder.class); + } + + public static final int SOURCES_FIELD_NUMBER = 1; + private java.util.List sources_; + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public java.util.List getSourcesList() { + return sources_; + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public java.util.List + getSourcesOrBuilderList() { + return sources_; + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public int getSourcesCount() { + return sources_.size(); + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSources(int index) { + return sources_.get(index); + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourcesOrBuilder(int index) { + return sources_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < sources_.size(); i++) { + output.writeMessage(1, sources_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sources_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse other = + (com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) obj; + + if (!getSourcesList().equals(other.getSourcesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSourcesCount() > 0) { + hash = (37 * hash) + SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getSourcesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for listing sources.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.class, + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSourcesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sourcesBuilder_ == null) { + sources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sourcesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse build() { + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse result = + new com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse(this); + int from_bitField0_ = bitField0_; + if (sourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sources_ = java.util.Collections.unmodifiableList(sources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sources_ = sources_; + } else { + result.sources_ = sourcesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.getDefaultInstance()) + return this; + if (sourcesBuilder_ == null) { + if (!other.sources_.isEmpty()) { + if (sources_.isEmpty()) { + sources_ = other.sources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSourcesIsMutable(); + sources_.addAll(other.sources_); + } + onChanged(); + } + } else { + if (!other.sources_.isEmpty()) { + if (sourcesBuilder_.isEmpty()) { + sourcesBuilder_.dispose(); + sourcesBuilder_ = null; + sources_ = other.sources_; + bitField0_ = (bitField0_ & ~0x00000001); + sourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSourcesFieldBuilder() + : null; + } else { + sourcesBuilder_.addAllMessages(other.sources_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List sources_ = + java.util.Collections.emptyList(); + + private void ensureSourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sources_ = + new java.util.ArrayList(sources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder> + sourcesBuilder_; + + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public java.util.List getSourcesList() { + if (sourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(sources_); + } else { + return sourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public int getSourcesCount() { + if (sourcesBuilder_ == null) { + return sources_.size(); + } else { + return sourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSources(int index) { + if (sourcesBuilder_ == null) { + return sources_.get(index); + } else { + return sourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder setSources(int index, com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.set(index, value); + onChanged(); + } else { + sourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder setSources( + int index, com.google.cloud.securitycenter.v1p1beta1.Source.Builder builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.set(index, builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder addSources(com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.add(value); + onChanged(); + } else { + sourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder addSources(int index, com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.add(index, value); + onChanged(); + } else { + sourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder addSources( + com.google.cloud.securitycenter.v1p1beta1.Source.Builder builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.add(builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder addSources( + int index, com.google.cloud.securitycenter.v1p1beta1.Source.Builder builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.add(index, builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder addAllSources( + java.lang.Iterable values) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sources_); + onChanged(); + } else { + sourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder clearSources() { + if (sourcesBuilder_ == null) { + sources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public Builder removeSources(int index) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.remove(index); + onChanged(); + } else { + sourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Source.Builder getSourcesBuilder(int index) { + return getSourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourcesOrBuilder( + int index) { + if (sourcesBuilder_ == null) { + return sources_.get(index); + } else { + return sourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public java.util.List + getSourcesOrBuilderList() { + if (sourcesBuilder_ != null) { + return sourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sources_); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Source.Builder addSourcesBuilder() { + return getSourcesFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance()); + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1p1beta1.Source.Builder addSourcesBuilder(int index) { + return getSourcesFieldBuilder() + .addBuilder(index, com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance()); + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + public java.util.List + getSourcesBuilderList() { + return getSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder> + getSourcesFieldBuilder() { + if (sourcesBuilder_ == null) { + sourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder>( + sources_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sources_ = null; + } + return sourcesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSourcesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSourcesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponseOrBuilder.java new file mode 100644 index 000000000..592f0792c --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/ListSourcesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface ListSourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + java.util.List getSourcesList(); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.Source getSources(int index); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + int getSourcesCount(); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + java.util.List + getSourcesOrBuilderList(); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1p1beta1.Source sources = 1; + */ + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourcesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfig.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfig.java new file mode 100644 index 000000000..0f12ffce9 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfig.java @@ -0,0 +1,2757 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/notification_config.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Cloud Security Command Center (Cloud SCC) notification configs.
+ * A notification config is a Cloud SCC resource that contains the configuration
+ * to send notifications for create/update events of findings, assets and etc.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.NotificationConfig} + */ +public final class NotificationConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.NotificationConfig) + NotificationConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NotificationConfig.newBuilder() to construct. + private NotificationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NotificationConfig() { + name_ = ""; + description_ = ""; + eventType_ = 0; + pubsubTopic_ = ""; + serviceAccount_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NotificationConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + eventType_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubTopic_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccount_ = s; + break; + } + case 50: + { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder + subBuilder = null; + if (notifyConfigCase_ == 6) { + subBuilder = + ((com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_) + .toBuilder(); + } + notifyConfig_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_); + notifyConfig_ = subBuilder.buildPartial(); + } + notifyConfigCase_ = 6; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.class, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder.class); + } + + /** + * + * + *
+   * The type of events.
+   * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType} + */ + public enum EventType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified event type.
+     * 
+ * + * EVENT_TYPE_UNSPECIFIED = 0; + */ + EVENT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Events for findings.
+     * 
+ * + * FINDING = 1; + */ + FINDING(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified event type.
+     * 
+ * + * EVENT_TYPE_UNSPECIFIED = 0; + */ + public static final int EVENT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Events for findings.
+     * 
+ * + * FINDING = 1; + */ + public static final int FINDING_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static EventType forNumber(int value) { + switch (value) { + case 0: + return EVENT_TYPE_UNSPECIFIED; + case 1: + return FINDING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EventType findValueByNumber(int number) { + return EventType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EventType[] VALUES = values(); + + public static EventType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private EventType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType) + } + + public interface StreamingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Expression that defines the filter to apply across create/update events
+     * of assets or findings as specified by the event type. The expression is a
+     * list of zero or more restrictions combined via logical operators `AND`
+     * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+     * `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a
+     * `-` character in front of them to indicate negation. The fields map to
+     * those defined in the corresponding resource.
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * 
+ * + * string filter = 1; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+     * Expression that defines the filter to apply across create/update events
+     * of assets or findings as specified by the event type. The expression is a
+     * list of zero or more restrictions combined via logical operators `AND`
+     * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+     * `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a
+     * `-` character in front of them to indicate negation. The fields map to
+     * those defined in the corresponding resource.
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + } + /** + * + * + *
+   * The config for streaming-based notifications, which send each event as soon
+   * as it is detected.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} + */ + public static final class StreamingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + StreamingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingConfig.newBuilder() to construct. + private StreamingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingConfig() { + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.class, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder + .class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + private volatile java.lang.Object filter_; + /** + * + * + *
+     * Expression that defines the filter to apply across create/update events
+     * of assets or findings as specified by the event type. The expression is a
+     * list of zero or more restrictions combined via logical operators `AND`
+     * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+     * `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a
+     * `-` character in front of them to indicate negation. The fields map to
+     * those defined in the corresponding resource.
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * 
+ * + * string filter = 1; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across create/update events
+     * of assets or findings as specified by the event type. The expression is a
+     * list of zero or more restrictions combined via logical operators `AND`
+     * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+     * `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a
+     * `-` character in front of them to indicate negation. The fields map to
+     * those defined in the corresponding resource.
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig other = + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The config for streaming-based notifications, which send each event as soon
+     * as it is detected.
+     * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.class, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig build() { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig result = + new com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig(this); + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance()) return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+       * Expression that defines the filter to apply across create/update events
+       * of assets or findings as specified by the event type. The expression is a
+       * list of zero or more restrictions combined via logical operators `AND`
+       * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+       * `AND`.
+       * Restrictions have the form `<field> <operator> <value>` and may have a
+       * `-` character in front of them to indicate negation. The fields map to
+       * those defined in the corresponding resource.
+       * The supported operators are:
+       * * `=` for all value types.
+       * * `>`, `<`, `>=`, `<=` for integer values.
+       * * `:`, meaning substring matching, for strings.
+       * The supported value types are:
+       * * string literals in quotes.
+       * * integer literals without quotes.
+       * * boolean literals `true` and `false` without quotes.
+       * 
+ * + * string filter = 1; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Expression that defines the filter to apply across create/update events
+       * of assets or findings as specified by the event type. The expression is a
+       * list of zero or more restrictions combined via logical operators `AND`
+       * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+       * `AND`.
+       * Restrictions have the form `<field> <operator> <value>` and may have a
+       * `-` character in front of them to indicate negation. The fields map to
+       * those defined in the corresponding resource.
+       * The supported operators are:
+       * * `=` for all value types.
+       * * `>`, `<`, `>=`, `<=` for integer values.
+       * * `:`, meaning substring matching, for strings.
+       * The supported value types are:
+       * * string literals in quotes.
+       * * integer literals without quotes.
+       * * boolean literals `true` and `false` without quotes.
+       * 
+ * + * string filter = 1; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Expression that defines the filter to apply across create/update events
+       * of assets or findings as specified by the event type. The expression is a
+       * list of zero or more restrictions combined via logical operators `AND`
+       * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+       * `AND`.
+       * Restrictions have the form `<field> <operator> <value>` and may have a
+       * `-` character in front of them to indicate negation. The fields map to
+       * those defined in the corresponding resource.
+       * The supported operators are:
+       * * `=` for all value types.
+       * * `>`, `<`, `>=`, `<=` for integer values.
+       * * `:`, meaning substring matching, for strings.
+       * The supported value types are:
+       * * string literals in quotes.
+       * * integer literals without quotes.
+       * * boolean literals `true` and `false` without quotes.
+       * 
+ * + * string filter = 1; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Expression that defines the filter to apply across create/update events
+       * of assets or findings as specified by the event type. The expression is a
+       * list of zero or more restrictions combined via logical operators `AND`
+       * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+       * `AND`.
+       * Restrictions have the form `<field> <operator> <value>` and may have a
+       * `-` character in front of them to indicate negation. The fields map to
+       * those defined in the corresponding resource.
+       * The supported operators are:
+       * * `=` for all value types.
+       * * `>`, `<`, `>=`, `<=` for integer values.
+       * * `:`, meaning substring matching, for strings.
+       * The supported value types are:
+       * * string literals in quotes.
+       * * integer literals without quotes.
+       * * boolean literals `true` and `false` without quotes.
+       * 
+ * + * string filter = 1; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+       * Expression that defines the filter to apply across create/update events
+       * of assets or findings as specified by the event type. The expression is a
+       * list of zero or more restrictions combined via logical operators `AND`
+       * and `OR`. Parentheses are supported, and `OR` has higher precedence than
+       * `AND`.
+       * Restrictions have the form `<field> <operator> <value>` and may have a
+       * `-` character in front of them to indicate negation. The fields map to
+       * those defined in the corresponding resource.
+       * The supported operators are:
+       * * `=` for all value types.
+       * * `>`, `<`, `>=`, `<=` for integer values.
+       * * `:`, meaning substring matching, for strings.
+       * The supported value types are:
+       * * string literals in quotes.
+       * * integer literals without quotes.
+       * * boolean literals `true` and `false` without quotes.
+       * 
+ * + * string filter = 1; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + private static final com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + .StreamingConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int notifyConfigCase_ = 0; + private java.lang.Object notifyConfig_; + + public enum NotifyConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STREAMING_CONFIG(6), + NOTIFYCONFIG_NOT_SET(0); + private final int value; + + private NotifyConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NotifyConfigCase valueOf(int value) { + return forNumber(value); + } + + public static NotifyConfigCase forNumber(int value) { + switch (value) { + case 6: + return STREAMING_CONFIG; + case 0: + return NOTIFYCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public NotifyConfigCase getNotifyConfigCase() { + return NotifyConfigCase.forNumber(notifyConfigCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this notification config. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of this notification config. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the notification config (max of 1024 characters).
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The description of the notification config (max of 1024 characters).
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 3; + private int eventType_; + /** + * + * + *
+   * The type of events the config is for, e.g. FINDING.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return The enum numeric value on the wire for eventType. + */ + public int getEventTypeValue() { + return eventType_; + } + /** + * + * + *
+   * The type of events the config is for, e.g. FINDING.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return The eventType. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType getEventType() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType result = + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType.valueOf(eventType_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType.UNRECOGNIZED + : result; + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 4; + private volatile java.lang.Object pubsubTopic_; + /** + * + * + *
+   * The PubSub topic to send notifications to. Its format is
+   * "projects/[project_id]/topics/[topic]".
+   * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * The PubSub topic to send notifications to. Its format is
+   * "projects/[project_id]/topics/[topic]".
+   * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 5; + private volatile java.lang.Object serviceAccount_; + /** + * + * + *
+   * Output only. The service account that needs "pubsub.topics.publish"
+   * permission to publish to the PubSub topic.
+   * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The service account that needs "pubsub.topics.publish"
+   * permission to publish to the PubSub topic.
+   * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STREAMING_CONFIG_FIELD_NUMBER = 6; + /** + * + * + *
+   * The config for triggering streaming-based notifications.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + * + * @return Whether the streamingConfig field is set. + */ + public boolean hasStreamingConfig() { + return notifyConfigCase_ == 6; + } + /** + * + * + *
+   * The config for triggering streaming-based notifications.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + * + * @return The streamingConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + getStreamingConfig() { + if (notifyConfigCase_ == 6) { + return (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_; + } + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } + /** + * + * + *
+   * The config for triggering streaming-based notifications.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigOrBuilder + getStreamingConfigOrBuilder() { + if (notifyConfigCase_ == 6) { + return (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_; + } + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (eventType_ + != com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType + .EVENT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, eventType_); + } + if (!getPubsubTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pubsubTopic_); + } + if (!getServiceAccountBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceAccount_); + } + if (notifyConfigCase_ == 6) { + output.writeMessage( + 6, + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (eventType_ + != com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType + .EVENT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, eventType_); + } + if (!getPubsubTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pubsubTopic_); + } + if (!getServiceAccountBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serviceAccount_); + } + if (notifyConfigCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.NotificationConfig)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig other = + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (eventType_ != other.eventType_) return false; + if (!getPubsubTopic().equals(other.getPubsubTopic())) return false; + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (!getNotifyConfigCase().equals(other.getNotifyConfigCase())) return false; + switch (notifyConfigCase_) { + case 6: + if (!getStreamingConfig().equals(other.getStreamingConfig())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + eventType_; + hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTopic().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + switch (notifyConfigCase_) { + case 6: + hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getStreamingConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Cloud Security Command Center (Cloud SCC) notification configs.
+   * A notification config is a Cloud SCC resource that contains the configuration
+   * to send notifications for create/update events of findings, assets and etc.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.NotificationConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.NotificationConfig) + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.class, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + eventType_ = 0; + + pubsubTopic_ = ""; + + serviceAccount_ = ""; + + notifyConfigCase_ = 0; + notifyConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig build() { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig result = + new com.google.cloud.securitycenter.v1p1beta1.NotificationConfig(this); + result.name_ = name_; + result.description_ = description_; + result.eventType_ = eventType_; + result.pubsubTopic_ = pubsubTopic_; + result.serviceAccount_ = serviceAccount_; + if (notifyConfigCase_ == 6) { + if (streamingConfigBuilder_ == null) { + result.notifyConfig_ = notifyConfig_; + } else { + result.notifyConfig_ = streamingConfigBuilder_.build(); + } + } + result.notifyConfigCase_ = notifyConfigCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.NotificationConfig) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.NotificationConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.NotificationConfig other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.eventType_ != 0) { + setEventTypeValue(other.getEventTypeValue()); + } + if (!other.getPubsubTopic().isEmpty()) { + pubsubTopic_ = other.pubsubTopic_; + onChanged(); + } + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + onChanged(); + } + switch (other.getNotifyConfigCase()) { + case STREAMING_CONFIG: + { + mergeStreamingConfig(other.getStreamingConfig()); + break; + } + case NOTIFYCONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int notifyConfigCase_ = 0; + private java.lang.Object notifyConfig_; + + public NotifyConfigCase getNotifyConfigCase() { + return NotifyConfigCase.forNumber(notifyConfigCase_); + } + + public Builder clearNotifyConfig() { + notifyConfigCase_ = 0; + notifyConfig_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this notification config. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of this notification config. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of this notification config. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this notification config. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this notification config. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the notification config (max of 1024 characters).
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The description of the notification config (max of 1024 characters).
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The description of the notification config (max of 1024 characters).
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the notification config (max of 1024 characters).
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the notification config (max of 1024 characters).
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private int eventType_ = 0; + /** + * + * + *
+     * The type of events the config is for, e.g. FINDING.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return The enum numeric value on the wire for eventType. + */ + public int getEventTypeValue() { + return eventType_; + } + /** + * + * + *
+     * The type of events the config is for, e.g. FINDING.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @param value The enum numeric value on the wire for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeValue(int value) { + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of events the config is for, e.g. FINDING.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return The eventType. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType getEventType() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType result = + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType.valueOf( + eventType_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The type of events the config is for, e.g. FINDING.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of events the config is for, e.g. FINDING.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pubsubTopic_ = ""; + /** + * + * + *
+     * The PubSub topic to send notifications to. Its format is
+     * "projects/[project_id]/topics/[topic]".
+     * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The PubSub topic to send notifications to. Its format is
+     * "projects/[project_id]/topics/[topic]".
+     * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The PubSub topic to send notifications to. Its format is
+     * "projects/[project_id]/topics/[topic]".
+     * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The PubSub topic to send notifications to. Its format is
+     * "projects/[project_id]/topics/[topic]".
+     * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearPubsubTopic() { + + pubsubTopic_ = getDefaultInstance().getPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * The PubSub topic to send notifications to. Its format is
+     * "projects/[project_id]/topics/[topic]".
+     * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubTopic_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+     * Output only. The service account that needs "pubsub.topics.publish"
+     * permission to publish to the PubSub topic.
+     * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The service account that needs "pubsub.topics.publish"
+     * permission to publish to the PubSub topic.
+     * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The service account that needs "pubsub.topics.publish"
+     * permission to publish to the PubSub topic.
+     * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service account that needs "pubsub.topics.publish"
+     * permission to publish to the PubSub topic.
+     * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + + serviceAccount_ = getDefaultInstance().getServiceAccount(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service account that needs "pubsub.topics.publish"
+     * permission to publish to the PubSub topic.
+     * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccount_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigOrBuilder> + streamingConfigBuilder_; + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + * + * @return Whether the streamingConfig field is set. + */ + public boolean hasStreamingConfig() { + return notifyConfigCase_ == 6; + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + * + * @return The streamingConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + getStreamingConfig() { + if (streamingConfigBuilder_ == null) { + if (notifyConfigCase_ == 6) { + return (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_; + } + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } else { + if (notifyConfigCase_ == 6) { + return streamingConfigBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public Builder setStreamingConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig value) { + if (streamingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notifyConfig_ = value; + onChanged(); + } else { + streamingConfigBuilder_.setMessage(value); + } + notifyConfigCase_ = 6; + return this; + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public Builder setStreamingConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder + builderForValue) { + if (streamingConfigBuilder_ == null) { + notifyConfig_ = builderForValue.build(); + onChanged(); + } else { + streamingConfigBuilder_.setMessage(builderForValue.build()); + } + notifyConfigCase_ = 6; + return this; + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public Builder mergeStreamingConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig value) { + if (streamingConfigBuilder_ == null) { + if (notifyConfigCase_ == 6 + && notifyConfig_ + != com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance()) { + notifyConfig_ = + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .newBuilder( + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + notifyConfig_ = value; + } + onChanged(); + } else { + if (notifyConfigCase_ == 6) { + streamingConfigBuilder_.mergeFrom(value); + } + streamingConfigBuilder_.setMessage(value); + } + notifyConfigCase_ = 6; + return this; + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public Builder clearStreamingConfig() { + if (streamingConfigBuilder_ == null) { + if (notifyConfigCase_ == 6) { + notifyConfigCase_ = 0; + notifyConfig_ = null; + onChanged(); + } + } else { + if (notifyConfigCase_ == 6) { + notifyConfigCase_ = 0; + notifyConfig_ = null; + } + streamingConfigBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder + getStreamingConfigBuilder() { + return getStreamingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigOrBuilder + getStreamingConfigOrBuilder() { + if ((notifyConfigCase_ == 6) && (streamingConfigBuilder_ != null)) { + return streamingConfigBuilder_.getMessageOrBuilder(); + } else { + if (notifyConfigCase_ == 6) { + return (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_; + } + return com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The config for triggering streaming-based notifications.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigOrBuilder> + getStreamingConfigFieldBuilder() { + if (streamingConfigBuilder_ == null) { + if (!(notifyConfigCase_ == 6)) { + notifyConfig_ = + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .getDefaultInstance(); + } + streamingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + .Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + .StreamingConfigOrBuilder>( + (com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + notifyConfig_, + getParentForChildren(), + isClean()); + notifyConfig_ = null; + } + notifyConfigCase_ = 6; + onChanged(); + ; + return streamingConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.NotificationConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.NotificationConfig) + private static final com.google.cloud.securitycenter.v1p1beta1.NotificationConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.NotificationConfig(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NotificationConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NotificationConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigName.java new file mode 100644 index 000000000..2b0a9357a --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigName.java @@ -0,0 +1,192 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NotificationConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/notificationConfigs/{notification_config}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String notificationConfig; + + public String getOrganization() { + return organization; + } + + public String getNotificationConfig() { + return notificationConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private NotificationConfigName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + notificationConfig = Preconditions.checkNotNull(builder.getNotificationConfig()); + } + + public static NotificationConfigName of(String organization, String notificationConfig) { + return newBuilder() + .setOrganization(organization) + .setNotificationConfig(notificationConfig) + .build(); + } + + public static String format(String organization, String notificationConfig) { + return newBuilder() + .setOrganization(organization) + .setNotificationConfig(notificationConfig) + .build() + .toString(); + } + + public static NotificationConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "NotificationConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("notification_config")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (NotificationConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("notificationConfig", notificationConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "organization", organization, "notification_config", notificationConfig); + } + + /** Builder for NotificationConfigName. */ + public static class Builder { + + private String organization; + private String notificationConfig; + + public String getOrganization() { + return organization; + } + + public String getNotificationConfig() { + return notificationConfig; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setNotificationConfig(String notificationConfig) { + this.notificationConfig = notificationConfig; + return this; + } + + private Builder() {} + + private Builder(NotificationConfigName notificationConfigName) { + organization = notificationConfigName.organization; + notificationConfig = notificationConfigName.notificationConfig; + } + + public NotificationConfigName build() { + return new NotificationConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NotificationConfigName) { + NotificationConfigName that = (NotificationConfigName) o; + return (this.organization.equals(that.organization)) + && (this.notificationConfig.equals(that.notificationConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= notificationConfig.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOrBuilder.java new file mode 100644 index 000000000..f978276dd --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOrBuilder.java @@ -0,0 +1,207 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/notification_config.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface NotificationConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.NotificationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this notification config. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this notification config. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The description of the notification config (max of 1024 characters).
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the notification config (max of 1024 characters).
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The type of events the config is for, e.g. FINDING.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return The enum numeric value on the wire for eventType. + */ + int getEventTypeValue(); + /** + * + * + *
+   * The type of events the config is for, e.g. FINDING.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType event_type = 3; + * + * + * @return The eventType. + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType getEventType(); + + /** + * + * + *
+   * The PubSub topic to send notifications to. Its format is
+   * "projects/[project_id]/topics/[topic]".
+   * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return The pubsubTopic. + */ + java.lang.String getPubsubTopic(); + /** + * + * + *
+   * The PubSub topic to send notifications to. Its format is
+   * "projects/[project_id]/topics/[topic]".
+   * 
+ * + * string pubsub_topic = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for pubsubTopic. + */ + com.google.protobuf.ByteString getPubsubTopicBytes(); + + /** + * + * + *
+   * Output only. The service account that needs "pubsub.topics.publish"
+   * permission to publish to the PubSub topic.
+   * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + * + * + *
+   * Output only. The service account that needs "pubsub.topics.publish"
+   * permission to publish to the PubSub topic.
+   * 
+ * + * string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString getServiceAccountBytes(); + + /** + * + * + *
+   * The config for triggering streaming-based notifications.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + * + * @return Whether the streamingConfig field is set. + */ + boolean hasStreamingConfig(); + /** + * + * + *
+   * The config for triggering streaming-based notifications.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + * + * @return The streamingConfig. + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig getStreamingConfig(); + /** + * + * + *
+   * The config for triggering streaming-based notifications.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig streaming_config = 6; + * + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigOrBuilder + getStreamingConfigOrBuilder(); + + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.NotifyConfigCase + getNotifyConfigCase(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOuterClass.java new file mode 100644 index 000000000..b4c7fc090 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationConfigOuterClass.java @@ -0,0 +1,122 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/notification_config.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class NotificationConfigOuterClass { + private NotificationConfigOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/cloud/securitycenter/v1p1beta1/" + + "notification_config.proto\022%google.cloud." + + "securitycenter.v1p1beta1\032\034google/api/ann" + + "otations.proto\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\"\266\004\n\022N" + + "otificationConfig\022\014\n\004name\030\001 \001(\t\022\023\n\013descr" + + "iption\030\002 \001(\t\022W\n\nevent_type\030\003 \001(\0162C.googl" + + "e.cloud.securitycenter.v1p1beta1.Notific" + + "ationConfig.EventType\0226\n\014pubsub_topic\030\004 " + + "\001(\tB \372A\035\n\033pubsub.googleapis.com/Topic\022\034\n" + + "\017service_account\030\005 \001(\tB\003\340A\003\022e\n\020streaming" + + "_config\030\006 \001(\0132I.google.cloud.securitycen" + + "ter.v1p1beta1.NotificationConfig.Streami" + + "ngConfigH\000\032!\n\017StreamingConfig\022\016\n\006filter\030" + + "\001 \001(\t\"4\n\tEventType\022\032\n\026EVENT_TYPE_UNSPECI" + + "FIED\020\000\022\013\n\007FINDING\020\001:}\352Az\n0securitycenter" + + ".googleapis.com/NotificationConfig\022Forga" + + "nizations/{organization}/notificationCon" + + "figs/{notification_config}B\017\n\rnotify_con" + + "figB\300\002\n)com.google.cloud.securitycenter." + + "v1p1beta1P\001ZSgoogle.golang.org/genproto/" + + "googleapis/cloud/securitycenter/v1p1beta" + + "1;securitycenter\252\002%Google.Cloud.Security" + + "Center.V1P1Beta1\312\002%Google\\Cloud\\Security" + + "Center\\V1p1beta1\352\002(Google::Cloud::Securi" + + "tyCenter::V1p1beta1\352A@\n\033pubsub.googleapi" + + "s.com/Topic\022!projects/{project}/topics/{" + + "topic}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor, + new java.lang.String[] { + "Name", + "Description", + "EventType", + "PubsubTopic", + "ServiceAccount", + "StreamingConfig", + "NotifyConfig", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationConfig_StreamingConfig_descriptor, + new java.lang.String[] { + "Filter", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessage.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessage.java new file mode 100644 index 000000000..a1173bdb6 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessage.java @@ -0,0 +1,1026 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/notification_message.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Cloud SCC's Notification
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.NotificationMessage} + */ +public final class NotificationMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.NotificationMessage) + NotificationMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use NotificationMessage.newBuilder() to construct. + private NotificationMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NotificationMessage() { + notificationConfigName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NotificationMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + notificationConfigName_ = s; + break; + } + case 18: + { + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder subBuilder = null; + if (eventCase_ == 2) { + subBuilder = + ((com.google.cloud.securitycenter.v1p1beta1.Finding) event_).toBuilder(); + } + event_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Finding.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.securitycenter.v1p1beta1.Finding) event_); + event_ = subBuilder.buildPartial(); + } + eventCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationMessageOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationMessageOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.class, + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.Builder.class); + } + + private int eventCase_ = 0; + private java.lang.Object event_; + + public enum EventCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FINDING(2), + EVENT_NOT_SET(0); + private final int value; + + private EventCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventCase valueOf(int value) { + return forNumber(value); + } + + public static EventCase forNumber(int value) { + switch (value) { + case 2: + return FINDING; + case 0: + return EVENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EventCase getEventCase() { + return EventCase.forNumber(eventCase_); + } + + public static final int NOTIFICATION_CONFIG_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object notificationConfigName_; + /** + * + * + *
+   * Name of the notification config that generated current notification.
+   * 
+ * + * string notification_config_name = 1; + * + * @return The notificationConfigName. + */ + public java.lang.String getNotificationConfigName() { + java.lang.Object ref = notificationConfigName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationConfigName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the notification config that generated current notification.
+   * 
+ * + * string notification_config_name = 1; + * + * @return The bytes for notificationConfigName. + */ + public com.google.protobuf.ByteString getNotificationConfigNameBytes() { + java.lang.Object ref = notificationConfigName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationConfigName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINDING_FIELD_NUMBER = 2; + /** + * + * + *
+   * If it's a Finding based notification config, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return eventCase_ == 2; + } + /** + * + * + *
+   * If it's a Finding based notification config, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + if (eventCase_ == 2) { + return (com.google.cloud.securitycenter.v1p1beta1.Finding) event_; + } + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } + /** + * + * + *
+   * If it's a Finding based notification config, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + if (eventCase_ == 2) { + return (com.google.cloud.securitycenter.v1p1beta1.Finding) event_; + } + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNotificationConfigNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, notificationConfigName_); + } + if (eventCase_ == 2) { + output.writeMessage(2, (com.google.cloud.securitycenter.v1p1beta1.Finding) event_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNotificationConfigNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, notificationConfigName_); + } + if (eventCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.securitycenter.v1p1beta1.Finding) event_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.NotificationMessage)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage other = + (com.google.cloud.securitycenter.v1p1beta1.NotificationMessage) obj; + + if (!getNotificationConfigName().equals(other.getNotificationConfigName())) return false; + if (!getEventCase().equals(other.getEventCase())) return false; + switch (eventCase_) { + case 2: + if (!getFinding().equals(other.getFinding())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NOTIFICATION_CONFIG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNotificationConfigName().hashCode(); + switch (eventCase_) { + case 2: + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Cloud SCC's Notification
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.NotificationMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.NotificationMessage) + com.google.cloud.securitycenter.v1p1beta1.NotificationMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationMessageOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationMessageOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.class, + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + notificationConfigName_ = ""; + + eventCase_ = 0; + event_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationMessageOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationMessage + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationMessage build() { + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationMessage buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage result = + new com.google.cloud.securitycenter.v1p1beta1.NotificationMessage(this); + result.notificationConfigName_ = notificationConfigName_; + if (eventCase_ == 2) { + if (findingBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = findingBuilder_.build(); + } + } + result.eventCase_ = eventCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.NotificationMessage) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.NotificationMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.NotificationMessage other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.getDefaultInstance()) + return this; + if (!other.getNotificationConfigName().isEmpty()) { + notificationConfigName_ = other.notificationConfigName_; + onChanged(); + } + switch (other.getEventCase()) { + case FINDING: + { + mergeFinding(other.getFinding()); + break; + } + case EVENT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.NotificationMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.NotificationMessage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int eventCase_ = 0; + private java.lang.Object event_; + + public EventCase getEventCase() { + return EventCase.forNumber(eventCase_); + } + + public Builder clearEvent() { + eventCase_ = 0; + event_ = null; + onChanged(); + return this; + } + + private java.lang.Object notificationConfigName_ = ""; + /** + * + * + *
+     * Name of the notification config that generated current notification.
+     * 
+ * + * string notification_config_name = 1; + * + * @return The notificationConfigName. + */ + public java.lang.String getNotificationConfigName() { + java.lang.Object ref = notificationConfigName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notificationConfigName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the notification config that generated current notification.
+     * 
+ * + * string notification_config_name = 1; + * + * @return The bytes for notificationConfigName. + */ + public com.google.protobuf.ByteString getNotificationConfigNameBytes() { + java.lang.Object ref = notificationConfigName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notificationConfigName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the notification config that generated current notification.
+     * 
+ * + * string notification_config_name = 1; + * + * @param value The notificationConfigName to set. + * @return This builder for chaining. + */ + public Builder setNotificationConfigName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notificationConfigName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the notification config that generated current notification.
+     * 
+ * + * string notification_config_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearNotificationConfigName() { + + notificationConfigName_ = getDefaultInstance().getNotificationConfigName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the notification config that generated current notification.
+     * 
+ * + * string notification_config_name = 1; + * + * @param value The bytes for notificationConfigName to set. + * @return This builder for chaining. + */ + public Builder setNotificationConfigNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notificationConfigName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return eventCase_ == 2; + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + if (findingBuilder_ == null) { + if (eventCase_ == 2) { + return (com.google.cloud.securitycenter.v1p1beta1.Finding) event_; + } + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } else { + if (eventCase_ == 2) { + return findingBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + eventCase_ = 2; + return this; + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + eventCase_ = 2; + return this; + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (eventCase_ == 2 + && event_ != com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance()) { + event_ = + com.google.cloud.securitycenter.v1p1beta1.Finding.newBuilder( + (com.google.cloud.securitycenter.v1p1beta1.Finding) event_) + .mergeFrom(value) + .buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + if (eventCase_ == 2) { + findingBuilder_.mergeFrom(value); + } + findingBuilder_.setMessage(value); + } + eventCase_ = 2; + return this; + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + if (eventCase_ == 2) { + eventCase_ = 0; + event_ = null; + onChanged(); + } + } else { + if (eventCase_ == 2) { + eventCase_ = 0; + event_ = null; + } + findingBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.Builder getFindingBuilder() { + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + if ((eventCase_ == 2) && (findingBuilder_ != null)) { + return findingBuilder_.getMessageOrBuilder(); + } else { + if (eventCase_ == 2) { + return (com.google.cloud.securitycenter.v1p1beta1.Finding) event_; + } + return com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } + } + /** + * + * + *
+     * If it's a Finding based notification config, this field will be
+     * populated.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + if (!(eventCase_ == 2)) { + event_ = com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance(); + } + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder>( + (com.google.cloud.securitycenter.v1p1beta1.Finding) event_, + getParentForChildren(), + isClean()); + event_ = null; + } + eventCase_ = 2; + onChanged(); + ; + return findingBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.NotificationMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.NotificationMessage) + private static final com.google.cloud.securitycenter.v1p1beta1.NotificationMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.NotificationMessage(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.NotificationMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NotificationMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NotificationMessage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.NotificationMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOrBuilder.java new file mode 100644 index 000000000..886769a79 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/notification_message.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface NotificationMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.NotificationMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the notification config that generated current notification.
+   * 
+ * + * string notification_config_name = 1; + * + * @return The notificationConfigName. + */ + java.lang.String getNotificationConfigName(); + /** + * + * + *
+   * Name of the notification config that generated current notification.
+   * 
+ * + * string notification_config_name = 1; + * + * @return The bytes for notificationConfigName. + */ + com.google.protobuf.ByteString getNotificationConfigNameBytes(); + + /** + * + * + *
+   * If it's a Finding based notification config, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + * + * @return Whether the finding field is set. + */ + boolean hasFinding(); + /** + * + * + *
+   * If it's a Finding based notification config, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + * + * @return The finding. + */ + com.google.cloud.securitycenter.v1p1beta1.Finding getFinding(); + /** + * + * + *
+   * If it's a Finding based notification config, this field will be
+   * populated.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 2; + */ + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder(); + + public com.google.cloud.securitycenter.v1p1beta1.NotificationMessage.EventCase getEventCase(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOuterClass.java new file mode 100644 index 000000000..d65f78fa7 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/NotificationMessageOuterClass.java @@ -0,0 +1,82 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/notification_message.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class NotificationMessageOuterClass { + private NotificationMessageOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n@google/cloud/securitycenter/v1p1beta1/" + + "notification_message.proto\022%google.cloud" + + ".securitycenter.v1p1beta1\032\034google/api/an" + + "notations.proto\0321google/cloud/securityce" + + "nter/v1p1beta1/asset.proto\0323google/cloud" + + "/securitycenter/v1p1beta1/finding.proto\"" + + "\203\001\n\023NotificationMessage\022 \n\030notification_" + + "config_name\030\001 \001(\t\022A\n\007finding\030\002 \001(\0132..goo" + + "gle.cloud.securitycenter.v1p1beta1.Findi" + + "ngH\000B\007\n\005eventB\375\001\n)com.google.cloud.secur" + + "itycenter.v1p1beta1P\001ZSgoogle.golang.org" + + "/genproto/googleapis/cloud/securitycente" + + "r/v1p1beta1;securitycenter\252\002%Google.Clou" + + "d.SecurityCenter.V1P1Beta1\312\002%Google\\Clou" + + "d\\SecurityCenter\\V1p1beta1\352\002(Google::Clo" + + "ud::SecurityCenter::V1p1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_NotificationMessage_descriptor, + new java.lang.String[] { + "NotificationConfigName", "Finding", "Event", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationName.java new file mode 100644 index 000000000..e0c294e91 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationName.java @@ -0,0 +1,162 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + + private volatile Map fieldValuesMap; + + private final String organization; + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public static OrganizationName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "OrganizationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OrganizationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization); + } + + /** Builder for OrganizationName. */ + public static class Builder { + + private String organization; + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder() {} + + private Builder(OrganizationName organizationName) { + organization = organizationName.organization; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationName) { + OrganizationName that = (OrganizationName) o; + return (this.organization.equals(that.organization)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettings.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettings.java new file mode 100644 index 000000000..3706059f7 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettings.java @@ -0,0 +1,2308 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/organization_settings.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * User specified settings that are attached to the Cloud Security Command
+ * Center (Cloud SCC) organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.OrganizationSettings} + */ +public final class OrganizationSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + OrganizationSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrganizationSettings.newBuilder() to construct. + private OrganizationSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrganizationSettings() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OrganizationSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OrganizationSettings( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + enableAssetDiscovery_ = input.readBool(); + break; + } + case 26: + { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder + subBuilder = null; + if (assetDiscoveryConfig_ != null) { + subBuilder = assetDiscoveryConfig_.toBuilder(); + } + assetDiscoveryConfig_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(assetDiscoveryConfig_); + assetDiscoveryConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.class, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder.class); + } + + public interface AssetDiscoveryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @return A list containing the projectIds. + */ + java.util.List getProjectIdsList(); + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @return The count of projectIds. + */ + int getProjectIdsCount(); + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @param index The index of the element to return. + * @return The projectIds at the given index. + */ + java.lang.String getProjectIds(int index); + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the projectIds at the given index. + */ + com.google.protobuf.ByteString getProjectIdsBytes(int index); + + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return The enum numeric value on the wire for inclusionMode. + */ + int getInclusionModeValue(); + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return The inclusionMode. + */ + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + getInclusionMode(); + } + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} + */ + public static final class AssetDiscoveryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + AssetDiscoveryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AssetDiscoveryConfig.newBuilder() to construct. + private AssetDiscoveryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AssetDiscoveryConfig() { + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + inclusionMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AssetDiscoveryConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AssetDiscoveryConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + projectIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + projectIds_.add(s); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + inclusionMode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + projectIds_ = projectIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .class, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder.class); + } + + /** + * + * + *
+     * The mode of inclusion when running Asset Discovery.
+     * Asset discovery can be limited by explicitly identifying projects to be
+     * included or excluded. If INCLUDE_ONLY is set, then only those projects
+     * within the organization and their children are discovered during asset
+     * discovery. If EXCLUDE is set, then projects that don't match those
+     * projects are discovered during asset discovery. If neither are set, then
+     * all projects within the organization are discovered during asset
+     * discovery.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} + */ + public enum InclusionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified. Setting the mode with this value will disable
+       * inclusion/exclusion filtering for Asset Discovery.
+       * 
+ * + * INCLUSION_MODE_UNSPECIFIED = 0; + */ + INCLUSION_MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Asset Discovery will capture only the resources within the projects
+       * specified. All other resources will be ignored.
+       * 
+ * + * INCLUDE_ONLY = 1; + */ + INCLUDE_ONLY(1), + /** + * + * + *
+       * Asset Discovery will ignore all resources under the projects specified.
+       * All other resources will be retrieved.
+       * 
+ * + * EXCLUDE = 2; + */ + EXCLUDE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified. Setting the mode with this value will disable
+       * inclusion/exclusion filtering for Asset Discovery.
+       * 
+ * + * INCLUSION_MODE_UNSPECIFIED = 0; + */ + public static final int INCLUSION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Asset Discovery will capture only the resources within the projects
+       * specified. All other resources will be ignored.
+       * 
+ * + * INCLUDE_ONLY = 1; + */ + public static final int INCLUDE_ONLY_VALUE = 1; + /** + * + * + *
+       * Asset Discovery will ignore all resources under the projects specified.
+       * All other resources will be retrieved.
+       * 
+ * + * EXCLUDE = 2; + */ + public static final int EXCLUDE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static InclusionMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static InclusionMode forNumber(int value) { + switch (value) { + case 0: + return INCLUSION_MODE_UNSPECIFIED; + case 1: + return INCLUDE_ONLY; + case 2: + return EXCLUDE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InclusionMode findValueByNumber(int number) { + return InclusionMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final InclusionMode[] VALUES = values(); + + public static InclusionMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private InclusionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode) + } + + public static final int PROJECT_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList projectIds_; + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @return A list containing the projectIds. + */ + public com.google.protobuf.ProtocolStringList getProjectIdsList() { + return projectIds_; + } + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @return The count of projectIds. + */ + public int getProjectIdsCount() { + return projectIds_.size(); + } + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @param index The index of the element to return. + * @return The projectIds at the given index. + */ + public java.lang.String getProjectIds(int index) { + return projectIds_.get(index); + } + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the projectIds at the given index. + */ + public com.google.protobuf.ByteString getProjectIdsBytes(int index) { + return projectIds_.getByteString(index); + } + + public static final int INCLUSION_MODE_FIELD_NUMBER = 2; + private int inclusionMode_; + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return The enum numeric value on the wire for inclusionMode. + */ + public int getInclusionModeValue() { + return inclusionMode_; + } + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return The inclusionMode. + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + getInclusionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + result = + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.valueOf(inclusionMode_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < projectIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectIds_.getRaw(i)); + } + if (inclusionMode_ + != com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.INCLUSION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, inclusionMode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < projectIds_.size(); i++) { + dataSize += computeStringSizeNoTag(projectIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getProjectIdsList().size(); + } + if (inclusionMode_ + != com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.INCLUSION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, inclusionMode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig other = + (com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) obj; + + if (!getProjectIdsList().equals(other.getProjectIdsList())) return false; + if (inclusionMode_ != other.inclusionMode_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProjectIdsCount() > 0) { + hash = (37 * hash) + PROJECT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getProjectIdsList().hashCode(); + } + hash = (37 * hash) + INCLUSION_MODE_FIELD_NUMBER; + hash = (53 * hash) + inclusionMode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .class, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + inclusionMode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + build() { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig result = + new com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig( + this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + projectIds_ = projectIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.projectIds_ = projectIds_; + result.inclusionMode_ = inclusionMode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance()) return this; + if (!other.projectIds_.isEmpty()) { + if (projectIds_.isEmpty()) { + projectIds_ = other.projectIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProjectIdsIsMutable(); + projectIds_.addAll(other.projectIds_); + } + onChanged(); + } + if (other.inclusionMode_ != 0) { + setInclusionModeValue(other.getInclusionModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList projectIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureProjectIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + projectIds_ = new com.google.protobuf.LazyStringArrayList(projectIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @return A list containing the projectIds. + */ + public com.google.protobuf.ProtocolStringList getProjectIdsList() { + return projectIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @return The count of projectIds. + */ + public int getProjectIdsCount() { + return projectIds_.size(); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @param index The index of the element to return. + * @return The projectIds at the given index. + */ + public java.lang.String getProjectIds(int index) { + return projectIds_.get(index); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the projectIds at the given index. + */ + public com.google.protobuf.ByteString getProjectIdsBytes(int index) { + return projectIds_.getByteString(index); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @param index The index to set the value at. + * @param value The projectIds to set. + * @return This builder for chaining. + */ + public Builder setProjectIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectIdsIsMutable(); + projectIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @param value The projectIds to add. + * @return This builder for chaining. + */ + public Builder addProjectIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectIdsIsMutable(); + projectIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @param values The projectIds to add. + * @return This builder for chaining. + */ + public Builder addAllProjectIds(java.lang.Iterable values) { + ensureProjectIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, projectIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectIds() { + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + * + * @param value The bytes of the projectIds to add. + * @return This builder for chaining. + */ + public Builder addProjectIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProjectIdsIsMutable(); + projectIds_.add(value); + onChanged(); + return this; + } + + private int inclusionMode_ = 0; + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return The enum numeric value on the wire for inclusionMode. + */ + public int getInclusionModeValue() { + return inclusionMode_; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @param value The enum numeric value on the wire for inclusionMode to set. + * @return This builder for chaining. + */ + public Builder setInclusionModeValue(int value) { + inclusionMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return The inclusionMode. + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + getInclusionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + result = + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.valueOf(inclusionMode_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @param value The inclusionMode to set. + * @return This builder for chaining. + */ + public Builder setInclusionMode( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + value) { + if (value == null) { + throw new NullPointerException(); + } + + inclusionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearInclusionMode() { + + inclusionMode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + private static final com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AssetDiscoveryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AssetDiscoveryConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/organizationSettings".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/organizationSettings".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_ASSET_DISCOVERY_FIELD_NUMBER = 2; + private boolean enableAssetDiscovery_; + /** + * + * + *
+   * A flag that indicates if Asset Discovery should be enabled. If the flag is
+   * set to `true`, then discovery of assets will occur. If it is set to `false,
+   * all historical assets will remain, but discovery of future assets will not
+   * occur.
+   * 
+ * + * bool enable_asset_discovery = 2; + * + * @return The enableAssetDiscovery. + */ + public boolean getEnableAssetDiscovery() { + return enableAssetDiscovery_; + } + + public static final int ASSET_DISCOVERY_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + assetDiscoveryConfig_; + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + * + * @return Whether the assetDiscoveryConfig field is set. + */ + public boolean hasAssetDiscoveryConfig() { + return assetDiscoveryConfig_ != null; + } + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + * + * @return The assetDiscoveryConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + getAssetDiscoveryConfig() { + return assetDiscoveryConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance() + : assetDiscoveryConfig_; + } + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder + getAssetDiscoveryConfigOrBuilder() { + return getAssetDiscoveryConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (enableAssetDiscovery_ != false) { + output.writeBool(2, enableAssetDiscovery_); + } + if (assetDiscoveryConfig_ != null) { + output.writeMessage(3, getAssetDiscoveryConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (enableAssetDiscovery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, enableAssetDiscovery_); + } + if (assetDiscoveryConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAssetDiscoveryConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings other = + (com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings) obj; + + if (!getName().equals(other.getName())) return false; + if (getEnableAssetDiscovery() != other.getEnableAssetDiscovery()) return false; + if (hasAssetDiscoveryConfig() != other.hasAssetDiscoveryConfig()) return false; + if (hasAssetDiscoveryConfig()) { + if (!getAssetDiscoveryConfig().equals(other.getAssetDiscoveryConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ENABLE_ASSET_DISCOVERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAssetDiscovery()); + if (hasAssetDiscoveryConfig()) { + hash = (37 * hash) + ASSET_DISCOVERY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAssetDiscoveryConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * User specified settings that are attached to the Cloud Security Command
+   * Center (Cloud SCC) organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.OrganizationSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.class, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + enableAssetDiscovery_ = false; + + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfig_ = null; + } else { + assetDiscoveryConfig_ = null; + assetDiscoveryConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings build() { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings result = + new com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings(this); + result.name_ = name_; + result.enableAssetDiscovery_ = enableAssetDiscovery_; + if (assetDiscoveryConfigBuilder_ == null) { + result.assetDiscoveryConfig_ = assetDiscoveryConfig_; + } else { + result.assetDiscoveryConfig_ = assetDiscoveryConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getEnableAssetDiscovery() != false) { + setEnableAssetDiscovery(other.getEnableAssetDiscovery()); + } + if (other.hasAssetDiscoveryConfig()) { + mergeAssetDiscoveryConfig(other.getAssetDiscoveryConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/organizationSettings".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/organizationSettings".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/organizationSettings".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/organizationSettings".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/organizationSettings".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private boolean enableAssetDiscovery_; + /** + * + * + *
+     * A flag that indicates if Asset Discovery should be enabled. If the flag is
+     * set to `true`, then discovery of assets will occur. If it is set to `false,
+     * all historical assets will remain, but discovery of future assets will not
+     * occur.
+     * 
+ * + * bool enable_asset_discovery = 2; + * + * @return The enableAssetDiscovery. + */ + public boolean getEnableAssetDiscovery() { + return enableAssetDiscovery_; + } + /** + * + * + *
+     * A flag that indicates if Asset Discovery should be enabled. If the flag is
+     * set to `true`, then discovery of assets will occur. If it is set to `false,
+     * all historical assets will remain, but discovery of future assets will not
+     * occur.
+     * 
+ * + * bool enable_asset_discovery = 2; + * + * @param value The enableAssetDiscovery to set. + * @return This builder for chaining. + */ + public Builder setEnableAssetDiscovery(boolean value) { + + enableAssetDiscovery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A flag that indicates if Asset Discovery should be enabled. If the flag is
+     * set to `true`, then discovery of assets will occur. If it is set to `false,
+     * all historical assets will remain, but discovery of future assets will not
+     * occur.
+     * 
+ * + * bool enable_asset_discovery = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnableAssetDiscovery() { + + enableAssetDiscovery_ = false; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + assetDiscoveryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder> + assetDiscoveryConfigBuilder_; + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + * + * @return Whether the assetDiscoveryConfig field is set. + */ + public boolean hasAssetDiscoveryConfig() { + return assetDiscoveryConfigBuilder_ != null || assetDiscoveryConfig_ != null; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + * + * @return The assetDiscoveryConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + getAssetDiscoveryConfig() { + if (assetDiscoveryConfigBuilder_ == null) { + return assetDiscoveryConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance() + : assetDiscoveryConfig_; + } else { + return assetDiscoveryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder setAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig value) { + if (assetDiscoveryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + assetDiscoveryConfig_ = value; + onChanged(); + } else { + assetDiscoveryConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder setAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder + builderForValue) { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfig_ = builderForValue.build(); + onChanged(); + } else { + assetDiscoveryConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder mergeAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig value) { + if (assetDiscoveryConfigBuilder_ == null) { + if (assetDiscoveryConfig_ != null) { + assetDiscoveryConfig_ = + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .newBuilder(assetDiscoveryConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + assetDiscoveryConfig_ = value; + } + onChanged(); + } else { + assetDiscoveryConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder clearAssetDiscoveryConfig() { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfig_ = null; + onChanged(); + } else { + assetDiscoveryConfig_ = null; + assetDiscoveryConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder + getAssetDiscoveryConfigBuilder() { + + onChanged(); + return getAssetDiscoveryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder + getAssetDiscoveryConfigOrBuilder() { + if (assetDiscoveryConfigBuilder_ != null) { + return assetDiscoveryConfigBuilder_.getMessageOrBuilder(); + } else { + return assetDiscoveryConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance() + : assetDiscoveryConfig_; + } + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder> + getAssetDiscoveryConfigFieldBuilder() { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + .Builder, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder>( + getAssetDiscoveryConfig(), getParentForChildren(), isClean()); + assetDiscoveryConfig_ = null; + } + return assetDiscoveryConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + private static final com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrganizationSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OrganizationSettings(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsName.java new file mode 100644 index 000000000..73cdeb011 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsName.java @@ -0,0 +1,162 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationSettingsName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/organizationSettings"); + + private volatile Map fieldValuesMap; + + private final String organization; + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationSettingsName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public static OrganizationSettingsName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationSettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "OrganizationSettingsName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OrganizationSettingsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization); + } + + /** Builder for OrganizationSettingsName. */ + public static class Builder { + + private String organization; + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder() {} + + private Builder(OrganizationSettingsName organizationSettingsName) { + organization = organizationSettingsName.organization; + } + + public OrganizationSettingsName build() { + return new OrganizationSettingsName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationSettingsName) { + OrganizationSettingsName that = (OrganizationSettingsName) o; + return (this.organization.equals(that.organization)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOrBuilder.java new file mode 100644 index 000000000..048841271 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/organization_settings.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface OrganizationSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/organizationSettings".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/organizationSettings".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * A flag that indicates if Asset Discovery should be enabled. If the flag is
+   * set to `true`, then discovery of assets will occur. If it is set to `false,
+   * all historical assets will remain, but discovery of future assets will not
+   * occur.
+   * 
+ * + * bool enable_asset_discovery = 2; + * + * @return The enableAssetDiscovery. + */ + boolean getEnableAssetDiscovery(); + + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + * + * @return Whether the assetDiscoveryConfig field is set. + */ + boolean hasAssetDiscoveryConfig(); + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + * + * @return The assetDiscoveryConfig. + */ + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + getAssetDiscoveryConfig(); + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfigOrBuilder + getAssetDiscoveryConfigOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOuterClass.java new file mode 100644 index 000000000..28172fa01 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/OrganizationSettingsOuterClass.java @@ -0,0 +1,108 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/organization_settings.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class OrganizationSettingsOuterClass { + private OrganizationSettingsOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nAgoogle/cloud/securitycenter/v1p1beta1/" + + "organization_settings.proto\022%google.clou" + + "d.securitycenter.v1p1beta1\032\034google/api/a" + + "nnotations.proto\032\031google/api/resource.pr" + + "oto\"\230\004\n\024OrganizationSettings\022\014\n\004name\030\001 \001" + + "(\t\022\036\n\026enable_asset_discovery\030\002 \001(\010\022p\n\026as" + + "set_discovery_config\030\003 \001(\0132P.google.clou" + + "d.securitycenter.v1p1beta1.OrganizationS" + + "ettings.AssetDiscoveryConfig\032\363\001\n\024AssetDi" + + "scoveryConfig\022\023\n\013project_ids\030\001 \003(\t\022v\n\016in" + + "clusion_mode\030\002 \001(\0162^.google.cloud.securi" + + "tycenter.v1p1beta1.OrganizationSettings." + + "AssetDiscoveryConfig.InclusionMode\"N\n\rIn" + + "clusionMode\022\036\n\032INCLUSION_MODE_UNSPECIFIE" + + "D\020\000\022\020\n\014INCLUDE_ONLY\020\001\022\013\n\007EXCLUDE\020\002:j\352Ag\n" + + "2securitycenter.googleapis.com/Organizat" + + "ionSettings\0221organizations/{organization" + + "}/organizationSettingsB\375\001\n)com.google.cl" + + "oud.securitycenter.v1p1beta1P\001ZSgoogle.g" + + "olang.org/genproto/googleapis/cloud/secu" + + "ritycenter/v1p1beta1;securitycenter\252\002%Go" + + "ogle.Cloud.SecurityCenter.V1P1Beta1\312\002%Go" + + "ogle\\Cloud\\SecurityCenter\\V1p1beta1\352\002(Go" + + "ogle::Cloud::SecurityCenter::V1p1beta1b\006" + + "proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor, + new java.lang.String[] { + "Name", "EnableAssetDiscovery", "AssetDiscoveryConfig", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor, + new java.lang.String[] { + "ProjectIds", "InclusionMode", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequest.java new file mode 100644 index 000000000..2d7307e2b --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequest.java @@ -0,0 +1,667 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for running asset discovery for an organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} + */ +public final class RunAssetDiscoveryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + RunAssetDiscoveryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunAssetDiscoveryRequest.newBuilder() to construct. + private RunAssetDiscoveryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RunAssetDiscoveryRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RunAssetDiscoveryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RunAssetDiscoveryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.class, + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the organization to run asset discovery for. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the organization to run asset discovery for. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest other = + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for running asset discovery for an organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.class, + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest build() { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest result = + new com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest(this); + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the organization to run asset discovery for. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to run asset discovery for. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the organization to run asset discovery for. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to run asset discovery for. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization to run asset discovery for. Its format
+     * is "organizations/[organization_id]".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunAssetDiscoveryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunAssetDiscoveryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequestOrBuilder.java new file mode 100644 index 000000000..7ff9511c9 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface RunAssetDiscoveryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the organization to run asset discovery for. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the organization to run asset discovery for. Its format
+   * is "organizations/[organization_id]".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponse.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponse.java new file mode 100644 index 000000000..e6c2b46f5 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponse.java @@ -0,0 +1,1074 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Response of asset discovery run
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} + */ +public final class RunAssetDiscoveryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + RunAssetDiscoveryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunAssetDiscoveryResponse.newBuilder() to construct. + private RunAssetDiscoveryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RunAssetDiscoveryResponse() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RunAssetDiscoveryResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RunAssetDiscoveryResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (duration_ != null) { + subBuilder = duration_.toBuilder(); + } + duration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(duration_); + duration_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.class, + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.Builder.class); + } + + /** + * + * + *
+   * The state of an asset discovery run.
+   * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Asset discovery run state was unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Asset discovery run completed successfully.
+     * 
+ * + * COMPLETED = 1; + */ + COMPLETED(1), + /** + * + * + *
+     * Asset discovery run was cancelled with tasks still pending, as another
+     * run for the same organization was started with a higher priority.
+     * 
+ * + * SUPERSEDED = 2; + */ + SUPERSEDED(2), + /** + * + * + *
+     * Asset discovery run was killed and terminated.
+     * 
+ * + * TERMINATED = 3; + */ + TERMINATED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Asset discovery run state was unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Asset discovery run completed successfully.
+     * 
+ * + * COMPLETED = 1; + */ + public static final int COMPLETED_VALUE = 1; + /** + * + * + *
+     * Asset discovery run was cancelled with tasks still pending, as another
+     * run for the same organization was started with a higher priority.
+     * 
+ * + * SUPERSEDED = 2; + */ + public static final int SUPERSEDED_VALUE = 2; + /** + * + * + *
+     * Asset discovery run was killed and terminated.
+     * 
+ * + * TERMINATED = 3; + */ + public static final int TERMINATED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return COMPLETED; + case 2: + return SUPERSEDED; + case 3: + return TERMINATED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State) + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * The state of an asset discovery run.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of an asset discovery run.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * @return The state. + */ + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State result = + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State.UNRECOGNIZED + : result; + } + + public static final int DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+   * The duration between asset discovery run start and end
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return duration_ != null; + } + /** + * + * + *
+   * The duration between asset discovery run start and end
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+   * The duration between asset discovery run start and end
+   * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return getDuration(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (state_ + != com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State + .STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, state_); + } + if (duration_ != null) { + output.writeMessage(2, getDuration()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State + .STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + if (duration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDuration()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse other = + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) obj; + + if (state_ != other.state_) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of asset discovery run
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.class, + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + state_ = 0; + + if (durationBuilder_ == null) { + duration_ = null; + } else { + duration_ = null; + durationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse build() { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse result = + new com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(this); + result.state_ = state_; + if (durationBuilder_ == null) { + result.duration_ = duration_; + } else { + result.duration_ = durationBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + .getDefaultInstance()) return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of an asset discovery run.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of an asset discovery run.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of an asset discovery run.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * + * @return The state. + */ + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State result = + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of an asset discovery run.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of an asset discovery run.
+     * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return durationBuilder_ != null || duration_ != null; + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + onChanged(); + } else { + durationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + onChanged(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (duration_ != null) { + duration_ = + com.google.protobuf.Duration.newBuilder(duration_).mergeFrom(value).buildPartial(); + } else { + duration_ = value; + } + onChanged(); + } else { + durationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public Builder clearDuration() { + if (durationBuilder_ == null) { + duration_ = null; + onChanged(); + } else { + duration_ = null; + durationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + /** + * + * + *
+     * The duration between asset discovery run start and end
+     * 
+ * + * .google.protobuf.Duration duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + private static final com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunAssetDiscoveryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunAssetDiscoveryResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOrBuilder.java new file mode 100644 index 000000000..a84fd27d8 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface RunAssetDiscoveryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The state of an asset discovery run.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of an asset discovery run.
+   * 
+ * + * .google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State state = 1; + * + * @return The state. + */ + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State getState(); + + /** + * + * + *
+   * The duration between asset discovery run start and end
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+   * The duration between asset discovery run start and end
+   * 
+ * + * .google.protobuf.Duration duration = 2; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+   * The duration between asset discovery run start and end
+   * 
+ * + * .google.protobuf.Duration duration = 2; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOuterClass.java new file mode 100644 index 000000000..b3a5635bb --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryResponseOuterClass.java @@ -0,0 +1,81 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class RunAssetDiscoveryResponseOuterClass { + private RunAssetDiscoveryResponseOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nHgoogle/cloud/securitycenter/v1p1beta1/" + + "run_asset_discovery_response.proto\022%goog" + + "le.cloud.securitycenter.v1p1beta1\032\034googl" + + "e/api/annotations.proto\032\036google/protobuf" + + "/duration.proto\"\356\001\n\031RunAssetDiscoveryRes" + + "ponse\022U\n\005state\030\001 \001(\0162F.google.cloud.secu" + + "ritycenter.v1p1beta1.RunAssetDiscoveryRe" + + "sponse.State\022+\n\010duration\030\002 \001(\0132\031.google." + + "protobuf.Duration\"M\n\005State\022\025\n\021STATE_UNSP" + + "ECIFIED\020\000\022\r\n\tCOMPLETED\020\001\022\016\n\nSUPERSEDED\020\002" + + "\022\016\n\nTERMINATED\020\003B\375\001\n)com.google.cloud.se" + + "curitycenter.v1p1beta1P\001ZSgoogle.golang." + + "org/genproto/googleapis/cloud/securityce" + + "nter/v1p1beta1;securitycenter\252\002%Google.C" + + "loud.SecurityCenter.V1P1Beta1\312\002%Google\\C" + + "loud\\SecurityCenter\\V1p1beta1\352\002(Google::" + + "Cloud::SecurityCenter::V1p1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryResponse_descriptor, + new java.lang.String[] { + "State", "Duration", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarks.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarks.java new file mode 100644 index 000000000..9a6182e02 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarks.java @@ -0,0 +1,1048 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/security_marks.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * User specified security marks that are attached to the parent Cloud Security
+ * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud
+ * SCC organization -- they can be modified and viewed by all users who have
+ * proper permissions on the organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.SecurityMarks} + */ +public final class SecurityMarks extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.SecurityMarks) + SecurityMarksOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityMarks.newBuilder() to construct. + private SecurityMarks(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityMarks() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecurityMarks(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecurityMarks( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + marks_ = + com.google.protobuf.MapField.newMapField(MarksDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry marks__ = + input.readMessage( + MarksDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + marks_.getMutableMap().put(marks__.getKey(), marks__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMarks(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.class, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MARKS_FIELD_NUMBER = 2; + + private static final class MarksDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_MarksEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField marks_; + + private com.google.protobuf.MapField internalGetMarks() { + if (marks_ == null) { + return com.google.protobuf.MapField.emptyMapField(MarksDefaultEntryHolder.defaultEntry); + } + return marks_; + } + + public int getMarksCount() { + return internalGetMarks().getMap().size(); + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public boolean containsMarks(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMarks().getMap().containsKey(key); + } + /** Use {@link #getMarksMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMarks() { + return getMarksMap(); + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public java.util.Map getMarksMap() { + return internalGetMarks().getMap(); + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMarks(), MarksDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry : + internalGetMarks().getMap().entrySet()) { + com.google.protobuf.MapEntry marks__ = + MarksDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, marks__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.SecurityMarks)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks other = + (com.google.cloud.securitycenter.v1p1beta1.SecurityMarks) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetMarks().equals(other.internalGetMarks())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (!internalGetMarks().getMap().isEmpty()) { + hash = (37 * hash) + MARKS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMarks().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * User specified security marks that are attached to the parent Cloud Security
+   * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud
+   * SCC organization -- they can be modified and viewed by all users who have
+   * proper permissions on the organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.SecurityMarks} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.SecurityMarks) + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMarks(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableMarks(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.class, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + internalGetMutableMarks().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks build() { + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks result = + new com.google.cloud.securitycenter.v1p1beta1.SecurityMarks(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.marks_ = internalGetMarks(); + result.marks_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.SecurityMarks) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.SecurityMarks) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.SecurityMarks other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableMarks().mergeFrom(other.internalGetMarks()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.SecurityMarks) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+     * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField marks_; + + private com.google.protobuf.MapField internalGetMarks() { + if (marks_ == null) { + return com.google.protobuf.MapField.emptyMapField(MarksDefaultEntryHolder.defaultEntry); + } + return marks_; + } + + private com.google.protobuf.MapField + internalGetMutableMarks() { + onChanged(); + ; + if (marks_ == null) { + marks_ = com.google.protobuf.MapField.newMapField(MarksDefaultEntryHolder.defaultEntry); + } + if (!marks_.isMutable()) { + marks_ = marks_.copy(); + } + return marks_; + } + + public int getMarksCount() { + return internalGetMarks().getMap().size(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public boolean containsMarks(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMarks().getMap().containsKey(key); + } + /** Use {@link #getMarksMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMarks() { + return getMarksMap(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public java.util.Map getMarksMap() { + return internalGetMarks().getMap(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMarks() { + internalGetMutableMarks().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public Builder removeMarks(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMarks().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMarks() { + return internalGetMutableMarks().getMutableMap(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public Builder putMarks(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMarks().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   * Keys and values are treated as case insensitive
+     *   * Keys must be between 1 - 256 characters (inclusive)
+     *   * Keys must be letters, numbers, underscores, or dashes
+     *   * Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public Builder putAllMarks(java.util.Map values) { + internalGetMutableMarks().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.SecurityMarks) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.SecurityMarks) + private static final com.google.cloud.securitycenter.v1p1beta1.SecurityMarks DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.SecurityMarks(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityMarks parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecurityMarks(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksName.java new file mode 100644 index 000000000..25a97f663 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksName.java @@ -0,0 +1,321 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SecurityMarksName implements ResourceName { + + @Deprecated + protected SecurityMarksName() {} + + private static final PathTemplate ORGANIZATION_ASSET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/assets/{asset}/securityMarks"); + private static final PathTemplate ORGANIZATION_SOURCE_FINDING_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String organization; + private String asset; + private String source; + private String finding; + + public String getOrganization() { + return organization; + } + + public String getAsset() { + return asset; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + private SecurityMarksName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + asset = Preconditions.checkNotNull(builder.getAsset()); + pathTemplate = ORGANIZATION_ASSET_PATH_TEMPLATE; + } + + private SecurityMarksName(OrganizationSourceFindingBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + source = Preconditions.checkNotNull(builder.getSource()); + finding = Preconditions.checkNotNull(builder.getFinding()); + pathTemplate = ORGANIZATION_SOURCE_FINDING_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newOrganizationAssetBuilder() { + return new Builder(); + } + + public static OrganizationSourceFindingBuilder newOrganizationSourceFindingBuilder() { + return new OrganizationSourceFindingBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SecurityMarksName of(String organization, String asset) { + return newOrganizationAssetBuilder().setOrganization(organization).setAsset(asset).build(); + } + + public static SecurityMarksName ofOrganizationAssetName(String organization, String asset) { + return newOrganizationAssetBuilder().setOrganization(organization).setAsset(asset).build(); + } + + public static SecurityMarksName ofOrganizationSourceFindingName( + String organization, String source, String finding) { + return newOrganizationSourceFindingBuilder() + .setOrganization(organization) + .setSource(source) + .setFinding(finding) + .build(); + } + + public static String format(String organization, String asset) { + return newBuilder().setOrganization(organization).setAsset(asset).build().toString(); + } + + public static String formatOrganizationAssetName(String organization, String asset) { + return newBuilder().setOrganization(organization).setAsset(asset).build().toString(); + } + + public static String formatOrganizationSourceFindingName( + String organization, String source, String finding) { + return newOrganizationSourceFindingBuilder() + .setOrganization(organization) + .setSource(source) + .setFinding(finding) + .build() + .toString(); + } + + public static SecurityMarksName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (ORGANIZATION_ASSET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_ASSET_PATH_TEMPLATE.match(formattedString); + return ofOrganizationAssetName(matchMap.get("organization"), matchMap.get("asset")); + } else if (ORGANIZATION_SOURCE_FINDING_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_SOURCE_FINDING_PATH_TEMPLATE.match(formattedString); + return ofOrganizationSourceFindingName( + matchMap.get("organization"), matchMap.get("source"), matchMap.get("finding")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (SecurityMarksName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_ASSET_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_SOURCE_FINDING_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (asset != null) { + fieldMapBuilder.put("asset", asset); + } + if (source != null) { + fieldMapBuilder.put("source", source); + } + if (finding != null) { + fieldMapBuilder.put("finding", finding); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for organizations/{organization}/assets/{asset}/securityMarks. */ + public static class Builder { + + private String organization; + private String asset; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getAsset() { + return asset; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setAsset(String asset) { + this.asset = asset; + return this; + } + + private Builder(SecurityMarksName securityMarksName) { + Preconditions.checkArgument( + securityMarksName.pathTemplate == ORGANIZATION_ASSET_PATH_TEMPLATE, + "toBuilder is only supported when SecurityMarksName has the pattern of " + + "organizations/{organization}/assets/{asset}/securityMarks."); + organization = securityMarksName.organization; + asset = securityMarksName.asset; + } + + public SecurityMarksName build() { + return new SecurityMarksName(this); + } + } + + /** Builder for organizations/{organization}/sources/{source}/findings/{finding}/securityMarks. */ + public static class OrganizationSourceFindingBuilder { + + private String organization; + private String source; + private String finding; + + private OrganizationSourceFindingBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public OrganizationSourceFindingBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationSourceFindingBuilder setSource(String source) { + this.source = source; + return this; + } + + public OrganizationSourceFindingBuilder setFinding(String finding) { + this.finding = finding; + return this; + } + + public SecurityMarksName build() { + return new SecurityMarksName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o == null || getClass() != o.getClass()) { + SecurityMarksName that = (SecurityMarksName) o; + return (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.asset, that.asset)) + && (Objects.equals(this.source, that.source)) + && (Objects.equals(this.finding, that.finding)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(asset); + h *= 1000003; + h ^= Objects.hashCode(source); + h *= 1000003; + h ^= Objects.hashCode(finding); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksNames.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksNames.java new file mode 100644 index 000000000..11c914ebc --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksNames.java @@ -0,0 +1,32 @@ +/* + * 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; + +/** + * AUTO-GENERATED DOCUMENTATION AND CLASS + * + * @deprecated This resource name class will be removed in the next major version. + */ +@javax.annotation.Generated("by GAPIC protoc plugin") +@Deprecated +public class SecurityMarksNames { + private SecurityMarksNames() {} + + public static SecurityMarksName parse(String resourceNameString) { + return UntypedSecurityMarksName.parse(resourceNameString); + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOrBuilder.java new file mode 100644 index 000000000..17eb9edf9 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOrBuilder.java @@ -0,0 +1,142 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/security_marks.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface SecurityMarksOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.SecurityMarks) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/{organization_id}/assets/{asset_id}/securityMarks"
+   * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + int getMarksCount(); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + boolean containsMarks(java.lang.String key); + /** Use {@link #getMarksMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMarks(); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + java.util.Map getMarksMap(); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + java.lang.String getMarksOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   * Keys and values are treated as case insensitive
+   *   * Keys must be between 1 - 256 characters (inclusive)
+   *   * Keys must be letters, numbers, underscores, or dashes
+   *   * Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + java.lang.String getMarksOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOuterClass.java new file mode 100644 index 000000000..246f18e41 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecurityMarksOuterClass.java @@ -0,0 +1,103 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/security_marks.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class SecurityMarksOuterClass { + private SecurityMarksOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_MarksEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_MarksEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n:google/cloud/securitycenter/v1p1beta1/" + + "security_marks.proto\022%google.cloud.secur" + + "itycenter.v1p1beta1\032\034google/api/annotati" + + "ons.proto\032\031google/api/resource.proto\"\332\002\n" + + "\rSecurityMarks\022\014\n\004name\030\001 \001(\t\022N\n\005marks\030\002 " + + "\003(\0132?.google.cloud.securitycenter.v1p1be" + + "ta1.SecurityMarks.MarksEntry\032,\n\nMarksEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\274\001\352A\270" + + "\001\n+securitycenter.googleapis.com/Securit" + + "yMarks\0229organizations/{organization}/ass" + + "ets/{asset}/securityMarks\022Norganizations" + + "/{organization}/sources/{source}/finding" + + "s/{finding}/securityMarksB\375\001\n)com.google" + + ".cloud.securitycenter.v1p1beta1P\001ZSgoogl" + + "e.golang.org/genproto/googleapis/cloud/s" + + "ecuritycenter/v1p1beta1;securitycenter\252\002" + + "%Google.Cloud.SecurityCenter.V1P1Beta1\312\002" + + "%Google\\Cloud\\SecurityCenter\\V1p1beta1\352\002" + + "(Google::Cloud::SecurityCenter::V1p1beta" + + "1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor, + new java.lang.String[] { + "Name", "Marks", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_MarksEntry_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_MarksEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_SecurityMarks_MarksEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecuritycenterService.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecuritycenterService.java new file mode 100644 index 000000000..f90bd6ddf --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SecuritycenterService.java @@ -0,0 +1,821 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class SecuritycenterService { + private SecuritycenterService() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_PropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_PropertiesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nBgoogle/cloud/securitycenter/v1p1beta1/" + + "securitycenter_service.proto\022%google.clo" + + "ud.securitycenter.v1p1beta1\032Hgoogle/clou" + + "d/securitycenter/v1p1beta1/run_asset_dis" + + "covery_response.proto\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\0321google/cloud/securityc" + + "enter/v1p1beta1/asset.proto\0323google/clou" + + "d/securitycenter/v1p1beta1/finding.proto" + + "\032?google/cloud/securitycenter/v1p1beta1/" + + "notification_config.proto\032Agoogle/cloud/" + + "securitycenter/v1p1beta1/organization_se" + + "ttings.proto\032:google/cloud/securitycente" + + "r/v1p1beta1/security_marks.proto\0322google" + + "/cloud/securitycenter/v1p1beta1/source.p" + + "roto\032\036google/iam/v1/iam_policy.proto\032\032go" + + "ogle/iam/v1/policy.proto\032#google/longrun" + + "ning/operations.proto\032\036google/protobuf/d" + + "uration.proto\032\033google/protobuf/empty.pro" + + "to\032 google/protobuf/field_mask.proto\032\034go" + + "ogle/protobuf/struct.proto\032\037google/proto" + + "buf/timestamp.proto\"\263\001\n\024CreateFindingReq" + + "uest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$securityce" + + "nter.googleapis.com/Source\022\027\n\nfinding_id" + + "\030\002 \001(\tB\003\340A\002\022D\n\007finding\030\003 \001(\0132..google.cl" + + "oud.securitycenter.v1p1beta1.FindingB\003\340A" + + "\002\"\340\001\n\037CreateNotificationConfigRequest\022H\n" + + "\006parent\030\001 \001(\tB8\340A\002\372A2\n0cloudresourcemana" + + "ger.googleapis.com/Organization\022\026\n\tconfi" + + "g_id\030\002 \001(\tB\003\340A\002\022[\n\023notification_config\030\003" + + " \001(\01329.google.cloud.securitycenter.v1p1b" + + "eta1.NotificationConfigB\003\340A\002\"\243\001\n\023CreateS" + + "ourceRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2\n0cl" + + "oudresourcemanager.googleapis.com/Organi" + + "zation\022B\n\006source\030\002 \001(\0132-.google.cloud.se" + + "curitycenter.v1p1beta1.SourceB\003\340A\002\"i\n\037De" + + "leteNotificationConfigRequest\022F\n\004name\030\001 " + + "\001(\tB8\340A\002\372A2\n0securitycenter.googleapis.c" + + "om/NotificationConfig\"f\n\034GetNotification" + + "ConfigRequest\022F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0sec" + + "uritycenter.googleapis.com/NotificationC" + + "onfig\"j\n\036GetOrganizationSettingsRequest\022" + + "H\n\004name\030\001 \001(\tB:\340A\002\372A4\n2securitycenter.go" + + "ogleapis.com/OrganizationSettings\"N\n\020Get" + + "SourceRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$sec" + + "uritycenter.googleapis.com/Source\"\240\002\n\022Gr" + + "oupAssetsRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2" + + "\n0cloudresourcemanager.googleapis.com/Or" + + "ganization\022\016\n\006filter\030\002 \001(\t\022\025\n\010group_by\030\003" + + " \001(\tB\003\340A\002\0223\n\020compare_duration\030\004 \001(\0132\031.go" + + "ogle.protobuf.Duration\022-\n\tread_time\030\005 \001(" + + "\0132\032.google.protobuf.Timestamp\022\016\n\006having\030" + + "\006 \001(\t\022\022\n\npage_token\030\007 \001(\t\022\021\n\tpage_size\030\010" + + " \001(\005\"\277\001\n\023GroupAssetsResponse\022L\n\020group_by" + + "_results\030\001 \003(\01322.google.cloud.securityce" + + "nter.v1p1beta1.GroupResult\022-\n\tread_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\022\027\n\017nex" + + "t_page_token\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\"\226" + + "\002\n\024GroupFindingsRequest\022<\n\006parent\030\001 \001(\tB" + + ",\340A\002\372A&\n$securitycenter.googleapis.com/S" + + "ource\022\016\n\006filter\030\002 \001(\t\022\025\n\010group_by\030\003 \001(\tB" + + "\003\340A\002\022-\n\tread_time\030\004 \001(\0132\032.google.protobu" + + "f.Timestamp\0223\n\020compare_duration\030\005 \001(\0132\031." + + "google.protobuf.Duration\022\016\n\006having\030\006 \001(\t" + + "\022\022\n\npage_token\030\007 \001(\t\022\021\n\tpage_size\030\010 \001(\005\"" + + "\301\001\n\025GroupFindingsResponse\022L\n\020group_by_re" + + "sults\030\001 \003(\01322.google.cloud.securitycente" + + "r.v1p1beta1.GroupResult\022-\n\tread_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022\027\n\017next_p" + + "age_token\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\"\277\001\n\013" + + "GroupResult\022V\n\nproperties\030\001 \003(\0132B.google" + + ".cloud.securitycenter.v1p1beta1.GroupRes" + + "ult.PropertiesEntry\022\r\n\005count\030\002 \001(\003\032I\n\017Pr" + + "opertiesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(" + + "\0132\026.google.protobuf.Value:\0028\001\"\221\001\n\036ListNo" + + "tificationConfigsRequest\022H\n\006parent\030\001 \001(\t" + + "B8\340A\002\372A2\n0cloudresourcemanager.googleapi" + + "s.com/Organization\022\022\n\npage_token\030\002 \001(\t\022\021" + + "\n\tpage_size\030\003 \001(\005\"\223\001\n\037ListNotificationCo" + + "nfigsResponse\022W\n\024notification_configs\030\001 " + + "\003(\01329.google.cloud.securitycenter.v1p1be" + + "ta1.NotificationConfig\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"\205\001\n\022ListSourcesRequest\022H\n\006parent" + + "\030\001 \001(\tB8\340A\002\372A2\n0cloudresourcemanager.goo" + + "gleapis.com/Organization\022\022\n\npage_token\030\002" + + " \001(\t\022\021\n\tpage_size\030\007 \001(\005\"n\n\023ListSourcesRe" + + "sponse\022>\n\007sources\030\001 \003(\0132-.google.cloud.s" + + "ecuritycenter.v1p1beta1.Source\022\027\n\017next_p" + + "age_token\030\002 \001(\t\"\317\002\n\021ListAssetsRequest\022H\n" + + "\006parent\030\001 \001(\tB8\340A\002\372A2\n0cloudresourcemana" + + "ger.googleapis.com/Organization\022\016\n\006filte" + + "r\030\002 \001(\t\022\020\n\010order_by\030\003 \001(\t\022-\n\tread_time\030\004" + + " \001(\0132\032.google.protobuf.Timestamp\0223\n\020comp" + + "are_duration\030\005 \001(\0132\031.google.protobuf.Dur" + + "ation\022\016\n\006having\030\006 \001(\t\0223\n\nfield_mask\030\007 \001(" + + "\0132\032.google.protobuf.FieldMaskB\003\340A\001\022\022\n\npa" + + "ge_token\030\010 \001(\t\022\021\n\tpage_size\030\t \001(\005\"\330\003\n\022Li" + + "stAssetsResponse\022g\n\023list_assets_results\030" + + "\001 \003(\0132J.google.cloud.securitycenter.v1p1" + + "beta1.ListAssetsResponse.ListAssetsResul" + + "t\022-\n\tread_time\030\002 \001(\0132\032.google.protobuf.T" + + "imestamp\022\027\n\017next_page_token\030\003 \001(\t\022\022\n\ntot" + + "al_size\030\004 \001(\005\032\374\001\n\020ListAssetsResult\022;\n\005as" + + "set\030\001 \001(\0132,.google.cloud.securitycenter." + + "v1p1beta1.Asset\022l\n\014state_change\030\002 \001(\0162V." + + "google.cloud.securitycenter.v1p1beta1.Li" + + "stAssetsResponse.ListAssetsResult.StateC" + + "hange\"=\n\013StateChange\022\n\n\006UNUSED\020\000\022\t\n\005ADDE" + + "D\020\001\022\013\n\007REMOVED\020\002\022\n\n\006ACTIVE\020\003\"\305\002\n\023ListFin" + + "dingsRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$se" + + "curitycenter.googleapis.com/Source\022\016\n\006fi" + + "lter\030\002 \001(\t\022\020\n\010order_by\030\003 \001(\t\022-\n\tread_tim" + + "e\030\004 \001(\0132\032.google.protobuf.Timestamp\0223\n\020c" + + "ompare_duration\030\005 \001(\0132\031.google.protobuf." + + "Duration\022\016\n\006having\030\006 \001(\t\0223\n\nfield_mask\030\007" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\022\022\n" + + "\npage_token\030\010 \001(\t\022\021\n\tpage_size\030\t \001(\005\"\345\005\n" + + "\024ListFindingsResponse\022m\n\025list_findings_r" + + "esults\030\001 \003(\0132N.google.cloud.securitycent" + + "er.v1p1beta1.ListFindingsResponse.ListFi" + + "ndingsResult\022-\n\tread_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\022\027\n\017next_page_token\030\003" + + " \001(\t\022\022\n\ntotal_size\030\004 \001(\005\032\201\004\n\022ListFinding" + + "sResult\022?\n\007finding\030\001 \001(\0132..google.cloud." + + "securitycenter.v1p1beta1.Finding\022p\n\014stat" + + "e_change\030\002 \001(\0162Z.google.cloud.securityce" + + "nter.v1p1beta1.ListFindingsResponse.List" + + "FindingsResult.StateChange\022i\n\010resource\030\003" + + " \001(\0132W.google.cloud.securitycenter.v1p1b" + + "eta1.ListFindingsResponse.ListFindingsRe" + + "sult.Resource\032~\n\010Resource\022\014\n\004name\030\001 \001(\t\022" + + "\024\n\014project_name\030\002 \001(\t\022\034\n\024project_display" + + "_name\030\003 \001(\t\022\023\n\013parent_name\030\004 \001(\t\022\033\n\023pare" + + "nt_display_name\030\005 \001(\t\"M\n\013StateChange\022\n\n\006" + + "UNUSED\020\000\022\013\n\007CHANGED\020\001\022\r\n\tUNCHANGED\020\002\022\t\n\005" + + "ADDED\020\003\022\013\n\007REMOVED\020\004\"\324\001\n\026SetFindingState" + + "Request\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%securityc" + + "enter.googleapis.com/Finding\022H\n\005state\030\002 " + + "\001(\01624.google.cloud.securitycenter.v1p1be" + + "ta1.Finding.StateB\003\340A\002\0223\n\nstart_time\030\003 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\002\"d\n\030R" + + "unAssetDiscoveryRequest\022H\n\006parent\030\001 \001(\tB" + + "8\340A\002\372A2\n0cloudresourcemanager.googleapis" + + ".com/Organization\"\215\001\n\024UpdateFindingReque" + + "st\022D\n\007finding\030\001 \001(\0132..google.cloud.secur" + + "itycenter.v1p1beta1.FindingB\003\340A\002\022/\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "k\"\257\001\n\037UpdateNotificationConfigRequest\022[\n" + + "\023notification_config\030\001 \001(\01329.google.clou" + + "d.securitycenter.v1p1beta1.NotificationC" + + "onfigB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google" + + ".protobuf.FieldMask\"\265\001\n!UpdateOrganizati" + + "onSettingsRequest\022_\n\025organization_settin" + + "gs\030\001 \001(\0132;.google.cloud.securitycenter.v" + + "1p1beta1.OrganizationSettingsB\003\340A\002\022/\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "ask\"\212\001\n\023UpdateSourceRequest\022B\n\006source\030\001 " + + "\001(\0132-.google.cloud.securitycenter.v1p1be" + + "ta1.SourceB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMask\"\320\001\n\032UpdateSecur" + + "ityMarksRequest\022Q\n\016security_marks\030\001 \001(\0132" + + "4.google.cloud.securitycenter.v1p1beta1." + + "SecurityMarksB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132" + + "\032.google.protobuf.FieldMask\022.\n\nstart_tim" + + "e\030\003 \001(\0132\032.google.protobuf.Timestamp2\206+\n\016" + + "SecurityCenter\022\306\001\n\014CreateSource\022:.google" + + ".cloud.securitycenter.v1p1beta1.CreateSo" + + "urceRequest\032-.google.cloud.securitycente" + + "r.v1p1beta1.Source\"K\202\323\344\223\0025\"+/v1p1beta1/{" + + "parent=organizations/*}/sources:\006source\332" + + "A\rparent,source\022\375\001\n\rCreateFinding\022;.goog" + + "le.cloud.securitycenter.v1p1beta1.Create" + + "FindingRequest\032..google.cloud.securityce" + + "nter.v1p1beta1.Finding\"\177\202\323\344\223\002A\"6/v1p1bet" + + "a1/{parent=organizations/*/sources/*}/fi" + + "ndings:\007finding\332A\031parent,finding_id,find" + + "ing\332A\031parent,finding,finding_id\022\270\002\n\030Crea" + + "teNotificationConfig\022F.google.cloud.secu" + + "ritycenter.v1p1beta1.CreateNotificationC" + + "onfigRequest\0329.google.cloud.securitycent" + + "er.v1p1beta1.NotificationConfig\"\230\001\202\323\344\223\002N" + + "\"7/v1p1beta1/{parent=organizations/*}/no" + + "tificationConfigs:\023notification_config\332A" + + "$parent,config_id,notification_config\332A\032" + + "parent,notification_config\022\302\001\n\030DeleteNot" + + "ificationConfig\022F.google.cloud.securityc" + + "enter.v1p1beta1.DeleteNotificationConfig" + + "Request\032\026.google.protobuf.Empty\"F\202\323\344\223\0029*" + + "7/v1p1beta1/{name=organizations/*/notifi" + + "cationConfigs/*}\332A\004name\022\235\001\n\014GetIamPolicy" + + "\022\".google.iam.v1.GetIamPolicyRequest\032\025.g" + + "oogle.iam.v1.Policy\"R\202\323\344\223\002A\"/v1p1beta1/{finding.name=organizatio" + + "ns/*/sources/*/findings/*}:\007finding\332A\007fi" + + "nding\332A\023finding,update_mask\022\300\002\n\030UpdateNo" + + "tificationConfig\022F.google.cloud.security" + + "center.v1p1beta1.UpdateNotificationConfi" + + "gRequest\0329.google.cloud.securitycenter.v" + + "1p1beta1.NotificationConfig\"\240\001\202\323\344\223\002b2K/v" + + "1p1beta1/{notification_config.name=organ" + + "izations/*/notificationConfigs/*}:\023notif" + + "ication_config\332A\023notification_config\332A\037n" + + "otification_config,update_mask\022\251\002\n\032Updat" + + "eOrganizationSettings\022H.google.cloud.sec" + + "uritycenter.v1p1beta1.UpdateOrganization" + + "SettingsRequest\032;.google.cloud.securityc" + + "enter.v1p1beta1.OrganizationSettings\"\203\001\202" + + "\323\344\223\002e2L/v1p1beta1/{organization_settings" + + ".name=organizations/*/organizationSettin" + + "gs}:\025organization_settings\332A\025organizatio" + + "n_settings\022\333\001\n\014UpdateSource\022:.google.clo" + + "ud.securitycenter.v1p1beta1.UpdateSource" + + "Request\032-.google.cloud.securitycenter.v1" + + "p1beta1.Source\"`\202\323\344\223\002<22/v1p1beta1/{sour" + + "ce.name=organizations/*/sources/*}:\006sour" + + "ce\332A\006source\332A\022source,update_mask\022\206\003\n\023Upd" + + "ateSecurityMarks\022A.google.cloud.security" + + "center.v1p1beta1.UpdateSecurityMarksRequ" + + "est\0324.google.cloud.securitycenter.v1p1be" + + "ta1.SecurityMarks\"\365\001\202\323\344\223\002\300\0012G/v1p1beta1/" + + "{security_marks.name=organizations/*/ass" + + "ets/*/securityMarks}:\016security_marksZe2S" + + "/v1p1beta1/{security_marks.name=organiza" + + "tions/*/sources/*/findings/*/securityMar" + + "ks}:\016security_marks\332A\016security_marks\332A\032s" + + "ecurity_marks,update_mask\032Q\312A\035securityce" + + "nter.googleapis.com\322A.https://www.google" + + "apis.com/auth/cloud-platformB\375\001\n)com.goo" + + "gle.cloud.securitycenter.v1p1beta1P\001ZSgo" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/securitycenter/v1p1beta1;securitycente" + + "r\252\002%Google.Cloud.SecurityCenter.V1P1Beta" + + "1\312\002%Google\\Cloud\\SecurityCenter\\V1p1beta" + + "1\352\002(Google::Cloud::SecurityCenter::V1p1b" + + "eta1P\000b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass + .getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass + .getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass + .getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_CreateFindingRequest_descriptor, + new java.lang.String[] { + "Parent", "FindingId", "Finding", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_CreateNotificationConfigRequest_descriptor, + new java.lang.String[] { + "Parent", "ConfigId", "NotificationConfig", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_CreateSourceRequest_descriptor, + new java.lang.String[] { + "Parent", "Source", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_DeleteNotificationConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GetNotificationConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GetOrganizationSettingsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GetSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "GroupBy", + "CompareDuration", + "ReadTime", + "Having", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GroupAssetsResponse_descriptor, + new java.lang.String[] { + "GroupByResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "GroupBy", + "ReadTime", + "CompareDuration", + "Having", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GroupFindingsResponse_descriptor, + new java.lang.String[] { + "GroupByResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor, + new java.lang.String[] { + "Properties", "Count", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_PropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_PropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_GroupResult_PropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListNotificationConfigsResponse_descriptor, + new java.lang.String[] { + "NotificationConfigs", "NextPageToken", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListSourcesResponse_descriptor, + new java.lang.String[] { + "Sources", "NextPageToken", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "OrderBy", + "ReadTime", + "CompareDuration", + "Having", + "FieldMask", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor, + new java.lang.String[] { + "ListAssetsResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListAssetsResponse_ListAssetsResult_descriptor, + new java.lang.String[] { + "Asset", "StateChange", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "OrderBy", + "ReadTime", + "CompareDuration", + "Having", + "FieldMask", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor, + new java.lang.String[] { + "ListFindingsResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor, + new java.lang.String[] { + "Finding", "StateChange", "Resource", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_descriptor = + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_ListFindingsResponse_ListFindingsResult_Resource_descriptor, + new java.lang.String[] { + "Name", "ProjectName", "ProjectDisplayName", "ParentName", "ParentDisplayName", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_descriptor, + new java.lang.String[] { + "Name", "State", "StartTime", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_RunAssetDiscoveryRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_descriptor, + new java.lang.String[] { + "Finding", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_descriptor, + new java.lang.String[] { + "NotificationConfig", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_descriptor, + new java.lang.String[] { + "OrganizationSettings", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_descriptor, + new java.lang.String[] { + "Source", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_descriptor, + new java.lang.String[] { + "SecurityMarks", "UpdateMask", "StartTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponseOuterClass.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.AssetOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.FindingOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequest.java new file mode 100644 index 000000000..c4fbd8d29 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequest.java @@ -0,0 +1,1119 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for updating a finding's state.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} + */ +public final class SetFindingStateRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + SetFindingStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetFindingStateRequest.newBuilder() to construct. + private SetFindingStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetFindingStateRequest() { + name_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetFindingStateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetFindingStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.class, + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_; + /** + * + * + *
+   * Required. The desired State of the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Required. The desired State of the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.Finding.State result = + com.google.cloud.securitycenter.v1p1beta1.Finding.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.State.UNRECOGNIZED + : result; + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Required. The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Required. The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Required. The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (state_ + != com.google.cloud.securitycenter.v1p1beta1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, state_); + } + if (startTime_ != null) { + output.writeMessage(3, getStartTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (state_ + != com.google.cloud.securitycenter.v1p1beta1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest other = + (com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (state_ != other.state_) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for updating a finding's state.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.class, + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + state_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest build() { + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest result = + new com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(this); + result.name_ = name_; + result.state_ = state_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Required. The desired State of the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Required. The desired State of the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The desired State of the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1p1beta1.Finding.State result = + com.google.cloud.securitycenter.v1p1beta1.Finding.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The desired State of the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.securitycenter.v1p1beta1.Finding.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The desired State of the finding.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Required. The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetFindingStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetFindingStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequestOrBuilder.java new file mode 100644 index 000000000..6866d87d0 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SetFindingStateRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface SetFindingStateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The desired State of the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Required. The desired State of the finding.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + com.google.cloud.securitycenter.v1p1beta1.Finding.State getState(); + + /** + * + * + *
+   * Required. The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Required. The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Required. The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Source.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Source.java new file mode 100644 index 000000000..3b7d71c0f --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/Source.java @@ -0,0 +1,1082 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/source.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Cloud Security Command Center's (Cloud SCC) finding source. A finding source
+ * is an entity or a mechanism that can produce a finding. A source is like a
+ * container of findings that come from the same scanner, logger, monitor, etc.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Source} + */ +public final class Source extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.Source) + SourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Source() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Source(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Source( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Source.class, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The source's display name.
+   * A source's display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must have a length between 1 and 64 characters
+   * (inclusive).
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The source's display name.
+   * A source's display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must have a length between 1 and 64 characters
+   * (inclusive).
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.Source)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.Source other = + (com.google.cloud.securitycenter.v1p1beta1.Source) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.securitycenter.v1p1beta1.Source prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Cloud Security Command Center's (Cloud SCC) finding source. A finding source
+   * is an entity or a mechanism that can produce a finding. A source is like a
+   * container of findings that come from the same scanner, logger, monitor, etc.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.Source} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.Source) + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.Source.class, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.Source.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1p1beta1_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Source getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Source build() { + com.google.cloud.securitycenter.v1p1beta1.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Source buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.Source result = + new com.google.cloud.securitycenter.v1p1beta1.Source(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.Source) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.Source) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.Source other) { + if (other == com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1p1beta1.Source) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/{organization_id}/sources/{source_id}"
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The source's display name.
+     * A source's display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must have a length between 1 and 64 characters
+     * (inclusive).
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The source's display name.
+     * A source's display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must have a length between 1 and 64 characters
+     * (inclusive).
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The source's display name.
+     * A source's display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must have a length between 1 and 64 characters
+     * (inclusive).
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The source's display name.
+     * A source's display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must have a length between 1 and 64 characters
+     * (inclusive).
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The source's display name.
+     * A source's display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must have a length between 1 and 64 characters
+     * (inclusive).
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.Source) + private static final com.google.cloud.securitycenter.v1p1beta1.Source DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.Source(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.Source getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceName.java new file mode 100644 index 000000000..a836b9da7 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceName.java @@ -0,0 +1,182 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SourceName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sources/{source}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String source; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private SourceName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + source = Preconditions.checkNotNull(builder.getSource()); + } + + public static SourceName of(String organization, String source) { + return newBuilder().setOrganization(organization).setSource(source).build(); + } + + public static String format(String organization, String source) { + return newBuilder().setOrganization(organization).setSource(source).build().toString(); + } + + public static SourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "SourceName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("source")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (SourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("source", source); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "source", source); + } + + /** Builder for SourceName. */ + public static class Builder { + + private String organization; + private String source; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + private Builder() {} + + private Builder(SourceName sourceName) { + organization = sourceName.organization; + source = sourceName.source; + } + + public SourceName build() { + return new SourceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SourceName) { + SourceName that = (SourceName) o; + return (this.organization.equals(that.organization)) && (this.source.equals(that.source)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= source.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOrBuilder.java new file mode 100644 index 000000000..24588eeea --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOrBuilder.java @@ -0,0 +1,126 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/source.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface SourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.Source) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/{organization_id}/sources/{source_id}"
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The source's display name.
+   * A source's display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must have a length between 1 and 64 characters
+   * (inclusive).
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The source's display name.
+   * A source's display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must have a length between 1 and 64 characters
+   * (inclusive).
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOuterClass.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOuterClass.java new file mode 100644 index 000000000..52e466c70 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/SourceOuterClass.java @@ -0,0 +1,84 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/source.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public final class SourceOuterClass { + private SourceOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1p1beta1_Source_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1p1beta1_Source_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/securitycenter/v1p1beta1/" + + "source.proto\022%google.cloud.securitycente" + + "r.v1p1beta1\032\034google/api/annotations.prot" + + "o\032\031google/api/resource.proto\"\233\001\n\006Source\022" + + "\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\023\n\013d" + + "escription\030\003 \001(\t:X\352AU\n$securitycenter.go" + + "ogleapis.com/Source\022-organizations/{orga" + + "nization}/sources/{source}B\375\001\n)com.googl" + + "e.cloud.securitycenter.v1p1beta1P\001ZSgoog" + + "le.golang.org/genproto/googleapis/cloud/" + + "securitycenter/v1p1beta1;securitycenter\252" + + "\002%Google.Cloud.SecurityCenter.V1P1Beta1\312" + + "\002%Google\\Cloud\\SecurityCenter\\V1p1beta1\352" + + "\002(Google::Cloud::SecurityCenter::V1p1bet" + + "a1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v1p1beta1_Source_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1p1beta1_Source_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1p1beta1_Source_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/TopicName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/TopicName.java new file mode 100644 index 000000000..f8920912d --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/TopicName.java @@ -0,0 +1,182 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class TopicName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/topics/{topic}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String topic; + + public String getProject() { + return project; + } + + public String getTopic() { + return topic; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private TopicName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + topic = Preconditions.checkNotNull(builder.getTopic()); + } + + public static TopicName of(String project, String topic) { + return newBuilder().setProject(project).setTopic(topic).build(); + } + + public static String format(String project, String topic) { + return newBuilder().setProject(project).setTopic(topic).build().toString(); + } + + public static TopicName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "TopicName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("topic")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (TopicName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("topic", topic); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "topic", topic); + } + + /** Builder for TopicName. */ + public static class Builder { + + private String project; + private String topic; + + public String getProject() { + return project; + } + + public String getTopic() { + return topic; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setTopic(String topic) { + this.topic = topic; + return this; + } + + private Builder() {} + + private Builder(TopicName topicName) { + project = topicName.project; + topic = topicName.topic; + } + + public TopicName build() { + return new TopicName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TopicName) { + TopicName that = (TopicName) o; + return (this.project.equals(that.project)) && (this.topic.equals(that.topic)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= topic.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UntypedSecurityMarksName.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UntypedSecurityMarksName.java new file mode 100644 index 000000000..3529560b2 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UntypedSecurityMarksName.java @@ -0,0 +1,106 @@ +/* + * 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; + +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * AUTO-GENERATED DOCUMENTATION AND CLASS + * + * @deprecated This resource name class will be removed in the next major version. + */ +@javax.annotation.Generated("by GAPIC protoc plugin") +@Deprecated +public class UntypedSecurityMarksName extends SecurityMarksName { + + private final String rawValue; + private Map valueMap; + + private UntypedSecurityMarksName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedSecurityMarksName from(ResourceName resourceName) { + return new UntypedSecurityMarksName(resourceName.toString()); + } + + public static UntypedSecurityMarksName parse(String formattedString) { + return new UntypedSecurityMarksName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedSecurityMarksName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** Return a map with a single value rawValue keyed on an empty String "". */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** Return the initial rawValue if @param fieldName is an empty String, else return null. */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedSecurityMarksName) { + UntypedSecurityMarksName that = (UntypedSecurityMarksName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequest.java new file mode 100644 index 000000000..547c1dfcb --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequest.java @@ -0,0 +1,1140 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for updating or creating a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} + */ +public final class UpdateFindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + UpdateFindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFindingRequest.newBuilder() to construct. + private UpdateFindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFindingRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFindingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Finding.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(finding_); + finding_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.Builder.class); + } + + public static final int FINDING_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.Finding 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return finding_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + return getFinding(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (finding_ != null) { + output.writeMessage(1, getFinding()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (finding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFinding()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest other = + (com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) obj; + + if (hasFinding() != other.hasFinding()) return false; + if (hasFinding()) { + if (!getFinding().equals(other.getFinding())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFinding()) { + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for updating or creating a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingBuilder_ == null) { + finding_ = null; + } else { + finding_ = null; + findingBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest build() { + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest result = + new com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest(this); + if (findingBuilder_ == null) { + result.finding_ = finding_; + } else { + result.finding_ = findingBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.getDefaultInstance()) + return this; + if (other.hasFinding()) { + mergeFinding(other.getFinding()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Finding finding_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the finding field is set. + */ + public boolean hasFinding() { + return findingBuilder_ != null || finding_ != null; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The finding. + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : finding_; + } else { + return findingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finding_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + finding_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1p1beta1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1p1beta1.Finding.newBuilder(finding_) + .mergeFrom(value) + .buildPartial(); + } else { + finding_ = value; + } + onChanged(); + } else { + findingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + finding_ = null; + onChanged(); + } else { + finding_ = null; + findingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Finding.Builder getFindingBuilder() { + + onChanged(); + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Finding.getDefaultInstance() + : 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.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Finding, + com.google.cloud.securitycenter.v1p1beta1.Finding.Builder, + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder>( + getFinding(), getParentForChildren(), isClean()); + finding_ = null; + } + return findingBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequestOrBuilder.java new file mode 100644 index 000000000..c9b3403da --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateFindingRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface UpdateFindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the finding field is set. + */ + boolean hasFinding(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The finding. + */ + com.google.cloud.securitycenter.v1p1beta1.Finding getFinding(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Finding finding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.FindingOrBuilder getFindingOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequest.java new file mode 100644 index 000000000..100b9b0a9 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequest.java @@ -0,0 +1,1065 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for updating a notification config.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} + */ +public final class UpdateNotificationConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + UpdateNotificationConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateNotificationConfigRequest.newBuilder() to construct. + private UpdateNotificationConfigRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateNotificationConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateNotificationConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateNotificationConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder subBuilder = + null; + if (notificationConfig_ != null) { + subBuilder = notificationConfig_.toBuilder(); + } + notificationConfig_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(notificationConfig_); + notificationConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.Builder + .class); + } + + public static final int NOTIFICATION_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.NotificationConfig notificationConfig_; + /** + * + * + *
+   * Required. The notification config to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationConfig field is set. + */ + public boolean hasNotificationConfig() { + return notificationConfig_ != null; + } + /** + * + * + *
+   * Required. The notification config to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig() { + return notificationConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance() + : notificationConfig_; + } + /** + * + * + *
+   * Required. The notification config to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigOrBuilder() { + return getNotificationConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the notification config.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the notification config.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the notification config.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (notificationConfig_ != null) { + output.writeMessage(1, getNotificationConfig()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (notificationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getNotificationConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest other = + (com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) obj; + + if (hasNotificationConfig() != other.hasNotificationConfig()) return false; + if (hasNotificationConfig()) { + if (!getNotificationConfig().equals(other.getNotificationConfig())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNotificationConfig()) { + hash = (37 * hash) + NOTIFICATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNotificationConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for updating a notification config.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (notificationConfigBuilder_ == null) { + notificationConfig_ = null; + } else { + notificationConfig_ = null; + notificationConfigBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest build() { + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest result = + new com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest(this); + if (notificationConfigBuilder_ == null) { + result.notificationConfig_ = notificationConfig_; + } else { + result.notificationConfig_ = notificationConfigBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + .getDefaultInstance()) return this; + if (other.hasNotificationConfig()) { + mergeNotificationConfig(other.getNotificationConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.NotificationConfig notificationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + notificationConfigBuilder_; + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationConfig field is set. + */ + public boolean hasNotificationConfig() { + return notificationConfigBuilder_ != null || notificationConfig_ != null; + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationConfig. + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig() { + if (notificationConfigBuilder_ == null) { + return notificationConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance() + : notificationConfig_; + } else { + return notificationConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notificationConfig_ = value; + onChanged(); + } else { + notificationConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder builderForValue) { + if (notificationConfigBuilder_ == null) { + notificationConfig_ = builderForValue.build(); + onChanged(); + } else { + notificationConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNotificationConfig( + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig value) { + if (notificationConfigBuilder_ == null) { + if (notificationConfig_ != null) { + notificationConfig_ = + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.newBuilder( + notificationConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + notificationConfig_ = value; + } + onChanged(); + } else { + notificationConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNotificationConfig() { + if (notificationConfigBuilder_ == null) { + notificationConfig_ = null; + onChanged(); + } else { + notificationConfig_ = null; + notificationConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder + getNotificationConfigBuilder() { + + onChanged(); + return getNotificationConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigOrBuilder() { + if (notificationConfigBuilder_ != null) { + return notificationConfigBuilder_.getMessageOrBuilder(); + } else { + return notificationConfig_ == null + ? com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.getDefaultInstance() + : notificationConfig_; + } + } + /** + * + * + *
+     * Required. The notification config to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder> + getNotificationConfigFieldBuilder() { + if (notificationConfigBuilder_ == null) { + notificationConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig.Builder, + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder>( + getNotificationConfig(), getParentForChildren(), isClean()); + notificationConfig_ = null; + } + return notificationConfigBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the notification config.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateNotificationConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateNotificationConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..43f0016eb --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateNotificationConfigRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface UpdateNotificationConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The notification config to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the notificationConfig field is set. + */ + boolean hasNotificationConfig(); + /** + * + * + *
+   * Required. The notification config to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The notificationConfig. + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfig getNotificationConfig(); + /** + * + * + *
+   * Required. The notification config to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.NotificationConfig notification_config = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.NotificationConfigOrBuilder + getNotificationConfigOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the notification config.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the notification config.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the notification config.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequest.java new file mode 100644 index 000000000..fe2b16072 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequest.java @@ -0,0 +1,1072 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for updating an organization's settings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} + */ +public final class UpdateOrganizationSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + UpdateOrganizationSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateOrganizationSettingsRequest.newBuilder() to construct. + private UpdateOrganizationSettingsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateOrganizationSettingsRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateOrganizationSettingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateOrganizationSettingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder subBuilder = + null; + if (organizationSettings_ != null) { + subBuilder = organizationSettings_.toBuilder(); + } + organizationSettings_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(organizationSettings_); + organizationSettings_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.Builder + .class); + } + + public static final int ORGANIZATION_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings organizationSettings_; + /** + * + * + *
+   * Required. The organization settings resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the organizationSettings field is set. + */ + public boolean hasOrganizationSettings() { + return organizationSettings_ != null; + } + /** + * + * + *
+   * Required. The organization settings resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The organizationSettings. + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings getOrganizationSettings() { + return organizationSettings_ == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.getDefaultInstance() + : organizationSettings_; + } + /** + * + * + *
+   * Required. The organization settings resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder + getOrganizationSettingsOrBuilder() { + return getOrganizationSettings(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (organizationSettings_ != null) { + output.writeMessage(1, getOrganizationSettings()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (organizationSettings_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOrganizationSettings()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest other = + (com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) obj; + + if (hasOrganizationSettings() != other.hasOrganizationSettings()) return false; + if (hasOrganizationSettings()) { + if (!getOrganizationSettings().equals(other.getOrganizationSettings())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOrganizationSettings()) { + hash = (37 * hash) + ORGANIZATION_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationSettings().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for updating an organization's settings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (organizationSettingsBuilder_ == null) { + organizationSettings_ = null; + } else { + organizationSettings_ = null; + organizationSettingsBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest build() { + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest result = + new com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest(this); + if (organizationSettingsBuilder_ == null) { + result.organizationSettings_ = organizationSettings_; + } else { + result.organizationSettings_ = organizationSettingsBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + .getDefaultInstance()) return this; + if (other.hasOrganizationSettings()) { + mergeOrganizationSettings(other.getOrganizationSettings()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings organizationSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder> + organizationSettingsBuilder_; + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the organizationSettings field is set. + */ + public boolean hasOrganizationSettings() { + return organizationSettingsBuilder_ != null || organizationSettings_ != null; + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The organizationSettings. + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings + getOrganizationSettings() { + if (organizationSettingsBuilder_ == null) { + return organizationSettings_ == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.getDefaultInstance() + : organizationSettings_; + } else { + return organizationSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings value) { + if (organizationSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + organizationSettings_ = value; + onChanged(); + } else { + organizationSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder builderForValue) { + if (organizationSettingsBuilder_ == null) { + organizationSettings_ = builderForValue.build(); + onChanged(); + } else { + organizationSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOrganizationSettings( + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings value) { + if (organizationSettingsBuilder_ == null) { + if (organizationSettings_ != null) { + organizationSettings_ = + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.newBuilder( + organizationSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + organizationSettings_ = value; + } + onChanged(); + } else { + organizationSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOrganizationSettings() { + if (organizationSettingsBuilder_ == null) { + organizationSettings_ = null; + onChanged(); + } else { + organizationSettings_ = null; + organizationSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder + getOrganizationSettingsBuilder() { + + onChanged(); + return getOrganizationSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder + getOrganizationSettingsOrBuilder() { + if (organizationSettingsBuilder_ != null) { + return organizationSettingsBuilder_.getMessageOrBuilder(); + } else { + return organizationSettings_ == null + ? com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.getDefaultInstance() + : organizationSettings_; + } + } + /** + * + * + *
+     * Required. The organization settings resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder> + getOrganizationSettingsFieldBuilder() { + if (organizationSettingsBuilder_ == null) { + organizationSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.Builder, + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder>( + getOrganizationSettings(), getParentForChildren(), isClean()); + organizationSettings_ = null; + } + return organizationSettingsBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateOrganizationSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateOrganizationSettingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequestOrBuilder.java new file mode 100644 index 000000000..4f8d8bcc1 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateOrganizationSettingsRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface UpdateOrganizationSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The organization settings resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the organizationSettings field is set. + */ + boolean hasOrganizationSettings(); + /** + * + * + *
+   * Required. The organization settings resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The organizationSettings. + */ + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettings getOrganizationSettings(); + /** + * + * + *
+   * Required. The organization settings resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.OrganizationSettings organization_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsOrBuilder + getOrganizationSettingsOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequest.java new file mode 100644 index 000000000..615fa1bf7 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequest.java @@ -0,0 +1,1366 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for updating a SecurityMarks resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} + */ +public final class UpdateSecurityMarksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + UpdateSecurityMarksRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSecurityMarksRequest.newBuilder() to construct. + private UpdateSecurityMarksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSecurityMarksRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSecurityMarksRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSecurityMarksRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityMarks_); + securityMarks_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.Builder.class); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.SecurityMarks securityMarks_; + /** + * + * + *
+   * Required. The security marks resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the securityMarks field is set. + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + * + * + *
+   * Required. The security marks resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The securityMarks. + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + /** + * + * + *
+   * Required. The security marks resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder + getSecurityMarksOrBuilder() { + return getSecurityMarks(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask 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>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : 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>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (securityMarks_ != null) { + output.writeMessage(1, getSecurityMarks()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (startTime_ != null) { + output.writeMessage(3, getStartTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (securityMarks_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSecurityMarks()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest other = + (com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) obj; + + if (hasSecurityMarks() != other.hasSecurityMarks()) return false; + if (hasSecurityMarks()) { + if (!getSecurityMarks().equals(other.getSecurityMarks())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSecurityMarks()) { + hash = (37 * hash) + SECURITY_MARKS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityMarks().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for updating a SecurityMarks resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest build() { + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest result = + new com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest(this); + if (securityMarksBuilder_ == null) { + result.securityMarks_ = securityMarks_; + } else { + result.securityMarks_ = securityMarksBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + .getDefaultInstance()) return this; + if (other.hasSecurityMarks()) { + mergeSecurityMarks(other.getSecurityMarks()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.SecurityMarks securityMarks_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder> + securityMarksBuilder_; + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the securityMarks field is set. + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The securityMarks. + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1p1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityMarks_ = value; + onChanged(); + } else { + securityMarksBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder builderForValue) { + if (securityMarksBuilder_ == null) { + securityMarks_ = builderForValue.build(); + onChanged(); + } else { + securityMarksBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSecurityMarks( + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.newBuilder(securityMarks_) + .mergeFrom(value) + .buildPartial(); + } else { + securityMarks_ = value; + } + onChanged(); + } else { + securityMarksBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSecurityMarks() { + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + onChanged(); + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder + getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder + getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + } + /** + * + * + *
+     * Required. The security marks resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder>( + getSecurityMarks(), getParentForChildren(), isClean()); + securityMarks_ = null; + } + return securityMarksBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : 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>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSecurityMarksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSecurityMarksRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequestOrBuilder.java new file mode 100644 index 000000000..e2a432975 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSecurityMarksRequestOrBuilder.java @@ -0,0 +1,151 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface UpdateSecurityMarksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The security marks resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the securityMarks field is set. + */ + boolean hasSecurityMarks(); + /** + * + * + *
+   * Required. The security marks resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The securityMarks. + */ + com.google.cloud.securitycenter.v1p1beta1.SecurityMarks getSecurityMarks(); + /** + * + * + *
+   * Required. The security marks resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.SecurityMarks security_marks = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + * + * + *
+   * 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>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequest.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequest.java new file mode 100644 index 000000000..085a1bc52 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequest.java @@ -0,0 +1,1041 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +/** + * + * + *
+ * Request message for updating a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} + */ +public final class UpdateSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + UpdateSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSourceRequest.newBuilder() to construct. + private UpdateSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSourceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSourceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSourceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1p1beta1.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.securitycenter.v1p1beta1.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.Builder.class); + } + + public static final int SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1p1beta1.Source source_; + /** + * + * + *
+   * Required. The source resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * Required. The source resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The source. + */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSource() { + return source_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance() + : source_; + } + /** + * + * + *
+   * Required. The source resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (source_ != null) { + output.writeMessage(1, getSource()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSource()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest other = + (com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) obj; + + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (!getSource().equals(other.getSource())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for updating a source.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.class, + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1p1beta1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1p1beta1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest build() { + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest result = + new com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest(this); + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest other) { + if (other + == com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.getDefaultInstance()) + return this; + if (other.hasSource()) { + mergeSource(other.getSource()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1p1beta1.Source source_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The source. + */ + public com.google.cloud.securitycenter.v1p1beta1.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSource(com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSource( + com.google.cloud.securitycenter.v1p1beta1.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSource(com.google.cloud.securitycenter.v1p1beta1.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.securitycenter.v1p1beta1.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.securitycenter.v1p1beta1.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * Required. The source resource to update.
+     * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1p1beta1.Source, + com.google.cloud.securitycenter.v1p1beta1.Source.Builder, + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + private static final com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSourceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequestOrBuilder.java b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequestOrBuilder.java new file mode 100644 index 000000000..16f58a217 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/java/com/google/cloud/securitycenter/v1p1beta1/UpdateSourceRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1p1beta1; + +public interface UpdateSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The source resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + * + * + *
+   * Required. The source resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The source. + */ + com.google.cloud.securitycenter.v1p1beta1.Source getSource(); + /** + * + * + *
+   * Required. The source resource to update.
+   * 
+ * + * + * .google.cloud.securitycenter.v1p1beta1.Source source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securitycenter.v1p1beta1.SourceOrBuilder getSourceOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/asset.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/asset.proto new file mode 100644 index 000000000..3e4b26a84 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -0,0 +1,119 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud +// Platform (GCP) resource. +// +// The Asset is a Cloud SCC resource that captures information about a single +// GCP resource. All modifications to an Asset are only within the context of +// Cloud SCC and don't affect the referenced GCP resource. +message Asset { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + }; + + // Cloud SCC managed properties. These properties are managed by Cloud SCC and + // cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the GCP resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the GCP resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Cloud SCC and/or the producer of the resource and is immutable + // after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + + // The user defined display name for this resource. + string resource_display_name = 6; + + // The user defined display name for the parent of this resource. + string resource_parent_display_name = 7; + + // The user defined display name for the project of this resource. + string resource_project_display_name = 8; + } + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + message IamPolicy { + // The JSON representation of the Policy associated with the asset. + // See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for + // format details. + string policy_blob = 1; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/assets/{asset_id}". + string name = 1; + + // Cloud SCC managed properties. These properties are managed by + // Cloud SCC and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the GCP resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Cloud SCC. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated, added, or deleted in Cloud + // SCC. + google.protobuf.Timestamp update_time = 10; + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + IamPolicy iam_policy = 11; +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/finding.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/finding.proto new file mode 100644 index 000000000..6428027df --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -0,0 +1,111 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Cloud Security Command Center (Cloud SCC) finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Cloud SCC for presentation, notification, analysis, +// policy testing, and enforcement. For example, an XSS vulnerability in an +// App Engine application is a finding. +message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + }; + + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/{organization_id}/sources/{source_id}" + string parent = 2; + + // For findings on Google Cloud Platform (GCP) resources, the full resource + // name of the GCP resource this finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-GCP resource, the resourceName can be a + // customer or partner defined string. + // This field is immutable after creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Cloud SCC + // where additional information about the finding can be found. This field is + // guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which the event took place. For example, if the finding + // represents an open firewall it would capture the time the detector believes + // the firewall became open. The accuracy is determined by the detector. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Cloud SCC. + google.protobuf.Timestamp create_time = 10; +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_config.proto new file mode 100644 index 000000000..7cbb87b24 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -0,0 +1,112 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// The Pub/Sub Topic resource definition is in google/cloud/pubsub/v1/, +// but we do not import that proto directly; therefore, we redefine the +// pattern here. +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Cloud Security Command Center (Cloud SCC) notification configs. +// +// A notification config is a Cloud SCC resource that contains the configuration +// to send notifications for create/update events of findings, assets and etc. +message NotificationConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/NotificationConfig" + pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + }; + + // The config for streaming-based notifications, which send each event as soon + // as it is detected. + message StreamingConfig { + // Expression that defines the filter to apply across create/update events + // of assets or findings as specified by the event type. The expression is a + // list of zero or more restrictions combined via logical operators `AND` + // and `OR`. Parentheses are supported, and `OR` has higher precedence than + // `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 1; + } + + // The type of events. + enum EventType { + // Unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // Events for findings. + FINDING = 1; + } + + // The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // The type of events the config is for, e.g. FINDING. + EventType event_type = 3; + + // The PubSub topic to send notifications to. Its format is + // "projects/[project_id]/topics/[topic]". + string pubsub_topic = 4 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the PubSub topic. + string service_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config for triggering notifications. + oneof notify_config { + // The config for triggering streaming-based notifications. + StreamingConfig streaming_config = 6; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_message.proto new file mode 100644 index 000000000..3abbcef32 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -0,0 +1,42 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1p1beta1/asset.proto"; +import "google/cloud/securitycenter/v1p1beta1/finding.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Cloud SCC's Notification +message NotificationMessage { + // Name of the notification config that generated current notification. + string notification_config_name = 1; + + // Notification Event. + oneof event { + // If it's a Finding based notification config, this field will be + // populated. + Finding finding = 2; + } +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/organization_settings.proto new file mode 100644 index 000000000..9c38b87ba --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -0,0 +1,83 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// User specified settings that are attached to the Cloud Security Command +// Center (Cloud SCC) organization. +message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto new file mode 100644 index 000000000..b8b9ea489 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -0,0 +1,53 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/security_marks.proto new file mode 100644 index 000000000..ac54bc19a --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -0,0 +1,57 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// User specified security marks that are attached to the parent Cloud Security +// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud +// SCC organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }; + + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto new file mode 100644 index 000000000..dcd9af683 --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -0,0 +1,1277 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import public "google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/asset.proto"; +import "google/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/notification_config.proto"; +import "google/cloud/securitycenter/v1p1beta1/organization_settings.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/cloud/securitycenter/v1p1beta1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// V1p1Beta1 APIs for Security Center service. +service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source"; + } + + // + // Creates a finding. The corresponding source must exist for finding + // creation to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + option (google.api.method_signature) = "parent,finding_id,finding"; + option (google.api.method_signature) = "parent,finding,finding_id"; + } + + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + body: "notification_config" + }; + option (google.api.method_signature) = + "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,notification_config"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/assets:group" + body: "*" + }; + } + + // 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 + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + option (google.api.method_signature) = "parent,group_by"; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } + + // 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 + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/sources" + }; + option (google.api.method_signature) = "parent"; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This 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. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse" + metadata_type: "google.protobuf.Empty" + }; + } + + // + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + }; + option (google.api.method_signature) = "name,state,start_time"; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + option (google.api.method_signature) = "finding"; + option (google.api.method_signature) = "finding,update_mask"; + } + + // Updates a notification config. + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}" + body: "notification_config" + }; + option (google.api.method_signature) = "notification_config"; + option (google.api.method_signature) = "notification_config,update_mask"; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + option (google.api.method_signature) = "organization_settings"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1p1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source"; + option (google.api.method_signature) = "source,update_mask"; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + option (google.api.method_signature) = "security_marks"; + option (google.api.method_signature) = "security_marks,update_mask"; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Required. Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // 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. + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a notification config. +message CreateNotificationConfigRequest { + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // 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. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Required. Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. + Source source = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for deleting a notification config. +message DeleteNotificationConfigRequest { + // Required. Name of the notification config to delete. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting a notification config. +message GetNotificationConfigRequest { + // Required. Name of the notification config to get. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; +} + +// Request message for getting a source. +message GetSourceRequest { + // Required. Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Required. Name of the organization to groupBy. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "update_time = \"2019-06-10T16:07:18-07:00\"" + // "update_time = 1560208038000" + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "create_time = \"2019-06-10T16:07:18-07:00\"" + // "create_time = 1560208038000" + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_name_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // * security_center_properties.resource_parent_display_name + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_parent_display_name + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // When compare_duration is set, the GroupResult's "state_change" property is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `state_change` is supported and + // requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "event_time = \"2019-06-10T16:07:18-07:00\"" + // "event_time = 1560208038000" + // + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // 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 + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the GroupResult's "state_change" attribute is + // updated to indicate whether the finding had its state changed, the + // finding's state remained unchanged, or if the finding was added during the + // compare_duration period of time that precedes the read_time. This is the + // time between (read_time - compare_duration) and read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present + // at read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `finding.state` and `state_change` + // are supported and requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing notification configs. +message ListNotificationConfigsRequest { + // Required. Name of the organization to list notification configs. + // Its format is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListNotificationConfigsResponse`; indicates + // that this is a continuation of a prior `ListNotificationConfigs` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 3; +} + +// Response message for listing notification configs. +message ListNotificationConfigsResponse { + // Notification configs belonging to the requested parent. + repeated NotificationConfig notification_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Required. Name of the organization assets should belong to. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following are the allowed field and operator combinations: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "update_time = \"2019-06-10T16:07:18-07:00\"" + // "update_time = 1560208038000" + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "create_time = \"2019-06-10T16:07:18-07:00\"" + // "create_time = 1560208038000" + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // update_time + // resource_properties + // security_marks.marks + // security_center_properties.resource_name + // security_center_properties.resource_display_name + // security_center_properties.resource_parent + // security_center_properties.resource_parent_display_name + // security_center_properties.resource_project + // security_center_properties.resource_project_display_name + // security_center_properties.resource_type + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetsResult's "state_change" + // attribute is updated to indicate whether the asset was added, removed, or + // remained present during the compare_duration period of time that precedes + // the read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `state_change` is supported and + // requires compare_duration to be specified. + string having = 6; + + // Optional. + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // The change in state of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state change + // will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // Asset was added between the points in time. + ADDED = 1; + + // Asset was removed between the points in time. + REMOVED = 2; + + // Asset was present at both point(s) in time. + ACTIVE = 3; + } + + // Asset matching the search request. + Asset asset = 1; + + // State change of the asset between the points in time. + StateChange state_change = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // name: `=` + // parent: `=`, `:` + // resource_name: `=`, `:` + // state: `=`, `:` + // category: `=`, `:` + // external_uri: `=`, `:` + // event_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "event_time = \"2019-06-10T16:07:18-07:00\"" + // "event_time = 1560208038000" + // + // security_marks.marks: `=`, `:` + // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // parent + // state + // category + // resource_name + // event_time + // source_properties + // security_marks.marks + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListFindingsResult's "state_change" + // attribute is updated to indicate whether the finding had its state changed, + // the finding's state remained unchanged, or if the finding was added in any + // state during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `finding.state` and `state_change` + // are supported and requires compare_duration to be specified. + string having = 6; + + // Optional. + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Result containing the Finding and its StateChange. + message ListFindingsResult { + // Information related to the Google Cloud Platform (GCP) resource that is + // associated with this finding. + message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project_name = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent_name = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + } + + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + + // Finding matching the search request. + Finding finding = 1; + + // State change of the finding between the points in time. + StateChange state_change = 2; + + // Output only. Resource that is associated with this finding. + Resource resource = 3; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // 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}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // 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. + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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." in the field + // mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a notification config. +message UpdateNotificationConfigRequest { + // Required. The notification config to update. + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the notification config. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the settings resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the source resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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.". + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + // If not set uses current server time. Updates will be applied to the + // SecurityMarks that are active immediately preceding this time. + google.protobuf.Timestamp start_time = 3; +} diff --git a/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/source.proto b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/source.proto new file mode 100644 index 000000000..d591a05cc --- /dev/null +++ b/proto-google-cloud-securitycenter-v1p1beta1/src/main/proto/google/cloud/securitycenter/v1p1beta1/source.proto @@ -0,0 +1,60 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + }; + + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}" + string name = 1; + + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must have a length between 1 and 64 characters + // (inclusive). + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Cloud Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; +} diff --git a/synth.py b/synth.py index ff44e5187..9084c3241 100644 --- a/synth.py +++ b/synth.py @@ -21,7 +21,7 @@ gapic = gcp.GAPICGenerator() service = 'securitycenter' -versions = ['v1beta1', 'v1'] +versions = ['v1p1beta1', 'v1beta1', 'v1'] config_pattern = '/google/cloud/securitycenter/artman_securitycenter_{version}.yaml' for version in versions: diff --git a/versions.txt b/versions.txt index bb1d1c24c..1fa788134 100644 --- a/versions.txt +++ b/versions.txt @@ -3,6 +3,8 @@ proto-google-cloud-securitycenter-v1:0.83.1:0.83.2-SNAPSHOT proto-google-cloud-securitycenter-v1beta1:0.83.1:0.83.2-SNAPSHOT +proto-google-cloud-securitycenter-v1p1beta1:0.83.1:0.83.2-SNAPSHOT grpc-google-cloud-securitycenter-v1:0.83.1:0.83.2-SNAPSHOT grpc-google-cloud-securitycenter-v1beta1:0.83.1:0.83.2-SNAPSHOT +grpc-google-cloud-securitycenter-v1p1beta1:0.83.1:0.83.2-SNAPSHOT google-cloud-securitycenter:0.118.1:0.118.2-SNAPSHOT \ No newline at end of file