diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index e4ea8dd43ebf..ca1ae44a1ff9 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -1539,7 +1539,7 @@ "WebSecurityScanner": { "language": "php", "distribution_name": "google/cloud-web-security-scanner", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest", "library_type": "GAPIC_AUTO", "api_shortname": "websecurityscanner" diff --git a/WebSecurityScanner/.OwlBot.yaml b/WebSecurityScanner/.OwlBot.yaml index 673e76a74894..459553bc2f1a 100644 --- a/WebSecurityScanner/.OwlBot.yaml +++ b/WebSecurityScanner/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/websecurityscanner/(v1|v1beta)/.*-php/(.*) + - source: /google/cloud/websecurityscanner/(v1)/.*-php/(.*) dest: /owl-bot-staging/WebSecurityScanner/$1/$2 api-name: WebSecurityScanner diff --git a/WebSecurityScanner/README.md b/WebSecurityScanner/README.md index 1d8c477232d3..744b1b8bd240 100644 --- a/WebSecurityScanner/README.md +++ b/WebSecurityScanner/README.md @@ -54,9 +54,8 @@ echo 'Scan execution state: ' . ExecutionState::name($scanRun->getExecutionState ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/WebSecurityScanner/metadata/V1Beta/CrawledUrl.php b/WebSecurityScanner/metadata/V1Beta/CrawledUrl.php deleted file mode 100644 index f650ca23bfb8..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/CrawledUrl.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' -� -8google/cloud/websecurityscanner/v1beta/crawled_url.proto&google.cloud.websecurityscanner.v1beta"< - -CrawledUrl - http_method (  -url (  -body ( B� -*com.google.cloud.websecurityscanner.v1betaBCrawledUrlProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb�&Google.Cloud.WebSecurityScanner.V1Beta�&Google\\Cloud\\WebSecurityScanner\\V1beta�)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/Finding.php b/WebSecurityScanner/metadata/V1Beta/Finding.php deleted file mode 100644 index 02abec885ac1..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/Finding.php +++ /dev/null @@ -1,49 +0,0 @@ -internalAddGeneratedFile( - ' -� -4google/cloud/websecurityscanner/v1beta/finding.proto&google.cloud.websecurityscanner.v1beta:google/cloud/websecurityscanner/v1beta/finding_addon.proto"� -Finding -name (  - finding_type (  - http_method (  - -fuzzed_url (  -body (  - description (  -reproduction_url (  - frame_url (  - final_url (  - tracking_id - ( : -form ( 2,.google.cloud.websecurityscanner.v1beta.FormQ -outdated_library ( 27.google.cloud.websecurityscanner.v1beta.OutdatedLibraryU -violating_resource ( 29.google.cloud.websecurityscanner.v1beta.ViolatingResourceU -vulnerable_headers ( 29.google.cloud.websecurityscanner.v1beta.VulnerableHeaders[ -vulnerable_parameters ( 2<.google.cloud.websecurityscanner.v1beta.VulnerableParameters8 -xss ( 2+.google.cloud.websecurityscanner.v1beta.Xss:��A� -)websecurityscanner.googleapis.com/FindingSprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B� -*com.google.cloud.websecurityscanner.v1betaB FindingProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb�&Google.Cloud.WebSecurityScanner.V1Beta�&Google\\Cloud\\WebSecurityScanner\\V1beta�)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/FindingAddon.php b/WebSecurityScanner/metadata/V1Beta/FindingAddon.php deleted file mode 100644 index 9ea7f4fed763..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/FindingAddon.php +++ /dev/null @@ -1,49 +0,0 @@ -internalAddGeneratedFile( - ' -� -:google/cloud/websecurityscanner/v1beta/finding_addon.proto&google.cloud.websecurityscanner.v1beta"* -Form - -action_uri (  -fields ( "Q -OutdatedLibrary - library_name (  -version (  -learn_more_urls ( "? -ViolatingResource - content_type (  - resource_url ( "/ -VulnerableParameters -parameter_names ( "� -VulnerableHeadersQ -headers ( 2@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.HeaderY -missing_headers ( 2@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header% -Header -name (  -value ( "2 -Xss - stack_traces (  - error_message ( B� -*com.google.cloud.websecurityscanner.v1betaBFindingAddonProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb�&Google.Cloud.WebSecurityScanner.V1Beta�&Google\\Cloud\\WebSecurityScanner\\V1beta�)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php b/WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php deleted file mode 100644 index 48755bc15453..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/FindingTypeStats.php +++ /dev/null @@ -1,30 +0,0 @@ -internalAddGeneratedFile( - ' -� -?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto&google.cloud.websecurityscanner.v1beta"? -FindingTypeStats - finding_type (  - finding_count (B� -*com.google.cloud.websecurityscanner.v1betaBFindingTypeStatsProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb�&Google.Cloud.WebSecurityScanner.V1Beta�&Google\\Cloud\\WebSecurityScanner\\V1beta�)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/metadata/V1Beta/ScanConfig.php b/WebSecurityScanner/metadata/V1Beta/ScanConfig.php deleted file mode 100644 index af447db1fe59..000000000000 Binary files a/WebSecurityScanner/metadata/V1Beta/ScanConfig.php and /dev/null differ diff --git a/WebSecurityScanner/metadata/V1Beta/ScanConfigError.php b/WebSecurityScanner/metadata/V1Beta/ScanConfigError.php deleted file mode 100644 index 62bd51f36c4e..000000000000 Binary files a/WebSecurityScanner/metadata/V1Beta/ScanConfigError.php and /dev/null differ diff --git a/WebSecurityScanner/metadata/V1Beta/ScanRun.php b/WebSecurityScanner/metadata/V1Beta/ScanRun.php deleted file mode 100644 index 55e5294cde00..000000000000 Binary files a/WebSecurityScanner/metadata/V1Beta/ScanRun.php and /dev/null differ diff --git a/WebSecurityScanner/metadata/V1Beta/ScanRunErrorTrace.php b/WebSecurityScanner/metadata/V1Beta/ScanRunErrorTrace.php deleted file mode 100644 index 451259ff5342..000000000000 Binary files a/WebSecurityScanner/metadata/V1Beta/ScanRunErrorTrace.php and /dev/null differ diff --git a/WebSecurityScanner/metadata/V1Beta/ScanRunWarningTrace.php b/WebSecurityScanner/metadata/V1Beta/ScanRunWarningTrace.php deleted file mode 100644 index 775ada9cd20f..000000000000 Binary files a/WebSecurityScanner/metadata/V1Beta/ScanRunWarningTrace.php and /dev/null differ diff --git a/WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php b/WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php deleted file mode 100644 index 96f15f133fa9..000000000000 --- a/WebSecurityScanner/metadata/V1Beta/WebSecurityScanner.php +++ /dev/null @@ -1,121 +0,0 @@ -internalAddGeneratedFile( - ' -�- -Agoogle/cloud/websecurityscanner/v1beta/web_security_scanner.proto&google.cloud.websecurityscanner.v1betagoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto8google/cloud/websecurityscanner/v1beta/crawled_url.proto4google/cloud/websecurityscanner/v1beta/finding.proto?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto8google/cloud/websecurityscanner/v1beta/scan_config.proto5google/cloud/websecurityscanner/v1beta/scan_run.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"� -CreateScanConfigRequestC -parent ( B3�A�A- -+cloudresourcemanager.googleapis.com/ProjectL - scan_config ( 22.google.cloud.websecurityscanner.v1beta.ScanConfigB�A"] -DeleteScanConfigRequestB -name ( B4�A�A. -,websecurityscanner.googleapis.com/ScanConfig"Z -GetScanConfigRequestB -name ( B4�A�A. -,websecurityscanner.googleapis.com/ScanConfig"� -ListScanConfigsRequestC -parent ( B3�A�A- -+cloudresourcemanager.googleapis.com/Project - -page_token (  - page_size ("� -UpdateScanConfigRequestL - scan_config ( 22.google.cloud.websecurityscanner.v1beta.ScanConfigB�A4 - update_mask ( 2.google.protobuf.FieldMaskB�A"| -ListScanConfigsResponseH - scan_configs ( 22.google.cloud.websecurityscanner.v1beta.ScanConfig -next_page_token ( "Y -StartScanRunRequestB -name ( B4�A�A. -,websecurityscanner.googleapis.com/ScanConfig"T -GetScanRunRequest? -name ( B1�A�A+ -)websecurityscanner.googleapis.com/ScanRun"� -ListScanRunsRequestD -parent ( B4�A�A. -,websecurityscanner.googleapis.com/ScanConfig - -page_token (  - page_size ("s -ListScanRunsResponseB - scan_runs ( 2/.google.cloud.websecurityscanner.v1beta.ScanRun -next_page_token ( "U -StopScanRunRequest? -name ( B1�A�A+ -)websecurityscanner.googleapis.com/ScanRun"� -ListCrawledUrlsRequestA -parent ( B1�A�A+ -)websecurityscanner.googleapis.com/ScanRun - -page_token (  - page_size ("| -ListCrawledUrlsResponseH - crawled_urls ( 22.google.cloud.websecurityscanner.v1beta.CrawledUrl -next_page_token ( "T -GetFindingRequest? -name ( B1�A�A+ -)websecurityscanner.googleapis.com/Finding"� -ListFindingsRequestA -parent ( B1�A�A+ -)websecurityscanner.googleapis.com/ScanRun -filter ( B�A - -page_token (  - page_size ("r -ListFindingsResponseA -findings ( 2/.google.cloud.websecurityscanner.v1beta.Finding -next_page_token ( "` -ListFindingTypeStatsRequestA -parent ( B1�A�A+ -)websecurityscanner.googleapis.com/ScanRun"t -ListFindingTypeStatsResponseT -finding_type_stats ( 28.google.cloud.websecurityscanner.v1beta.FindingTypeStats2� -WebSecurityScanner� -CreateScanConfig?.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest2.google.cloud.websecurityscanner.v1beta.ScanConfig"Q�Aparent,scan_config���6"\'/v1beta/{parent=projects/*}/scanConfigs: scan_config� -DeleteScanConfig?.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.google.protobuf.Empty"6�Aname���)*\'/v1beta/{name=projects/*/scanConfigs/*}� - GetScanConfig<.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest2.google.cloud.websecurityscanner.v1beta.ScanConfig"6�Aname���)\'/v1beta/{name=projects/*/scanConfigs/*}� -ListScanConfigs>.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest?.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse"8�Aparent���)\'/v1beta/{parent=projects/*}/scanConfigs� -UpdateScanConfig?.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest2.google.cloud.websecurityscanner.v1beta.ScanConfig"b�Ascan_config,update_mask���B23/v1beta/{scan_config.name=projects/*/scanConfigs/*}: scan_config� - StartScanRun;.google.cloud.websecurityscanner.v1beta.StartScanRunRequest/.google.cloud.websecurityscanner.v1beta.ScanRun"?�Aname���2"-/v1beta/{name=projects/*/scanConfigs/*}:start:*� - -GetScanRun9.google.cloud.websecurityscanner.v1beta.GetScanRunRequest/.google.cloud.websecurityscanner.v1beta.ScanRun"A�Aname���42/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}� - ListScanRuns;.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest<.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse"C�Aparent���42/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns� - StopScanRun:.google.cloud.websecurityscanner.v1beta.StopScanRunRequest/.google.cloud.websecurityscanner.v1beta.ScanRun"I�Aname���<"7/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:*� -ListCrawledUrls>.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest?.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse"Q�Aparent���B@/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls� - -GetFinding9.google.cloud.websecurityscanner.v1beta.GetFindingRequest/.google.cloud.websecurityscanner.v1beta.Finding"L�Aname���?=/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}� - ListFindings;.google.cloud.websecurityscanner.v1beta.ListFindingsRequest<.google.cloud.websecurityscanner.v1beta.ListFindingsResponse"U�A parent,filter���?=/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings� -ListFindingTypeStatsC.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequestD.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse"V�Aparent���GE/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStatsU�A!websecurityscanner.googleapis.com�A.https://www.googleapis.com/auth/cloud-platformB� -*com.google.cloud.websecurityscanner.v1betaBWebSecurityScannerProtoPZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb�&Google.Cloud.WebSecurityScanner.V1Beta�&Google\\Cloud\\WebSecurityScanner\\V1beta�)Google::Cloud::WebSecurityScanner::V1betabproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/WebSecurityScanner/owlbot.py b/WebSecurityScanner/owlbot.py index 504bc01f477b..aaced291f064 100644 --- a/WebSecurityScanner/owlbot.py +++ b/WebSecurityScanner/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2019 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php" - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -47,29 +41,16 @@ + "\n", '') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php b/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php index c31b3cecf3bd..e6b2d9c7b769 100644 --- a/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php +++ b/WebSecurityScanner/src/V1/Client/WebSecurityScannerClient.php @@ -1,6 +1,6 @@ startApiCall('ListFindingTypeStats', $request, $callOptions)->wait(); } diff --git a/WebSecurityScanner/src/V1/CrawledUrl.php b/WebSecurityScanner/src/V1/CrawledUrl.php index 02c39e1e0008..64ba4bc60cbc 100644 --- a/WebSecurityScanner/src/V1/CrawledUrl.php +++ b/WebSecurityScanner/src/V1/CrawledUrl.php @@ -23,19 +23,19 @@ class CrawledUrl extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string http_method = 1; */ - private $http_method = ''; + protected $http_method = ''; /** * Output only. The URL that was crawled. * * Generated from protobuf field string url = 2; */ - private $url = ''; + protected $url = ''; /** * Output only. The body of the request that was used to visit the URL. * * Generated from protobuf field string body = 3; */ - private $body = ''; + protected $body = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/CreateScanConfigRequest.php b/WebSecurityScanner/src/V1/CreateScanConfigRequest.php index 7304c81603fd..fff8861ade4f 100644 --- a/WebSecurityScanner/src/V1/CreateScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/CreateScanConfigRequest.php @@ -21,13 +21,13 @@ class CreateScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * Required. The ScanConfig to be created. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; */ - private $scan_config = null; + protected $scan_config = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php b/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php index a80b0a779f66..c425beafce9d 100644 --- a/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/DeleteScanConfigRequest.php @@ -21,7 +21,7 @@ class DeleteScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/Finding.php b/WebSecurityScanner/src/V1/Finding.php index c9d0c46bdd6c..4bc03c3293b3 100644 --- a/WebSecurityScanner/src/V1/Finding.php +++ b/WebSecurityScanner/src/V1/Finding.php @@ -23,7 +23,7 @@ class Finding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. The type of the Finding. * Detailed and up-to-date information on findings can be found here: @@ -31,111 +31,111 @@ class Finding extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string finding_type = 2; */ - private $finding_type = ''; + protected $finding_type = ''; /** * Output only. The severity level of the reported vulnerability. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $severity = 0; + protected $severity = 0; /** * Output only. The http method of the request that triggered the vulnerability, in * uppercase. * * Generated from protobuf field string http_method = 3; */ - private $http_method = ''; + protected $http_method = ''; /** * Output only. The URL produced by the server-side fuzzer and used in the request that * triggered the vulnerability. * * Generated from protobuf field string fuzzed_url = 4; */ - private $fuzzed_url = ''; + protected $fuzzed_url = ''; /** * Output only. The body of the request that triggered the vulnerability. * * Generated from protobuf field string body = 5; */ - private $body = ''; + protected $body = ''; /** * Output only. The description of the vulnerability. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Output only. The URL containing human-readable payload that user can leverage to * reproduce the vulnerability. * * Generated from protobuf field string reproduction_url = 7; */ - private $reproduction_url = ''; + protected $reproduction_url = ''; /** * Output only. If the vulnerability was originated from nested IFrame, the immediate * parent IFrame is reported. * * Generated from protobuf field string frame_url = 8; */ - private $frame_url = ''; + protected $frame_url = ''; /** * Output only. The URL where the browser lands when the vulnerability is detected. * * Generated from protobuf field string final_url = 9; */ - private $final_url = ''; + protected $final_url = ''; /** * Output only. The tracking ID uniquely identifies a vulnerability instance across * multiple ScanRuns. * * Generated from protobuf field string tracking_id = 10; */ - private $tracking_id = ''; + protected $tracking_id = ''; /** * Output only. An addon containing information reported for a vulnerability with an HTML * form, if any. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Form form = 16; */ - private $form = null; + protected $form = null; /** * Output only. An addon containing information about outdated libraries. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; */ - private $outdated_library = null; + protected $outdated_library = null; /** * Output only. An addon containing detailed information regarding any resource causing the * vulnerability such as JavaScript sources, image, audio files, etc. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; */ - private $violating_resource = null; + protected $violating_resource = null; /** * Output only. An addon containing information about vulnerable or missing HTTP headers. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; */ - private $vulnerable_headers = null; + protected $vulnerable_headers = null; /** * Output only. An addon containing information about request parameters which were found * to be vulnerable. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; */ - private $vulnerable_parameters = null; + protected $vulnerable_parameters = null; /** * Output only. An addon containing information reported for an XSS, if any. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xss xss = 14; */ - private $xss = null; + protected $xss = null; /** * Output only. An addon containing information reported for an XXE, if any. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xxe xxe = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $xxe = null; + protected $xxe = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/FindingTypeStats.php b/WebSecurityScanner/src/V1/FindingTypeStats.php index 18e81a062c50..52c1f5d58553 100644 --- a/WebSecurityScanner/src/V1/FindingTypeStats.php +++ b/WebSecurityScanner/src/V1/FindingTypeStats.php @@ -21,13 +21,13 @@ class FindingTypeStats extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string finding_type = 1; */ - private $finding_type = ''; + protected $finding_type = ''; /** * Output only. The count of findings belonging to this finding type. * * Generated from protobuf field int32 finding_count = 2; */ - private $finding_count = 0; + protected $finding_count = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/Form.php b/WebSecurityScanner/src/V1/Form.php index 9f1711502a2e..d7c8fa1b4d63 100644 --- a/WebSecurityScanner/src/V1/Form.php +++ b/WebSecurityScanner/src/V1/Form.php @@ -20,7 +20,7 @@ class Form extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string action_uri = 1; */ - private $action_uri = ''; + protected $action_uri = ''; /** * ! The names of form fields related to the vulnerability. * diff --git a/WebSecurityScanner/src/V1/GetFindingRequest.php b/WebSecurityScanner/src/V1/GetFindingRequest.php index 74716b561f83..56613939f49b 100644 --- a/WebSecurityScanner/src/V1/GetFindingRequest.php +++ b/WebSecurityScanner/src/V1/GetFindingRequest.php @@ -22,7 +22,7 @@ class GetFindingRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/GetScanConfigRequest.php b/WebSecurityScanner/src/V1/GetScanConfigRequest.php index 994c1d2d73ae..b2835242fe3b 100644 --- a/WebSecurityScanner/src/V1/GetScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/GetScanConfigRequest.php @@ -21,7 +21,7 @@ class GetScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/GetScanRunRequest.php b/WebSecurityScanner/src/V1/GetScanRunRequest.php index 6fe198582180..b7d3f11f9e1e 100644 --- a/WebSecurityScanner/src/V1/GetScanRunRequest.php +++ b/WebSecurityScanner/src/V1/GetScanRunRequest.php @@ -22,7 +22,7 @@ class GetScanRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php b/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php index b9fcb855a282..55c61e7b7fba 100644 --- a/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php +++ b/WebSecurityScanner/src/V1/ListCrawledUrlsRequest.php @@ -22,7 +22,7 @@ class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -30,7 +30,7 @@ class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of CrawledUrls to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -38,7 +38,7 @@ class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php b/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php index 334c23bc2075..2a14aca66997 100644 --- a/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php +++ b/WebSecurityScanner/src/V1/ListCrawledUrlsResponse.php @@ -27,7 +27,7 @@ class ListCrawledUrlsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php b/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php index b5a85a275f4c..2e969337f774 100644 --- a/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php +++ b/WebSecurityScanner/src/V1/ListFindingTypeStatsRequest.php @@ -22,7 +22,7 @@ class ListFindingTypeStatsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListFindingsRequest.php b/WebSecurityScanner/src/V1/ListFindingsRequest.php index 6da53e2b0844..44485fffb638 100644 --- a/WebSecurityScanner/src/V1/ListFindingsRequest.php +++ b/WebSecurityScanner/src/V1/ListFindingsRequest.php @@ -22,7 +22,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * The filter expression. The expression must be in the format: * . @@ -31,7 +31,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 2; */ - private $filter = ''; + protected $filter = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -39,7 +39,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of Findings to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -47,7 +47,7 @@ class ListFindingsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListFindingsResponse.php b/WebSecurityScanner/src/V1/ListFindingsResponse.php index 651fc29b6b1d..8adbe0f0cb91 100644 --- a/WebSecurityScanner/src/V1/ListFindingsResponse.php +++ b/WebSecurityScanner/src/V1/ListFindingsResponse.php @@ -27,7 +27,7 @@ class ListFindingsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanConfigsRequest.php b/WebSecurityScanner/src/V1/ListScanConfigsRequest.php index 966bce32086f..fdd69ae7994e 100644 --- a/WebSecurityScanner/src/V1/ListScanConfigsRequest.php +++ b/WebSecurityScanner/src/V1/ListScanConfigsRequest.php @@ -21,7 +21,7 @@ class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -29,7 +29,7 @@ class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of ScanConfigs to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -37,7 +37,7 @@ class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanConfigsResponse.php b/WebSecurityScanner/src/V1/ListScanConfigsResponse.php index e035a6058910..4fe50cac7c9a 100644 --- a/WebSecurityScanner/src/V1/ListScanConfigsResponse.php +++ b/WebSecurityScanner/src/V1/ListScanConfigsResponse.php @@ -27,7 +27,7 @@ class ListScanConfigsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanRunsRequest.php b/WebSecurityScanner/src/V1/ListScanRunsRequest.php index 9f6f1296801f..ad0f4a66754d 100644 --- a/WebSecurityScanner/src/V1/ListScanRunsRequest.php +++ b/WebSecurityScanner/src/V1/ListScanRunsRequest.php @@ -21,7 +21,7 @@ class ListScanRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1; */ - private $parent = ''; + protected $parent = ''; /** * A token identifying a page of results to be returned. This should be a * `next_page_token` value returned from a previous List request. @@ -29,7 +29,7 @@ class ListScanRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 2; */ - private $page_token = ''; + protected $page_token = ''; /** * The maximum number of ScanRuns to return, can be limited by server. * If not specified or not positive, the implementation will select a @@ -37,7 +37,7 @@ class ListScanRunsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ListScanRunsResponse.php b/WebSecurityScanner/src/V1/ListScanRunsResponse.php index a83a4bfa935c..716f771565ec 100644 --- a/WebSecurityScanner/src/V1/ListScanRunsResponse.php +++ b/WebSecurityScanner/src/V1/ListScanRunsResponse.php @@ -27,7 +27,7 @@ class ListScanRunsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/OutdatedLibrary.php b/WebSecurityScanner/src/V1/OutdatedLibrary.php index a72216c0f3d9..2ec473bc7eeb 100644 --- a/WebSecurityScanner/src/V1/OutdatedLibrary.php +++ b/WebSecurityScanner/src/V1/OutdatedLibrary.php @@ -20,13 +20,13 @@ class OutdatedLibrary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string library_name = 1; */ - private $library_name = ''; + protected $library_name = ''; /** * The version number. * * Generated from protobuf field string version = 2; */ - private $version = ''; + protected $version = ''; /** * URLs to learn more information about the vulnerabilities in the library. * diff --git a/WebSecurityScanner/src/V1/ScanConfig.php b/WebSecurityScanner/src/V1/ScanConfig.php index fc94ed8b5598..2a96fcca040b 100644 --- a/WebSecurityScanner/src/V1/ScanConfig.php +++ b/WebSecurityScanner/src/V1/ScanConfig.php @@ -22,13 +22,13 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Required. The user provided display name of the ScanConfig. * * Generated from protobuf field string display_name = 2; */ - private $display_name = ''; + protected $display_name = ''; /** * The maximum QPS during scanning. A valid value ranges from 5 to 20 * inclusively. If the field is unspecified or its value is set 0, server will @@ -37,7 +37,7 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 max_qps = 3; */ - private $max_qps = 0; + protected $max_qps = 0; /** * Required. The starting URLs from which the scanner finds site pages. * @@ -50,13 +50,13 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; */ - private $authentication = null; + protected $authentication = null; /** * The user agent used during scanning. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; */ - private $user_agent = 0; + protected $user_agent = 0; /** * The excluded URL patterns as described in * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls @@ -69,40 +69,40 @@ class ScanConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; */ - private $schedule = null; + protected $schedule = null; /** * Controls export of scan configurations and results to Security * Command Center. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; */ - private $export_to_security_command_center = 0; + protected $export_to_security_command_center = 0; /** * The risk level selected for the scan * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; */ - private $risk_level = 0; + protected $risk_level = 0; /** * Whether the scan config is managed by Web Security Scanner, output * only. * * Generated from protobuf field bool managed_scan = 13; */ - private $managed_scan = false; + protected $managed_scan = false; /** * Whether the scan configuration has enabled static IP address scan feature. * If enabled, the scanner will access applications from static IP addresses. * * Generated from protobuf field bool static_ip_scan = 14; */ - private $static_ip_scan = false; + protected $static_ip_scan = false; /** * Whether to keep scanning even if most requests return HTTP error codes. * * Generated from protobuf field bool ignore_http_status_errors = 15; */ - private $ignore_http_status_errors = false; + protected $ignore_http_status_errors = false; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php b/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php index 782e701aab4b..3f2a2a4e8155 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Authentication/CustomAccount.php @@ -20,20 +20,20 @@ class CustomAccount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * Required. Input only. The password of the custom account. The credential is stored encrypted * and not returned in any response nor included in audit logs. * * Generated from protobuf field string password = 2; */ - private $password = ''; + protected $password = ''; /** * Required. The login form URL of the website. * * Generated from protobuf field string login_url = 3; */ - private $login_url = ''; + protected $login_url = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php b/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php index ccd596347fc5..1d3e963634f7 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Authentication/GoogleAccount.php @@ -21,14 +21,14 @@ class GoogleAccount extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string username = 1; */ - private $username = ''; + protected $username = ''; /** * Required. Input only. The password of the Google account. The credential is stored encrypted * and not returned in any response nor included in audit logs. * * Generated from protobuf field string password = 2; */ - private $password = ''; + protected $password = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php b/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php index e163c40d8bed..4913a4ac838b 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Authentication/IapCredential/IapTestServiceAccountInfo.php @@ -22,7 +22,7 @@ class IapTestServiceAccountInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $target_audience_client_id = ''; + protected $target_audience_client_id = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfig/Schedule.php b/WebSecurityScanner/src/V1/ScanConfig/Schedule.php index c4e9e30154f0..43fe92884581 100644 --- a/WebSecurityScanner/src/V1/ScanConfig/Schedule.php +++ b/WebSecurityScanner/src/V1/ScanConfig/Schedule.php @@ -23,13 +23,13 @@ class Schedule extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; */ - private $schedule_time = null; + protected $schedule_time = null; /** * Required. The duration of time between executions in days. * * Generated from protobuf field int32 interval_duration_days = 2; */ - private $interval_duration_days = 0; + protected $interval_duration_days = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanConfigError.php b/WebSecurityScanner/src/V1/ScanConfigError.php index 9d0dac61611a..f29dc04e6690 100644 --- a/WebSecurityScanner/src/V1/ScanConfigError.php +++ b/WebSecurityScanner/src/V1/ScanConfigError.php @@ -23,7 +23,7 @@ class ScanConfigError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * Output only. Indicates the full name of the ScanConfig field that triggers this error, * for example "scan_config.max_qps". This field is provided for @@ -32,7 +32,7 @@ class ScanConfigError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string field_name = 2; */ - private $field_name = ''; + protected $field_name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanRun.php b/WebSecurityScanner/src/V1/ScanRun.php index 82e7a4b4d144..ff25c1ee8cb2 100644 --- a/WebSecurityScanner/src/V1/ScanRun.php +++ b/WebSecurityScanner/src/V1/ScanRun.php @@ -23,40 +23,40 @@ class ScanRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Output only. The execution state of the ScanRun. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; */ - private $execution_state = 0; + protected $execution_state = 0; /** * Output only. The result state of the ScanRun. This field is only available after the * execution state reaches "FINISHED". * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; */ - private $result_state = 0; + protected $result_state = 0; /** * Output only. The time at which the ScanRun started. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; */ - private $start_time = null; + protected $start_time = null; /** * Output only. The time at which the ScanRun reached termination state - that the ScanRun * is either finished or stopped by user. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; */ - private $end_time = null; + protected $end_time = null; /** * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, * the value represents the number of URLs crawled up to now. * * Generated from protobuf field int64 urls_crawled_count = 6; */ - private $urls_crawled_count = 0; + protected $urls_crawled_count = 0; /** * Output only. The number of URLs tested during this ScanRun. If the scan is in progress, * the value represents the number of URLs tested up to now. The number of @@ -65,13 +65,13 @@ class ScanRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 urls_tested_count = 7; */ - private $urls_tested_count = 0; + protected $urls_tested_count = 0; /** * Output only. Whether the scan run has found any vulnerabilities. * * Generated from protobuf field bool has_vulnerabilities = 8; */ - private $has_vulnerabilities = false; + protected $has_vulnerabilities = false; /** * Output only. The percentage of total completion ranging from 0 to 100. * If the scan is in queue, the value is 0. @@ -80,14 +80,14 @@ class ScanRun extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 progress_percent = 9; */ - private $progress_percent = 0; + protected $progress_percent = 0; /** * Output only. If result_state is an ERROR, this field provides the primary reason for * scan's termination and more details, if such are available. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; */ - private $error_trace = null; + protected $error_trace = null; /** * Output only. A list of warnings, if such are encountered during this scan run. * diff --git a/WebSecurityScanner/src/V1/ScanRunErrorTrace.php b/WebSecurityScanner/src/V1/ScanRunErrorTrace.php index 5322839fd8a4..688868b5b240 100644 --- a/WebSecurityScanner/src/V1/ScanRunErrorTrace.php +++ b/WebSecurityScanner/src/V1/ScanRunErrorTrace.php @@ -21,7 +21,7 @@ class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error * message encountered during scan configuration validation that is performed @@ -29,7 +29,7 @@ class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; */ - private $scan_config_error = null; + protected $scan_config_error = null; /** * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most * common HTTP error code, if such is available. For example, if this code is @@ -37,7 +37,7 @@ class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 most_common_http_error_code = 3; */ - private $most_common_http_error_code = 0; + protected $most_common_http_error_code = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanRunLog.php b/WebSecurityScanner/src/V1/ScanRunLog.php index 94e68e35319f..6b90901c9959 100644 --- a/WebSecurityScanner/src/V1/ScanRunLog.php +++ b/WebSecurityScanner/src/V1/ScanRunLog.php @@ -24,41 +24,41 @@ class ScanRunLog extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string summary = 1; */ - private $summary = ''; + protected $summary = ''; /** * The resource name of the ScanRun being logged. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * The execution state of the ScanRun. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 3; */ - private $execution_state = 0; + protected $execution_state = 0; /** * The result state of the ScanRun. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 4; */ - private $result_state = 0; + protected $result_state = 0; /** * Generated from protobuf field int64 urls_crawled_count = 5; */ - private $urls_crawled_count = 0; + protected $urls_crawled_count = 0; /** * Generated from protobuf field int64 urls_tested_count = 6; */ - private $urls_tested_count = 0; + protected $urls_tested_count = 0; /** * Generated from protobuf field bool has_findings = 7; */ - private $has_findings = false; + protected $has_findings = false; /** * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 8; */ - private $error_trace = null; + protected $error_trace = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ScanRunWarningTrace.php b/WebSecurityScanner/src/V1/ScanRunWarningTrace.php index f579a33ea8c5..88301882093d 100644 --- a/WebSecurityScanner/src/V1/ScanRunWarningTrace.php +++ b/WebSecurityScanner/src/V1/ScanRunWarningTrace.php @@ -22,7 +22,7 @@ class ScanRunWarningTrace extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; */ - private $code = 0; + protected $code = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/StartScanRunRequest.php b/WebSecurityScanner/src/V1/StartScanRunRequest.php index 83dfb78d7a45..ac00aa43db70 100644 --- a/WebSecurityScanner/src/V1/StartScanRunRequest.php +++ b/WebSecurityScanner/src/V1/StartScanRunRequest.php @@ -21,7 +21,7 @@ class StartScanRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/StopScanRunRequest.php b/WebSecurityScanner/src/V1/StopScanRunRequest.php index 3cd5d0b75916..cb81353bba70 100644 --- a/WebSecurityScanner/src/V1/StopScanRunRequest.php +++ b/WebSecurityScanner/src/V1/StopScanRunRequest.php @@ -22,7 +22,7 @@ class StopScanRunRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php b/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php index 8a91638cd155..3037cef7bbca 100644 --- a/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php +++ b/WebSecurityScanner/src/V1/UpdateScanConfigRequest.php @@ -22,7 +22,7 @@ class UpdateScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; */ - private $scan_config = null; + protected $scan_config = null; /** * Required. The update mask applies to the resource. For the `FieldMask` definition, * see @@ -30,7 +30,7 @@ class UpdateScanConfigRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; */ - private $update_mask = null; + protected $update_mask = null; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/ViolatingResource.php b/WebSecurityScanner/src/V1/ViolatingResource.php index d166ae12d0d3..a04f097a8d63 100644 --- a/WebSecurityScanner/src/V1/ViolatingResource.php +++ b/WebSecurityScanner/src/V1/ViolatingResource.php @@ -21,13 +21,13 @@ class ViolatingResource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string content_type = 1; */ - private $content_type = ''; + protected $content_type = ''; /** * URL of this violating resource. * * Generated from protobuf field string resource_url = 2; */ - private $resource_url = ''; + protected $resource_url = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php b/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php index 9ab083d9659d..a17089ab73cb 100644 --- a/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php +++ b/WebSecurityScanner/src/V1/VulnerableHeaders/Header.php @@ -20,13 +20,13 @@ class Header extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Header value. * * Generated from protobuf field string value = 2; */ - private $value = ''; + protected $value = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php b/WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php deleted file mode 100644 index 932cde91e5cd..000000000000 --- a/WebSecurityScanner/src/V1/WebSecurityScannerGrpcClient.php +++ /dev/null @@ -1,233 +0,0 @@ -_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/CreateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Deletes an existing ScanConfig and its child resources. - * @param \Google\Cloud\WebSecurityScanner\V1\DeleteScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteScanConfig(\Google\Cloud\WebSecurityScanner\V1\DeleteScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/DeleteScanConfig', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1\GetScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanConfig(\Google\Cloud\WebSecurityScanner\V1\GetScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanConfigs under a given project. - * @param \Google\Cloud\WebSecurityScanner\V1\ListScanConfigsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanConfigs(\Google\Cloud\WebSecurityScanner\V1\ListScanConfigsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanConfigs', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListScanConfigsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a ScanConfig. This method support partial update of a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1\UpdateScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateScanConfig(\Google\Cloud\WebSecurityScanner\V1\UpdateScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/UpdateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Start a ScanRun according to the given ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1\StartScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartScanRun(\Google\Cloud\WebSecurityScanner\V1\StartScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/StartScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\GetScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanRun(\Google\Cloud\WebSecurityScanner\V1\GetScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - * stop time. - * @param \Google\Cloud\WebSecurityScanner\V1\ListScanRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanRuns(\Google\Cloud\WebSecurityScanner\V1\ListScanRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanRuns', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListScanRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Stops a ScanRun. The stopped ScanRun is returned. - * @param \Google\Cloud\WebSecurityScanner\V1\StopScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopScanRun(\Google\Cloud\WebSecurityScanner\V1\StopScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/StopScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * List CrawledUrls under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCrawledUrls(\Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListCrawledUrls', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a Finding. - * @param \Google\Cloud\WebSecurityScanner\V1\GetFindingRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFinding(\Google\Cloud\WebSecurityScanner\V1\GetFindingRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetFinding', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\Finding', 'decode'], - $metadata, $options); - } - - /** - * List Findings under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\ListFindingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindings(\Google\Cloud\WebSecurityScanner\V1\ListFindingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindings', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListFindingsResponse', 'decode'], - $metadata, $options); - } - - /** - * List all FindingTypeStats under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindingTypeStats(\Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/WebSecurityScanner/src/V1/Xss.php b/WebSecurityScanner/src/V1/Xss.php index dd360613a914..b3be341c0a1a 100644 --- a/WebSecurityScanner/src/V1/Xss.php +++ b/WebSecurityScanner/src/V1/Xss.php @@ -26,19 +26,19 @@ class Xss extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string error_message = 2; */ - private $error_message = ''; + protected $error_message = ''; /** * The attack vector of the payload triggering this XSS. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; */ - private $attack_vector = 0; + protected $attack_vector = 0; /** * The reproduction url for the seeding POST request of a Stored XSS. * * Generated from protobuf field string stored_xss_seeding_url = 4; */ - private $stored_xss_seeding_url = ''; + protected $stored_xss_seeding_url = ''; /** * Constructor. diff --git a/WebSecurityScanner/src/V1/Xxe.php b/WebSecurityScanner/src/V1/Xxe.php index 2fb63902fd56..55b9f3fd0de0 100644 --- a/WebSecurityScanner/src/V1/Xxe.php +++ b/WebSecurityScanner/src/V1/Xxe.php @@ -21,13 +21,13 @@ class Xxe extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string payload_value = 1; */ - private $payload_value = ''; + protected $payload_value = ''; /** * Location within the request where the payload was placed. * * Generated from protobuf field .google.cloud.websecurityscanner.v1.Xxe.Location payload_location = 2; */ - private $payload_location = 0; + protected $payload_location = 0; /** * Constructor. diff --git a/WebSecurityScanner/src/V1beta/CrawledUrl.php b/WebSecurityScanner/src/V1beta/CrawledUrl.php deleted file mode 100644 index 82dccaeb90ce..000000000000 --- a/WebSecurityScanner/src/V1beta/CrawledUrl.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.websecurityscanner.v1beta.CrawledUrl - */ -class CrawledUrl extends \Google\Protobuf\Internal\Message -{ - /** - * The http method of the request that was used to visit the URL, in - * uppercase. - * - * Generated from protobuf field string http_method = 1; - */ - private $http_method = ''; - /** - * The URL that was crawled. - * - * Generated from protobuf field string url = 2; - */ - private $url = ''; - /** - * The body of the request that was used to visit the URL. - * - * Generated from protobuf field string body = 3; - */ - private $body = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $http_method - * The http method of the request that was used to visit the URL, in - * uppercase. - * @type string $url - * The URL that was crawled. - * @type string $body - * The body of the request that was used to visit the URL. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\CrawledUrl::initOnce(); - parent::__construct($data); - } - - /** - * The http method of the request that was used to visit the URL, in - * uppercase. - * - * Generated from protobuf field string http_method = 1; - * @return string - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The http method of the request that was used to visit the URL, in - * uppercase. - * - * Generated from protobuf field string http_method = 1; - * @param string $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkString($var, True); - $this->http_method = $var; - - return $this; - } - - /** - * The URL that was crawled. - * - * Generated from protobuf field string url = 2; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * The URL that was crawled. - * - * Generated from protobuf field string url = 2; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * The body of the request that was used to visit the URL. - * - * Generated from protobuf field string body = 3; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * The body of the request that was used to visit the URL. - * - * Generated from protobuf field string body = 3; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, True); - $this->body = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php b/WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php deleted file mode 100644 index dbe9184d5b1b..000000000000 --- a/WebSecurityScanner/src/V1beta/CreateScanConfigRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest - */ -class CreateScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The ScanConfig to be created. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $scan_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $scan_config - * Required. The ScanConfig to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The ScanConfig to be created. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig|null - */ - public function getScanConfig() - { - return $this->scan_config; - } - - public function hasScanConfig() - { - return isset($this->scan_config); - } - - public function clearScanConfig() - { - unset($this->scan_config); - } - - /** - * Required. The ScanConfig to be created. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $var - * @return $this - */ - public function setScanConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig::class); - $this->scan_config = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php b/WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php deleted file mode 100644 index 827b0205ec2d..000000000000 --- a/WebSecurityScanner/src/V1beta/DeleteScanConfigRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest - */ -class DeleteScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/Finding.php b/WebSecurityScanner/src/V1beta/Finding.php deleted file mode 100644 index 35075a45d4fd..000000000000 --- a/WebSecurityScanner/src/V1beta/Finding.php +++ /dev/null @@ -1,686 +0,0 @@ -google.cloud.websecurityscanner.v1beta.Finding - */ -class Finding extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * - * Generated from protobuf field string finding_type = 2; - */ - private $finding_type = ''; - /** - * The http method of the request that triggered the vulnerability, in - * uppercase. - * - * Generated from protobuf field string http_method = 3; - */ - private $http_method = ''; - /** - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * - * Generated from protobuf field string fuzzed_url = 4; - */ - private $fuzzed_url = ''; - /** - * The body of the request that triggered the vulnerability. - * - * Generated from protobuf field string body = 5; - */ - private $body = ''; - /** - * The description of the vulnerability. - * - * Generated from protobuf field string description = 6; - */ - private $description = ''; - /** - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * - * Generated from protobuf field string reproduction_url = 7; - */ - private $reproduction_url = ''; - /** - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * - * Generated from protobuf field string frame_url = 8; - */ - private $frame_url = ''; - /** - * The URL where the browser lands when the vulnerability is detected. - * - * Generated from protobuf field string final_url = 9; - */ - private $final_url = ''; - /** - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * - * Generated from protobuf field string tracking_id = 10; - */ - private $tracking_id = ''; - /** - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Form form = 16; - */ - private $form = null; - /** - * An addon containing information about outdated libraries. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.OutdatedLibrary outdated_library = 11; - */ - private $outdated_library = null; - /** - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ViolatingResource violating_resource = 12; - */ - private $violating_resource = null; - /** - * An addon containing information about vulnerable or missing HTTP headers. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableHeaders vulnerable_headers = 15; - */ - private $vulnerable_headers = null; - /** - * An addon containing information about request parameters which were found - * to be vulnerable. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableParameters vulnerable_parameters = 13; - */ - private $vulnerable_parameters = null; - /** - * An addon containing information reported for an XSS, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Xss xss = 14; - */ - private $xss = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * @type string $finding_type - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * @type string $http_method - * The http method of the request that triggered the vulnerability, in - * uppercase. - * @type string $fuzzed_url - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * @type string $body - * The body of the request that triggered the vulnerability. - * @type string $description - * The description of the vulnerability. - * @type string $reproduction_url - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * @type string $frame_url - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * @type string $final_url - * The URL where the browser lands when the vulnerability is detected. - * @type string $tracking_id - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * @type \Google\Cloud\WebSecurityScanner\V1beta\Form $form - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * @type \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary $outdated_library - * An addon containing information about outdated libraries. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource $violating_resource - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * @type \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders $vulnerable_headers - * An addon containing information about vulnerable or missing HTTP headers. - * @type \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters $vulnerable_parameters - * An addon containing information about request parameters which were found - * to be vulnerable. - * @type \Google\Cloud\WebSecurityScanner\V1beta\Xss $xss - * An addon containing information reported for an XSS, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\Finding::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the Finding. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - * The finding IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * - * Generated from protobuf field string finding_type = 2; - * @return string - */ - public function getFindingType() - { - return $this->finding_type; - } - - /** - * The type of the Finding. - * Detailed and up-to-date information on findings can be found here: - * https://cloud.google.com/security-scanner/docs/scan-result-details - * - * Generated from protobuf field string finding_type = 2; - * @param string $var - * @return $this - */ - public function setFindingType($var) - { - GPBUtil::checkString($var, True); - $this->finding_type = $var; - - return $this; - } - - /** - * The http method of the request that triggered the vulnerability, in - * uppercase. - * - * Generated from protobuf field string http_method = 3; - * @return string - */ - public function getHttpMethod() - { - return $this->http_method; - } - - /** - * The http method of the request that triggered the vulnerability, in - * uppercase. - * - * Generated from protobuf field string http_method = 3; - * @param string $var - * @return $this - */ - public function setHttpMethod($var) - { - GPBUtil::checkString($var, True); - $this->http_method = $var; - - return $this; - } - - /** - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * - * Generated from protobuf field string fuzzed_url = 4; - * @return string - */ - public function getFuzzedUrl() - { - return $this->fuzzed_url; - } - - /** - * The URL produced by the server-side fuzzer and used in the request that - * triggered the vulnerability. - * - * Generated from protobuf field string fuzzed_url = 4; - * @param string $var - * @return $this - */ - public function setFuzzedUrl($var) - { - GPBUtil::checkString($var, True); - $this->fuzzed_url = $var; - - return $this; - } - - /** - * The body of the request that triggered the vulnerability. - * - * Generated from protobuf field string body = 5; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * The body of the request that triggered the vulnerability. - * - * Generated from protobuf field string body = 5; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, True); - $this->body = $var; - - return $this; - } - - /** - * The description of the vulnerability. - * - * Generated from protobuf field string description = 6; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The description of the vulnerability. - * - * Generated from protobuf field string description = 6; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * - * Generated from protobuf field string reproduction_url = 7; - * @return string - */ - public function getReproductionUrl() - { - return $this->reproduction_url; - } - - /** - * The URL containing human-readable payload that user can leverage to - * reproduce the vulnerability. - * - * Generated from protobuf field string reproduction_url = 7; - * @param string $var - * @return $this - */ - public function setReproductionUrl($var) - { - GPBUtil::checkString($var, True); - $this->reproduction_url = $var; - - return $this; - } - - /** - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * - * Generated from protobuf field string frame_url = 8; - * @return string - */ - public function getFrameUrl() - { - return $this->frame_url; - } - - /** - * If the vulnerability was originated from nested IFrame, the immediate - * parent IFrame is reported. - * - * Generated from protobuf field string frame_url = 8; - * @param string $var - * @return $this - */ - public function setFrameUrl($var) - { - GPBUtil::checkString($var, True); - $this->frame_url = $var; - - return $this; - } - - /** - * The URL where the browser lands when the vulnerability is detected. - * - * Generated from protobuf field string final_url = 9; - * @return string - */ - public function getFinalUrl() - { - return $this->final_url; - } - - /** - * The URL where the browser lands when the vulnerability is detected. - * - * Generated from protobuf field string final_url = 9; - * @param string $var - * @return $this - */ - public function setFinalUrl($var) - { - GPBUtil::checkString($var, True); - $this->final_url = $var; - - return $this; - } - - /** - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * - * Generated from protobuf field string tracking_id = 10; - * @return string - */ - public function getTrackingId() - { - return $this->tracking_id; - } - - /** - * The tracking ID uniquely identifies a vulnerability instance across - * multiple ScanRuns. - * - * Generated from protobuf field string tracking_id = 10; - * @param string $var - * @return $this - */ - public function setTrackingId($var) - { - GPBUtil::checkString($var, True); - $this->tracking_id = $var; - - return $this; - } - - /** - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Form form = 16; - * @return \Google\Cloud\WebSecurityScanner\V1beta\Form|null - */ - public function getForm() - { - return $this->form; - } - - public function hasForm() - { - return isset($this->form); - } - - public function clearForm() - { - unset($this->form); - } - - /** - * An addon containing information reported for a vulnerability with an HTML - * form, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Form form = 16; - * @param \Google\Cloud\WebSecurityScanner\V1beta\Form $var - * @return $this - */ - public function setForm($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\Form::class); - $this->form = $var; - - return $this; - } - - /** - * An addon containing information about outdated libraries. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.OutdatedLibrary outdated_library = 11; - * @return \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary|null - */ - public function getOutdatedLibrary() - { - return $this->outdated_library; - } - - public function hasOutdatedLibrary() - { - return isset($this->outdated_library); - } - - public function clearOutdatedLibrary() - { - unset($this->outdated_library); - } - - /** - * An addon containing information about outdated libraries. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.OutdatedLibrary outdated_library = 11; - * @param \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary $var - * @return $this - */ - public function setOutdatedLibrary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\OutdatedLibrary::class); - $this->outdated_library = $var; - - return $this; - } - - /** - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ViolatingResource violating_resource = 12; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource|null - */ - public function getViolatingResource() - { - return $this->violating_resource; - } - - public function hasViolatingResource() - { - return isset($this->violating_resource); - } - - public function clearViolatingResource() - { - unset($this->violating_resource); - } - - /** - * An addon containing detailed information regarding any resource causing the - * vulnerability such as JavaScript sources, image, audio files, etc. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ViolatingResource violating_resource = 12; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource $var - * @return $this - */ - public function setViolatingResource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ViolatingResource::class); - $this->violating_resource = $var; - - return $this; - } - - /** - * An addon containing information about vulnerable or missing HTTP headers. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableHeaders vulnerable_headers = 15; - * @return \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders|null - */ - public function getVulnerableHeaders() - { - return $this->vulnerable_headers; - } - - public function hasVulnerableHeaders() - { - return isset($this->vulnerable_headers); - } - - public function clearVulnerableHeaders() - { - unset($this->vulnerable_headers); - } - - /** - * An addon containing information about vulnerable or missing HTTP headers. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableHeaders vulnerable_headers = 15; - * @param \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders $var - * @return $this - */ - public function setVulnerableHeaders($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders::class); - $this->vulnerable_headers = $var; - - return $this; - } - - /** - * An addon containing information about request parameters which were found - * to be vulnerable. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableParameters vulnerable_parameters = 13; - * @return \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters|null - */ - public function getVulnerableParameters() - { - return $this->vulnerable_parameters; - } - - public function hasVulnerableParameters() - { - return isset($this->vulnerable_parameters); - } - - public function clearVulnerableParameters() - { - unset($this->vulnerable_parameters); - } - - /** - * An addon containing information about request parameters which were found - * to be vulnerable. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.VulnerableParameters vulnerable_parameters = 13; - * @param \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters $var - * @return $this - */ - public function setVulnerableParameters($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableParameters::class); - $this->vulnerable_parameters = $var; - - return $this; - } - - /** - * An addon containing information reported for an XSS, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Xss xss = 14; - * @return \Google\Cloud\WebSecurityScanner\V1beta\Xss|null - */ - public function getXss() - { - return $this->xss; - } - - public function hasXss() - { - return isset($this->xss); - } - - public function clearXss() - { - unset($this->xss); - } - - /** - * An addon containing information reported for an XSS, if any. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.Xss xss = 14; - * @param \Google\Cloud\WebSecurityScanner\V1beta\Xss $var - * @return $this - */ - public function setXss($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\Xss::class); - $this->xss = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/FindingTypeStats.php b/WebSecurityScanner/src/V1beta/FindingTypeStats.php deleted file mode 100644 index e5b50f8e5b86..000000000000 --- a/WebSecurityScanner/src/V1beta/FindingTypeStats.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.websecurityscanner.v1beta.FindingTypeStats - */ -class FindingTypeStats extends \Google\Protobuf\Internal\Message -{ - /** - * The finding type associated with the stats. - * - * Generated from protobuf field string finding_type = 1; - */ - private $finding_type = ''; - /** - * The count of findings belonging to this finding type. - * - * Generated from protobuf field int32 finding_count = 2; - */ - private $finding_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $finding_type - * The finding type associated with the stats. - * @type int $finding_count - * The count of findings belonging to this finding type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingTypeStats::initOnce(); - parent::__construct($data); - } - - /** - * The finding type associated with the stats. - * - * Generated from protobuf field string finding_type = 1; - * @return string - */ - public function getFindingType() - { - return $this->finding_type; - } - - /** - * The finding type associated with the stats. - * - * Generated from protobuf field string finding_type = 1; - * @param string $var - * @return $this - */ - public function setFindingType($var) - { - GPBUtil::checkString($var, True); - $this->finding_type = $var; - - return $this; - } - - /** - * The count of findings belonging to this finding type. - * - * Generated from protobuf field int32 finding_count = 2; - * @return int - */ - public function getFindingCount() - { - return $this->finding_count; - } - - /** - * The count of findings belonging to this finding type. - * - * Generated from protobuf field int32 finding_count = 2; - * @param int $var - * @return $this - */ - public function setFindingCount($var) - { - GPBUtil::checkInt32($var); - $this->finding_count = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/Form.php b/WebSecurityScanner/src/V1beta/Form.php deleted file mode 100644 index 81261ebedf30..000000000000 --- a/WebSecurityScanner/src/V1beta/Form.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.websecurityscanner.v1beta.Form - */ -class Form extends \Google\Protobuf\Internal\Message -{ - /** - * ! The URI where to send the form when it's submitted. - * - * Generated from protobuf field string action_uri = 1; - */ - private $action_uri = ''; - /** - * ! The names of form fields related to the vulnerability. - * - * Generated from protobuf field repeated string fields = 2; - */ - private $fields; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $action_uri - * ! The URI where to send the form when it's submitted. - * @type array|\Google\Protobuf\Internal\RepeatedField $fields - * ! The names of form fields related to the vulnerability. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * ! The URI where to send the form when it's submitted. - * - * Generated from protobuf field string action_uri = 1; - * @return string - */ - public function getActionUri() - { - return $this->action_uri; - } - - /** - * ! The URI where to send the form when it's submitted. - * - * Generated from protobuf field string action_uri = 1; - * @param string $var - * @return $this - */ - public function setActionUri($var) - { - GPBUtil::checkString($var, True); - $this->action_uri = $var; - - return $this; - } - - /** - * ! The names of form fields related to the vulnerability. - * - * Generated from protobuf field repeated string fields = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFields() - { - return $this->fields; - } - - /** - * ! The names of form fields related to the vulnerability. - * - * Generated from protobuf field repeated string fields = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->fields = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php b/WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php deleted file mode 100644 index 45a5d36c2643..000000000000 --- a/WebSecurityScanner/src/V1beta/Gapic/WebSecurityScannerGapicClient.php +++ /dev/null @@ -1,1066 +0,0 @@ -projectName('[PROJECT]'); - * $scanConfig = new ScanConfig(); - * $response = $webSecurityScannerClient->createScanConfig($formattedParent, $scanConfig); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * 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 parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class WebSecurityScannerGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'websecurityscanner.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'websecurityscanner.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $findingNameTemplate; - - private static $projectNameTemplate; - - private static $scanConfigNameTemplate; - - private static $scanRunNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/web_security_scanner_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/web_security_scanner_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/web_security_scanner_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/web_security_scanner_rest_client_config.php', - ], - ], - ]; - } - - private static function getFindingNameTemplate() - { - if (self::$findingNameTemplate == null) { - self::$findingNameTemplate = new PathTemplate('projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}'); - } - - return self::$findingNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getScanConfigNameTemplate() - { - if (self::$scanConfigNameTemplate == null) { - self::$scanConfigNameTemplate = new PathTemplate('projects/{project}/scanConfigs/{scan_config}'); - } - - return self::$scanConfigNameTemplate; - } - - private static function getScanRunNameTemplate() - { - if (self::$scanRunNameTemplate == null) { - self::$scanRunNameTemplate = new PathTemplate('projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}'); - } - - return self::$scanRunNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'finding' => self::getFindingNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'scanConfig' => self::getScanConfigNameTemplate(), - 'scanRun' => self::getScanRunNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a finding - * resource. - * - * @param string $project - * @param string $scanConfig - * @param string $scanRun - * @param string $finding - * - * @return string The formatted finding resource. - * - * @experimental - */ - public static function findingName($project, $scanConfig, $scanRun, $finding) - { - return self::getFindingNameTemplate()->render([ - 'project' => $project, - 'scan_config' => $scanConfig, - 'scan_run' => $scanRun, - 'finding' => $finding, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - * - * @experimental - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a scan_config - * resource. - * - * @param string $project - * @param string $scanConfig - * - * @return string The formatted scan_config resource. - * - * @experimental - */ - public static function scanConfigName($project, $scanConfig) - { - return self::getScanConfigNameTemplate()->render([ - 'project' => $project, - 'scan_config' => $scanConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a scan_run - * resource. - * - * @param string $project - * @param string $scanConfig - * @param string $scanRun - * - * @return string The formatted scan_run resource. - * - * @experimental - */ - public static function scanRunName($project, $scanConfig, $scanRun) - { - return self::getScanRunNameTemplate()->render([ - 'project' => $project, - 'scan_config' => $scanConfig, - 'scan_run' => $scanRun, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - finding: projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding} - * - project: projects/{project} - * - scanConfig: projects/{project}/scanConfigs/{scan_config} - * - scanRun: projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'websecurityscanner.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->projectName('[PROJECT]'); - * $scanConfig = new ScanConfig(); - * $response = $webSecurityScannerClient->createScanConfig($formattedParent, $scanConfig); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name where the scan is created, which should be a - * project resource name in the format 'projects/{projectId}'. - * @param ScanConfig $scanConfig Required. The ScanConfig to be created. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createScanConfig($parent, $scanConfig, array $optionalArgs = []) - { - $request = new CreateScanConfigRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setScanConfig($scanConfig); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateScanConfig', ScanConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an existing ScanConfig and its child resources. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * $webSecurityScannerClient->deleteScanConfig($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanConfig to be deleted. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteScanConfig($name, array $optionalArgs = []) - { - $request = new DeleteScanConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteScanConfig', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a Finding. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->findingName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]'); - * $response = $webSecurityScannerClient->getFinding($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\Finding - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getFinding($name, array $optionalArgs = []) - { - $request = new GetFindingRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetFinding', Finding::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * $response = $webSecurityScannerClient->getScanConfig($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getScanConfig($name, array $optionalArgs = []) - { - $request = new GetScanConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetScanConfig', ScanConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $response = $webSecurityScannerClient->getScanRun($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getScanRun($name, array $optionalArgs = []) - { - $request = new GetScanRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetScanRun', ScanRun::class, $optionalArgs, $request)->wait(); - } - - /** - * List CrawledUrls under a given ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listCrawledUrls($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listCrawledUrls($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listCrawledUrls($parent, array $optionalArgs = []) - { - $request = new ListCrawledUrlsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCrawledUrls', $optionalArgs, ListCrawledUrlsResponse::class, $request); - } - - /** - * List all FindingTypeStats under a given ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $response = $webSecurityScannerClient->listFindingTypeStats($formattedParent); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFindingTypeStats($parent, array $optionalArgs = []) - { - $request = new ListFindingTypeStatsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ListFindingTypeStats', ListFindingTypeStatsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * List Findings under a given ScanRun. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $filter = 'filter'; - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listFindings($formattedParent, $filter); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listFindings($formattedParent, $filter); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param string $filter Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listFindings($parent, $filter, array $optionalArgs = []) - { - $request = new ListFindingsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilter($filter); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFindings', $optionalArgs, ListFindingsResponse::class, $request); - } - - /** - * Lists ScanConfigs under a given project. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listScanConfigs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listScanConfigs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listScanConfigs($parent, array $optionalArgs = []) - { - $request = new ListScanConfigsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListScanConfigs', $optionalArgs, ListScanConfigsResponse::class, $request); - } - - /** - * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - * stop time. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedParent = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * // Iterate over pages of elements - * $pagedResponse = $webSecurityScannerClient->listScanRuns($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $webSecurityScannerClient->listScanRuns($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listScanRuns($parent, array $optionalArgs = []) - { - $request = new ListScanRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListScanRuns', $optionalArgs, ListScanRunsResponse::class, $request); - } - - /** - * Start a ScanRun according to the given ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - * $response = $webSecurityScannerClient->startScanRun($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function startScanRun($name, array $optionalArgs = []) - { - $request = new StartScanRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('StartScanRun', ScanRun::class, $optionalArgs, $request)->wait(); - } - - /** - * Stops a ScanRun. The stopped ScanRun is returned. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $formattedName = $webSecurityScannerClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - * $response = $webSecurityScannerClient->stopScanRun($formattedName); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function stopScanRun($name, array $optionalArgs = []) - { - $request = new StopScanRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('StopScanRun', ScanRun::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a ScanConfig. This method support partial update of a ScanConfig. - * - * Sample code: - * ``` - * $webSecurityScannerClient = new WebSecurityScannerClient(); - * try { - * $scanConfig = new ScanConfig(); - * $updateMask = new FieldMask(); - * $response = $webSecurityScannerClient->updateScanConfig($scanConfig, $updateMask); - * } finally { - * $webSecurityScannerClient->close(); - * } - * ``` - * - * @param ScanConfig $scanConfig Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * @param FieldMask $updateMask Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateScanConfig($scanConfig, $updateMask, array $optionalArgs = []) - { - $request = new UpdateScanConfigRequest(); - $requestParamHeaders = []; - $request->setScanConfig($scanConfig); - $request->setUpdateMask($updateMask); - $requestParamHeaders['scan_config.name'] = $scanConfig->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateScanConfig', ScanConfig::class, $optionalArgs, $request)->wait(); - } -} diff --git a/WebSecurityScanner/src/V1beta/GetFindingRequest.php b/WebSecurityScanner/src/V1beta/GetFindingRequest.php deleted file mode 100644 index f96df3b43c73..000000000000 --- a/WebSecurityScanner/src/V1beta/GetFindingRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.GetFindingRequest - */ -class GetFindingRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Finding to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/GetScanConfigRequest.php b/WebSecurityScanner/src/V1beta/GetScanConfigRequest.php deleted file mode 100644 index 4671577cfe43..000000000000 --- a/WebSecurityScanner/src/V1beta/GetScanConfigRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.websecurityscanner.v1beta.GetScanConfigRequest - */ -class GetScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanConfig to be returned. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/GetScanRunRequest.php b/WebSecurityScanner/src/V1beta/GetScanRunRequest.php deleted file mode 100644 index 66a115ecf0cb..000000000000 --- a/WebSecurityScanner/src/V1beta/GetScanRunRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.GetScanRunRequest - */ -class GetScanRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanRun to be returned. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php b/WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php deleted file mode 100644 index b3edfafdd7e4..000000000000 --- a/WebSecurityScanner/src/V1beta/ListCrawledUrlsRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest - */ -class ListCrawledUrlsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - */ - private $page_token = ''; - /** - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of CrawledUrls to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php b/WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php deleted file mode 100644 index 84dc94838b85..000000000000 --- a/WebSecurityScanner/src/V1beta/ListCrawledUrlsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse - */ -class ListCrawledUrlsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of CrawledUrls returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.CrawledUrl crawled_urls = 1; - */ - private $crawled_urls; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\CrawledUrl>|\Google\Protobuf\Internal\RepeatedField $crawled_urls - * The list of CrawledUrls returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of CrawledUrls returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.CrawledUrl crawled_urls = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCrawledUrls() - { - return $this->crawled_urls; - } - - /** - * The list of CrawledUrls returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.CrawledUrl crawled_urls = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\CrawledUrl>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCrawledUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\CrawledUrl::class); - $this->crawled_urls = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php b/WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php deleted file mode 100644 index dd8ca47fe0ab..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest - */ -class ListFindingTypeStatsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php b/WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php deleted file mode 100644 index ae47be432e3d..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingTypeStatsResponse.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse - */ -class ListFindingTypeStatsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of FindingTypeStats returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.FindingTypeStats finding_type_stats = 1; - */ - private $finding_type_stats; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\FindingTypeStats>|\Google\Protobuf\Internal\RepeatedField $finding_type_stats - * The list of FindingTypeStats returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of FindingTypeStats returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.FindingTypeStats finding_type_stats = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFindingTypeStats() - { - return $this->finding_type_stats; - } - - /** - * The list of FindingTypeStats returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.FindingTypeStats finding_type_stats = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\FindingTypeStats>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFindingTypeStats($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\FindingTypeStats::class); - $this->finding_type_stats = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingsRequest.php b/WebSecurityScanner/src/V1beta/ListFindingsRequest.php deleted file mode 100644 index 3cfd93cf12e9..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingsRequest.php +++ /dev/null @@ -1,205 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingsRequest - */ -class ListFindingsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $filter = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 4; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * @type string $filter - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan run resource name in the - * format - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. The filter expression. The expression must be in the format: - * . - * Supported field: 'finding_type'. - * Supported operator: '='. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 4; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of Findings to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 4; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListFindingsResponse.php b/WebSecurityScanner/src/V1beta/ListFindingsResponse.php deleted file mode 100644 index fda5ae8f1600..000000000000 --- a/WebSecurityScanner/src/V1beta/ListFindingsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListFindingsResponse - */ -class ListFindingsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of Findings returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.Finding findings = 1; - */ - private $findings; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\Finding>|\Google\Protobuf\Internal\RepeatedField $findings - * The list of Findings returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of Findings returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.Finding findings = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFindings() - { - return $this->findings; - } - - /** - * The list of Findings returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.Finding findings = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\Finding>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\Finding::class); - $this->findings = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php b/WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php deleted file mode 100644 index b3b939d38008..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanConfigsRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest - */ -class ListScanConfigsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - */ - private $page_token = ''; - /** - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a project resource name in the - * format 'projects/{projectId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of ScanConfigs to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php b/WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php deleted file mode 100644 index 25042db68f21..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanConfigsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse - */ -class ListScanConfigsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of ScanConfigs returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig scan_configs = 1; - */ - private $scan_configs; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig>|\Google\Protobuf\Internal\RepeatedField $scan_configs - * The list of ScanConfigs returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of ScanConfigs returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig scan_configs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScanConfigs() - { - return $this->scan_configs; - } - - /** - * The list of ScanConfigs returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig scan_configs = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScanConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig::class); - $this->scan_configs = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanRunsRequest.php b/WebSecurityScanner/src/V1beta/ListScanRunsRequest.php deleted file mode 100644 index 19acaf0e69be..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanRunsRequest.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanRunsRequest - */ -class ListScanRunsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - */ - private $page_token = ''; - /** - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - */ - private $page_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * @type string $page_token - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * @type int $page_size - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name, which should be a scan resource name in the - * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A token identifying a page of results to be returned. This should be a - * `next_page_token` value returned from a previous List request. - * If unspecified, the first page of results is returned. - * - * Generated from protobuf field string page_token = 2; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of ScanRuns to return, can be limited by server. - * If not specified or not positive, the implementation will select a - * reasonable value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ListScanRunsResponse.php b/WebSecurityScanner/src/V1beta/ListScanRunsResponse.php deleted file mode 100644 index bd37ba6d5f1b..000000000000 --- a/WebSecurityScanner/src/V1beta/ListScanRunsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ListScanRunsResponse - */ -class ListScanRunsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of ScanRuns returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRun scan_runs = 1; - */ - private $scan_runs; - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRun>|\Google\Protobuf\Internal\RepeatedField $scan_runs - * The list of ScanRuns returned. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * The list of ScanRuns returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRun scan_runs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScanRuns() - { - return $this->scan_runs; - } - - /** - * The list of ScanRuns returned. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRun scan_runs = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRun>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScanRuns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun::class); - $this->scan_runs = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no - * more results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/OutdatedLibrary.php b/WebSecurityScanner/src/V1beta/OutdatedLibrary.php deleted file mode 100644 index 96b537029710..000000000000 --- a/WebSecurityScanner/src/V1beta/OutdatedLibrary.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.websecurityscanner.v1beta.OutdatedLibrary - */ -class OutdatedLibrary extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the outdated library. - * - * Generated from protobuf field string library_name = 1; - */ - private $library_name = ''; - /** - * The version number. - * - * Generated from protobuf field string version = 2; - */ - private $version = ''; - /** - * URLs to learn more information about the vulnerabilities in the library. - * - * Generated from protobuf field repeated string learn_more_urls = 3; - */ - private $learn_more_urls; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $library_name - * The name of the outdated library. - * @type string $version - * The version number. - * @type array|\Google\Protobuf\Internal\RepeatedField $learn_more_urls - * URLs to learn more information about the vulnerabilities in the library. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * The name of the outdated library. - * - * Generated from protobuf field string library_name = 1; - * @return string - */ - public function getLibraryName() - { - return $this->library_name; - } - - /** - * The name of the outdated library. - * - * Generated from protobuf field string library_name = 1; - * @param string $var - * @return $this - */ - public function setLibraryName($var) - { - GPBUtil::checkString($var, True); - $this->library_name = $var; - - return $this; - } - - /** - * The version number. - * - * Generated from protobuf field string version = 2; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The version number. - * - * Generated from protobuf field string version = 2; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * URLs to learn more information about the vulnerabilities in the library. - * - * Generated from protobuf field repeated string learn_more_urls = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLearnMoreUrls() - { - return $this->learn_more_urls; - } - - /** - * URLs to learn more information about the vulnerabilities in the library. - * - * Generated from protobuf field repeated string learn_more_urls = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLearnMoreUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->learn_more_urls = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/README.md b/WebSecurityScanner/src/V1beta/README.md deleted file mode 100644 index 997d83bfada8..000000000000 --- a/WebSecurityScanner/src/V1beta/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Google Cloud Web Security Scanner V1beta generated client for PHP - -### Sample - -```php -require 'vendor/autoload.php'; - -use Google\Cloud\WebSecurityScanner\V1beta\ScanConfig; -use Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\UserAgent; -use Google\Cloud\WebSecurityScanner\V1beta\ScanRun\ExecutionState; -use Google\Cloud\WebSecurityScanner\V1beta\WebSecurityScannerClient; - -$client = new WebSecurityScannerClient(); -$scanConfig = $client->createScanConfig( - WebSecurityScannerClient::projectName('[MY_PROJECT_ID'), - new ScanConfig([ - 'display_name' => 'Test Scan', - 'starting_urls' => ['https://[MY_APPLICATION_ID].appspot.com/'], - 'user_agent' => UserAgent::CHROME_LINUX - ]) -); -$scanRun = $client->startScanRun($scanConfig->getName()); - -echo 'Scan execution state: ' . ExecutionState::name($scanRun->getExecutionState()) . PHP_EOL; -``` diff --git a/WebSecurityScanner/src/V1beta/ScanConfig.php b/WebSecurityScanner/src/V1beta/ScanConfig.php deleted file mode 100644 index 9668d29ce8d9..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig.php +++ /dev/null @@ -1,507 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig - */ -class ScanConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Required. The user provided display name of the ScanConfig. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $display_name = ''; - /** - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * - * Generated from protobuf field int32 max_qps = 3; - */ - private $max_qps = 0; - /** - * Required. The starting URLs from which the scanner finds site pages. - * - * Generated from protobuf field repeated string starting_urls = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $starting_urls; - /** - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication authentication = 5; - */ - private $authentication = null; - /** - * The user agent used during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent user_agent = 6; - */ - private $user_agent = 0; - /** - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * - * Generated from protobuf field repeated string blacklist_patterns = 7; - */ - private $blacklist_patterns; - /** - * The schedule of the ScanConfig. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule schedule = 8; - */ - private $schedule = null; - /** - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform target_platforms = 9; - */ - private $target_platforms; - /** - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; - */ - private $export_to_security_command_center = 0; - /** - * Latest ScanRun if available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun latest_run = 11; - */ - private $latest_run = null; - /** - * The risk level selected for the scan - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel risk_level = 12; - */ - private $risk_level = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * @type string $display_name - * Required. The user provided display name of the ScanConfig. - * @type int $max_qps - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * @type array|\Google\Protobuf\Internal\RepeatedField $starting_urls - * Required. The starting URLs from which the scanner finds site pages. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication $authentication - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * @type int $user_agent - * The user agent used during scanning. - * @type array|\Google\Protobuf\Internal\RepeatedField $blacklist_patterns - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule $schedule - * The schedule of the ScanConfig. - * @type array|\Google\Protobuf\Internal\RepeatedField $target_platforms - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * @type int $export_to_security_command_center - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanRun $latest_run - * Latest ScanRun if available. - * @type int $risk_level - * The risk level selected for the scan - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the ScanConfig. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - * generated by the system. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The user provided display name of the ScanConfig. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The user provided display name of the ScanConfig. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * - * Generated from protobuf field int32 max_qps = 3; - * @return int - */ - public function getMaxQps() - { - return $this->max_qps; - } - - /** - * The maximum QPS during scanning. A valid value ranges from 5 to 20 - * inclusively. If the field is unspecified or its value is set 0, server will - * default to 15. Other values outside of [5, 20] range will be rejected with - * INVALID_ARGUMENT error. - * - * Generated from protobuf field int32 max_qps = 3; - * @param int $var - * @return $this - */ - public function setMaxQps($var) - { - GPBUtil::checkInt32($var); - $this->max_qps = $var; - - return $this; - } - - /** - * Required. The starting URLs from which the scanner finds site pages. - * - * Generated from protobuf field repeated string starting_urls = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStartingUrls() - { - return $this->starting_urls; - } - - /** - * Required. The starting URLs from which the scanner finds site pages. - * - * Generated from protobuf field repeated string starting_urls = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStartingUrls($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->starting_urls = $arr; - - return $this; - } - - /** - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication authentication = 5; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication|null - */ - public function getAuthentication() - { - return $this->authentication; - } - - public function hasAuthentication() - { - return isset($this->authentication); - } - - public function clearAuthentication() - { - unset($this->authentication); - } - - /** - * The authentication configuration. If specified, service will use the - * authentication configuration during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication authentication = 5; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication $var - * @return $this - */ - public function setAuthentication($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication::class); - $this->authentication = $var; - - return $this; - } - - /** - * The user agent used during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent user_agent = 6; - * @return int - */ - public function getUserAgent() - { - return $this->user_agent; - } - - /** - * The user agent used during scanning. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent user_agent = 6; - * @param int $var - * @return $this - */ - public function setUserAgent($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\UserAgent::class); - $this->user_agent = $var; - - return $this; - } - - /** - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * - * Generated from protobuf field repeated string blacklist_patterns = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlacklistPatterns() - { - return $this->blacklist_patterns; - } - - /** - * The blacklist URL patterns as described in - * https://cloud.google.com/security-scanner/docs/excluded-urls - * - * Generated from protobuf field repeated string blacklist_patterns = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlacklistPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->blacklist_patterns = $arr; - - return $this; - } - - /** - * The schedule of the ScanConfig. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule schedule = 8; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule|null - */ - public function getSchedule() - { - return $this->schedule; - } - - public function hasSchedule() - { - return isset($this->schedule); - } - - public function clearSchedule() - { - unset($this->schedule); - } - - /** - * The schedule of the ScanConfig. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule schedule = 8; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule $var - * @return $this - */ - public function setSchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Schedule::class); - $this->schedule = $var; - - return $this; - } - - /** - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform target_platforms = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTargetPlatforms() - { - return $this->target_platforms; - } - - /** - * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - * used as a default. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform target_platforms = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTargetPlatforms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\TargetPlatform::class); - $this->target_platforms = $arr; - - return $this; - } - - /** - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; - * @return int - */ - public function getExportToSecurityCommandCenter() - { - return $this->export_to_security_command_center; - } - - /** - * Controls export of scan configurations and results to Cloud Security - * Command Center. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; - * @param int $var - * @return $this - */ - public function setExportToSecurityCommandCenter($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\ExportToSecurityCommandCenter::class); - $this->export_to_security_command_center = $var; - - return $this; - } - - /** - * Latest ScanRun if available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun latest_run = 11; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRun|null - */ - public function getLatestRun() - { - return $this->latest_run; - } - - public function hasLatestRun() - { - return isset($this->latest_run); - } - - public function clearLatestRun() - { - unset($this->latest_run); - } - - /** - * Latest ScanRun if available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun latest_run = 11; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanRun $var - * @return $this - */ - public function setLatestRun($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun::class); - $this->latest_run = $var; - - return $this; - } - - /** - * The risk level selected for the scan - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel risk_level = 12; - * @return int - */ - public function getRiskLevel() - { - return $this->risk_level; - } - - /** - * The risk level selected for the scan - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel risk_level = 12; - * @param int $var - * @return $this - */ - public function setRiskLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\RiskLevel::class); - $this->risk_level = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php b/WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php deleted file mode 100644 index 5f485de4c3a8..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication - */ -class Authentication extends \Google\Protobuf\Internal\Message -{ - protected $authentication; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount $google_account - * Authentication using a Google account. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount $custom_account - * Authentication using a custom account. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * Authentication using a Google account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount google_account = 1; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount|null - */ - public function getGoogleAccount() - { - return $this->readOneof(1); - } - - public function hasGoogleAccount() - { - return $this->hasOneof(1); - } - - /** - * Authentication using a Google account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount google_account = 1; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount $var - * @return $this - */ - public function setGoogleAccount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\GoogleAccount::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Authentication using a custom account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount custom_account = 2; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount|null - */ - public function getCustomAccount() - { - return $this->readOneof(2); - } - - public function hasCustomAccount() - { - return $this->hasOneof(2); - } - - /** - * Authentication using a custom account. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount custom_account = 2; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount $var - * @return $this - */ - public function setCustomAccount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig\Authentication\CustomAccount::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthentication() - { - return $this->whichOneof("authentication"); - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php b/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php deleted file mode 100644 index 25306dcd4d80..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/CustomAccount.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount - */ -class CustomAccount extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The user name of the custom account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $username = ''; - /** - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - */ - private $password = ''; - /** - * Required. The login form URL of the website. - * - * Generated from protobuf field string login_url = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $login_url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $username - * Required. The user name of the custom account. - * @type string $password - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * @type string $login_url - * Required. The login form URL of the website. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The user name of the custom account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Required. The user name of the custom account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUsername($var) - { - GPBUtil::checkString($var, True); - $this->username = $var; - - return $this; - } - - /** - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Required. Input only. The password of the custom account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - - /** - * Required. The login form URL of the website. - * - * Generated from protobuf field string login_url = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLoginUrl() - { - return $this->login_url; - } - - /** - * Required. The login form URL of the website. - * - * Generated from protobuf field string login_url = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLoginUrl($var) - { - GPBUtil::checkString($var, True); - $this->login_url = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php b/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php deleted file mode 100644 index b3df07ea1584..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Authentication/GoogleAccount.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount - */ -class GoogleAccount extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The user name of the Google account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $username = ''; - /** - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - */ - private $password = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $username - * Required. The user name of the Google account. - * @type string $password - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. The user name of the Google account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Required. The user name of the Google account. - * - * Generated from protobuf field string username = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUsername($var) - { - GPBUtil::checkString($var, True); - $this->username = $var; - - return $this; - } - - /** - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Required. Input only. The password of the Google account. The credential is stored encrypted - * and not returned in any response nor included in audit logs. - * - * Generated from protobuf field string password = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php b/WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php deleted file mode 100644 index 76993975efb7..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/ExportToSecurityCommandCenter.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter - */ -class ExportToSecurityCommandCenter -{ - /** - * Use default, which is ENABLED. - * - * Generated from protobuf enum EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; - */ - const EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; - /** - * Export results of this scan to Cloud Security Command Center. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * Do not export results of this scan to Cloud Security Command Center. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - - private static $valueToName = [ - self::EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED => 'EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED', - self::ENABLED => 'ENABLED', - self::DISABLED => 'DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php b/WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php deleted file mode 100644 index be286fe10c91..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/RiskLevel.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel - */ -class RiskLevel -{ - /** - * Use default, which is NORMAL. - * - * Generated from protobuf enum RISK_LEVEL_UNSPECIFIED = 0; - */ - const RISK_LEVEL_UNSPECIFIED = 0; - /** - * Normal scanning (Recommended) - * - * Generated from protobuf enum NORMAL = 1; - */ - const NORMAL = 1; - /** - * Lower impact scanning - * - * Generated from protobuf enum LOW = 2; - */ - const LOW = 2; - - private static $valueToName = [ - self::RISK_LEVEL_UNSPECIFIED => 'RISK_LEVEL_UNSPECIFIED', - self::NORMAL => 'NORMAL', - self::LOW => 'LOW', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php b/WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php deleted file mode 100644 index b2f50b13b69c..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/Schedule.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule - */ -class Schedule extends \Google\Protobuf\Internal\Message -{ - /** - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - */ - private $schedule_time = null; - /** - * Required. The duration of time between executions in days. - * - * Generated from protobuf field int32 interval_duration_days = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $interval_duration_days = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $schedule_time - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * @type int $interval_duration_days - * Required. The duration of time between executions in days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfig::initOnce(); - parent::__construct($data); - } - - /** - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getScheduleTime() - { - return $this->schedule_time; - } - - public function hasScheduleTime() - { - return isset($this->schedule_time); - } - - public function clearScheduleTime() - { - unset($this->schedule_time); - } - - /** - * A timestamp indicates when the next run will be scheduled. The value is - * refreshed by the server after each run. If unspecified, it will default - * to current server time, which means the scan will be scheduled to start - * immediately. - * - * Generated from protobuf field .google.protobuf.Timestamp schedule_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setScheduleTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->schedule_time = $var; - - return $this; - } - - /** - * Required. The duration of time between executions in days. - * - * Generated from protobuf field int32 interval_duration_days = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getIntervalDurationDays() - { - return $this->interval_duration_days; - } - - /** - * Required. The duration of time between executions in days. - * - * Generated from protobuf field int32 interval_duration_days = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setIntervalDurationDays($var) - { - GPBUtil::checkInt32($var); - $this->interval_duration_days = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php b/WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php deleted file mode 100644 index 95ec166d905b..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/TargetPlatform.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform - */ -class TargetPlatform -{ - /** - * The target platform is unknown. Requests with this enum value will be - * rejected with INVALID_ARGUMENT error. - * - * Generated from protobuf enum TARGET_PLATFORM_UNSPECIFIED = 0; - */ - const TARGET_PLATFORM_UNSPECIFIED = 0; - /** - * Google App Engine service. - * - * Generated from protobuf enum APP_ENGINE = 1; - */ - const APP_ENGINE = 1; - /** - * Google Compute Engine service. - * - * Generated from protobuf enum COMPUTE = 2; - */ - const COMPUTE = 2; - - private static $valueToName = [ - self::TARGET_PLATFORM_UNSPECIFIED => 'TARGET_PLATFORM_UNSPECIFIED', - self::APP_ENGINE => 'APP_ENGINE', - self::COMPUTE => 'COMPUTE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php b/WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php deleted file mode 100644 index 4670f4bc3fcd..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfig/UserAgent.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent - */ -class UserAgent -{ - /** - * The user agent is unknown. Service will default to CHROME_LINUX. - * - * Generated from protobuf enum USER_AGENT_UNSPECIFIED = 0; - */ - const USER_AGENT_UNSPECIFIED = 0; - /** - * Chrome on Linux. This is the service default if unspecified. - * - * Generated from protobuf enum CHROME_LINUX = 1; - */ - const CHROME_LINUX = 1; - /** - * Chrome on Android. - * - * Generated from protobuf enum CHROME_ANDROID = 2; - */ - const CHROME_ANDROID = 2; - /** - * Safari on IPhone. - * - * Generated from protobuf enum SAFARI_IPHONE = 3; - */ - const SAFARI_IPHONE = 3; - - private static $valueToName = [ - self::USER_AGENT_UNSPECIFIED => 'USER_AGENT_UNSPECIFIED', - self::CHROME_LINUX => 'CHROME_LINUX', - self::CHROME_ANDROID => 'CHROME_ANDROID', - self::SAFARI_IPHONE => 'SAFARI_IPHONE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanConfigError.php b/WebSecurityScanner/src/V1beta/ScanConfigError.php deleted file mode 100644 index f53110cfdbc6..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfigError.php +++ /dev/null @@ -1,116 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfigError - */ -class ScanConfigError extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates the reason code for a configuration failure. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError.Code code = 1; - */ - private $code = 0; - /** - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * - * Generated from protobuf field string field_name = 2; - */ - private $field_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $code - * Indicates the reason code for a configuration failure. - * @type string $field_name - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanConfigError::initOnce(); - parent::__construct($data); - } - - /** - * Indicates the reason code for a configuration failure. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError.Code code = 1; - * @return int - */ - public function getCode() - { - return $this->code; - } - - /** - * Indicates the reason code for a configuration failure. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError.Code code = 1; - * @param int $var - * @return $this - */ - public function setCode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError\Code::class); - $this->code = $var; - - return $this; - } - - /** - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * - * Generated from protobuf field string field_name = 2; - * @return string - */ - public function getFieldName() - { - return $this->field_name; - } - - /** - * Indicates the full name of the ScanConfig field that triggers this error, - * for example "scan_config.max_qps". This field is provided for - * troubleshooting purposes only and its actual value can change in the - * future. - * - * Generated from protobuf field string field_name = 2; - * @param string $var - * @return $this - */ - public function setFieldName($var) - { - GPBUtil::checkString($var, True); - $this->field_name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanConfigError/Code.php b/WebSecurityScanner/src/V1beta/ScanConfigError/Code.php deleted file mode 100644 index 78ede6d6d0da..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanConfigError/Code.php +++ /dev/null @@ -1,353 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanConfigError.Code - */ -class Code -{ - /** - * There is no error. - * - * Generated from protobuf enum CODE_UNSPECIFIED = 0; - */ - const CODE_UNSPECIFIED = 0; - /** - * There is no error. - * - * Generated from protobuf enum OK = 0; - */ - const OK = 0; - /** - * Indicates an internal server error. - * Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. - * - * Generated from protobuf enum INTERNAL_ERROR = 1; - */ - const INTERNAL_ERROR = 1; - /** - * One of the seed URLs is an App Engine URL but we cannot validate the scan - * settings due to an App Engine API backend error. - * - * Generated from protobuf enum APPENGINE_API_BACKEND_ERROR = 2; - */ - const APPENGINE_API_BACKEND_ERROR = 2; - /** - * One of the seed URLs is an App Engine URL but we cannot access the - * App Engine API to validate scan settings. - * - * Generated from protobuf enum APPENGINE_API_NOT_ACCESSIBLE = 3; - */ - const APPENGINE_API_NOT_ACCESSIBLE = 3; - /** - * One of the seed URLs is an App Engine URL but the Default Host of the - * App Engine is not set. - * - * Generated from protobuf enum APPENGINE_DEFAULT_HOST_MISSING = 4; - */ - const APPENGINE_DEFAULT_HOST_MISSING = 4; - /** - * Google corporate accounts can not be used for scanning. - * - * Generated from protobuf enum CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; - */ - const CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; - /** - * The account of the scan creator can not be used for scanning. - * - * Generated from protobuf enum CANNOT_USE_OWNER_ACCOUNT = 7; - */ - const CANNOT_USE_OWNER_ACCOUNT = 7; - /** - * This scan targets Compute Engine, but we cannot validate scan settings - * due to a Compute Engine API backend error. - * - * Generated from protobuf enum COMPUTE_API_BACKEND_ERROR = 8; - */ - const COMPUTE_API_BACKEND_ERROR = 8; - /** - * This scan targets Compute Engine, but we cannot access the Compute Engine - * API to validate the scan settings. - * - * Generated from protobuf enum COMPUTE_API_NOT_ACCESSIBLE = 9; - */ - const COMPUTE_API_NOT_ACCESSIBLE = 9; - /** - * The Custom Login URL does not belong to the current project. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; - */ - const CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; - /** - * The Custom Login URL is malformed (can not be parsed). - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_MALFORMED = 11; - */ - const CUSTOM_LOGIN_URL_MALFORMED = 11; - /** - * The Custom Login URL is mapped to a non-routable IP address in DNS. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; - */ - const CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; - /** - * The Custom Login URL is mapped to an IP address which is not reserved for - * the current project. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; - */ - const CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; - /** - * The Custom Login URL has a non-routable IP address. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; - */ - const CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; - /** - * The Custom Login URL has an IP address which is not reserved for the - * current project. - * - * Generated from protobuf enum CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; - */ - const CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; - /** - * Another scan with the same name (case-sensitive) already exists. - * - * Generated from protobuf enum DUPLICATE_SCAN_NAME = 16; - */ - const DUPLICATE_SCAN_NAME = 16; - /** - * A field is set to an invalid value. - * - * Generated from protobuf enum INVALID_FIELD_VALUE = 18; - */ - const INVALID_FIELD_VALUE = 18; - /** - * There was an error trying to authenticate to the scan target. - * - * Generated from protobuf enum FAILED_TO_AUTHENTICATE_TO_TARGET = 19; - */ - const FAILED_TO_AUTHENTICATE_TO_TARGET = 19; - /** - * Finding type value is not specified in the list findings request. - * - * Generated from protobuf enum FINDING_TYPE_UNSPECIFIED = 20; - */ - const FINDING_TYPE_UNSPECIFIED = 20; - /** - * Scan targets Compute Engine, yet current project was not whitelisted for - * Google Compute Engine Scanning Alpha access. - * - * Generated from protobuf enum FORBIDDEN_TO_SCAN_COMPUTE = 21; - */ - const FORBIDDEN_TO_SCAN_COMPUTE = 21; - /** - * User tries to update managed scan - * - * Generated from protobuf enum FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; - */ - const FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; - /** - * The supplied filter is malformed. For example, it can not be parsed, does - * not have a filter type in expression, or the same filter type appears - * more than once. - * - * Generated from protobuf enum MALFORMED_FILTER = 22; - */ - const MALFORMED_FILTER = 22; - /** - * The supplied resource name is malformed (can not be parsed). - * - * Generated from protobuf enum MALFORMED_RESOURCE_NAME = 23; - */ - const MALFORMED_RESOURCE_NAME = 23; - /** - * The current project is not in an active state. - * - * Generated from protobuf enum PROJECT_INACTIVE = 24; - */ - const PROJECT_INACTIVE = 24; - /** - * A required field is not set. - * - * Generated from protobuf enum REQUIRED_FIELD = 25; - */ - const REQUIRED_FIELD = 25; - /** - * Project id, scanconfig id, scanrun id, or finding id are not consistent - * with each other in resource name. - * - * Generated from protobuf enum RESOURCE_NAME_INCONSISTENT = 26; - */ - const RESOURCE_NAME_INCONSISTENT = 26; - /** - * The scan being requested to start is already running. - * - * Generated from protobuf enum SCAN_ALREADY_RUNNING = 27; - */ - const SCAN_ALREADY_RUNNING = 27; - /** - * The scan that was requested to be stopped is not running. - * - * Generated from protobuf enum SCAN_NOT_RUNNING = 28; - */ - const SCAN_NOT_RUNNING = 28; - /** - * One of the seed URLs does not belong to the current project. - * - * Generated from protobuf enum SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; - */ - const SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; - /** - * One of the seed URLs is malformed (can not be parsed). - * - * Generated from protobuf enum SEED_URL_MALFORMED = 30; - */ - const SEED_URL_MALFORMED = 30; - /** - * One of the seed URLs is mapped to a non-routable IP address in DNS. - * - * Generated from protobuf enum SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; - */ - const SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; - /** - * One of the seed URLs is mapped to an IP address which is not reserved - * for the current project. - * - * Generated from protobuf enum SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; - */ - const SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; - /** - * One of the seed URLs has on-routable IP address. - * - * Generated from protobuf enum SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; - */ - const SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; - /** - * One of the seed URLs has an IP address that is not reserved - * for the current project. - * - * Generated from protobuf enum SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; - */ - const SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; - /** - * The Cloud Security Scanner service account is not configured under the - * project. - * - * Generated from protobuf enum SERVICE_ACCOUNT_NOT_CONFIGURED = 36; - */ - const SERVICE_ACCOUNT_NOT_CONFIGURED = 36; - /** - * A project has reached the maximum number of scans. - * - * Generated from protobuf enum TOO_MANY_SCANS = 37; - */ - const TOO_MANY_SCANS = 37; - /** - * Resolving the details of the current project fails. - * - * Generated from protobuf enum UNABLE_TO_RESOLVE_PROJECT_INFO = 38; - */ - const UNABLE_TO_RESOLVE_PROJECT_INFO = 38; - /** - * One or more blacklist patterns were in the wrong format. - * - * Generated from protobuf enum UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; - */ - const UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; - /** - * The supplied filter is not supported. - * - * Generated from protobuf enum UNSUPPORTED_FILTER = 40; - */ - const UNSUPPORTED_FILTER = 40; - /** - * The supplied finding type is not supported. For example, we do not - * provide findings of the given finding type. - * - * Generated from protobuf enum UNSUPPORTED_FINDING_TYPE = 41; - */ - const UNSUPPORTED_FINDING_TYPE = 41; - /** - * The URL scheme of one or more of the supplied URLs is not supported. - * - * Generated from protobuf enum UNSUPPORTED_URL_SCHEME = 42; - */ - const UNSUPPORTED_URL_SCHEME = 42; - - private static $valueToName = [ - self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', - self::OK => 'OK', - self::INTERNAL_ERROR => 'INTERNAL_ERROR', - self::APPENGINE_API_BACKEND_ERROR => 'APPENGINE_API_BACKEND_ERROR', - self::APPENGINE_API_NOT_ACCESSIBLE => 'APPENGINE_API_NOT_ACCESSIBLE', - self::APPENGINE_DEFAULT_HOST_MISSING => 'APPENGINE_DEFAULT_HOST_MISSING', - self::CANNOT_USE_GOOGLE_COM_ACCOUNT => 'CANNOT_USE_GOOGLE_COM_ACCOUNT', - self::CANNOT_USE_OWNER_ACCOUNT => 'CANNOT_USE_OWNER_ACCOUNT', - self::COMPUTE_API_BACKEND_ERROR => 'COMPUTE_API_BACKEND_ERROR', - self::COMPUTE_API_NOT_ACCESSIBLE => 'COMPUTE_API_NOT_ACCESSIBLE', - self::CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT => 'CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT', - self::CUSTOM_LOGIN_URL_MALFORMED => 'CUSTOM_LOGIN_URL_MALFORMED', - self::CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS => 'CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS', - self::CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS => 'CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS', - self::CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS => 'CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS', - self::CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS => 'CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS', - self::DUPLICATE_SCAN_NAME => 'DUPLICATE_SCAN_NAME', - self::INVALID_FIELD_VALUE => 'INVALID_FIELD_VALUE', - self::FAILED_TO_AUTHENTICATE_TO_TARGET => 'FAILED_TO_AUTHENTICATE_TO_TARGET', - self::FINDING_TYPE_UNSPECIFIED => 'FINDING_TYPE_UNSPECIFIED', - self::FORBIDDEN_TO_SCAN_COMPUTE => 'FORBIDDEN_TO_SCAN_COMPUTE', - self::FORBIDDEN_UPDATE_TO_MANAGED_SCAN => 'FORBIDDEN_UPDATE_TO_MANAGED_SCAN', - self::MALFORMED_FILTER => 'MALFORMED_FILTER', - self::MALFORMED_RESOURCE_NAME => 'MALFORMED_RESOURCE_NAME', - self::PROJECT_INACTIVE => 'PROJECT_INACTIVE', - self::REQUIRED_FIELD => 'REQUIRED_FIELD', - self::RESOURCE_NAME_INCONSISTENT => 'RESOURCE_NAME_INCONSISTENT', - self::SCAN_ALREADY_RUNNING => 'SCAN_ALREADY_RUNNING', - self::SCAN_NOT_RUNNING => 'SCAN_NOT_RUNNING', - self::SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT => 'SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT', - self::SEED_URL_MALFORMED => 'SEED_URL_MALFORMED', - self::SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS => 'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS', - self::SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS => 'SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS', - self::SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS => 'SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS', - self::SEED_URL_HAS_UNRESERVED_IP_ADDRESS => 'SEED_URL_HAS_UNRESERVED_IP_ADDRESS', - self::SERVICE_ACCOUNT_NOT_CONFIGURED => 'SERVICE_ACCOUNT_NOT_CONFIGURED', - self::TOO_MANY_SCANS => 'TOO_MANY_SCANS', - self::UNABLE_TO_RESOLVE_PROJECT_INFO => 'UNABLE_TO_RESOLVE_PROJECT_INFO', - self::UNSUPPORTED_BLACKLIST_PATTERN_FORMAT => 'UNSUPPORTED_BLACKLIST_PATTERN_FORMAT', - self::UNSUPPORTED_FILTER => 'UNSUPPORTED_FILTER', - self::UNSUPPORTED_FINDING_TYPE => 'UNSUPPORTED_FINDING_TYPE', - self::UNSUPPORTED_URL_SCHEME => 'UNSUPPORTED_URL_SCHEME', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRun.php b/WebSecurityScanner/src/V1beta/ScanRun.php deleted file mode 100644 index cec5b68807ab..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRun.php +++ /dev/null @@ -1,486 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRun - */ -class ScanRun extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * The execution state of the ScanRun. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState execution_state = 2; - */ - private $execution_state = 0; - /** - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ResultState result_state = 3; - */ - private $result_state = 0; - /** - * The time at which the ScanRun started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - */ - private $start_time = null; - /** - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - */ - private $end_time = null; - /** - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * - * Generated from protobuf field int64 urls_crawled_count = 6; - */ - private $urls_crawled_count = 0; - /** - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * - * Generated from protobuf field int64 urls_tested_count = 7; - */ - private $urls_tested_count = 0; - /** - * Whether the scan run has found any vulnerabilities. - * - * Generated from protobuf field bool has_vulnerabilities = 8; - */ - private $has_vulnerabilities = false; - /** - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * - * Generated from protobuf field int32 progress_percent = 9; - */ - private $progress_percent = 0; - /** - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace error_trace = 10; - */ - private $error_trace = null; - /** - * A list of warnings, if such are encountered during this scan run. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace warning_traces = 11; - */ - private $warning_traces; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * @type int $execution_state - * The execution state of the ScanRun. - * @type int $result_state - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * @type \Google\Protobuf\Timestamp $start_time - * The time at which the ScanRun started. - * @type \Google\Protobuf\Timestamp $end_time - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * @type int|string $urls_crawled_count - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * @type int|string $urls_tested_count - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * @type bool $has_vulnerabilities - * Whether the scan run has found any vulnerabilities. - * @type int $progress_percent - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace $error_trace - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace>|\Google\Protobuf\Internal\RepeatedField $warning_traces - * A list of warnings, if such are encountered during this scan run. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanRun::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the ScanRun. The name follows the format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * The ScanRun IDs are generated by the system. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The execution state of the ScanRun. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState execution_state = 2; - * @return int - */ - public function getExecutionState() - { - return $this->execution_state; - } - - /** - * The execution state of the ScanRun. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState execution_state = 2; - * @param int $var - * @return $this - */ - public function setExecutionState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun\ExecutionState::class); - $this->execution_state = $var; - - return $this; - } - - /** - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ResultState result_state = 3; - * @return int - */ - public function getResultState() - { - return $this->result_state; - } - - /** - * The result state of the ScanRun. This field is only available after the - * execution state reaches "FINISHED". - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRun.ResultState result_state = 3; - * @param int $var - * @return $this - */ - public function setResultState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRun\ResultState::class); - $this->result_state = $var; - - return $this; - } - - /** - * The time at which the ScanRun started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time at which the ScanRun started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time at which the ScanRun reached termination state - that the ScanRun - * is either finished or stopped by user. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * - * Generated from protobuf field int64 urls_crawled_count = 6; - * @return int|string - */ - public function getUrlsCrawledCount() - { - return $this->urls_crawled_count; - } - - /** - * The number of URLs crawled during this ScanRun. If the scan is in progress, - * the value represents the number of URLs crawled up to now. - * - * Generated from protobuf field int64 urls_crawled_count = 6; - * @param int|string $var - * @return $this - */ - public function setUrlsCrawledCount($var) - { - GPBUtil::checkInt64($var); - $this->urls_crawled_count = $var; - - return $this; - } - - /** - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * - * Generated from protobuf field int64 urls_tested_count = 7; - * @return int|string - */ - public function getUrlsTestedCount() - { - return $this->urls_tested_count; - } - - /** - * The number of URLs tested during this ScanRun. If the scan is in progress, - * the value represents the number of URLs tested up to now. The number of - * URLs tested is usually larger than the number URLS crawled because - * typically a crawled URL is tested with multiple test payloads. - * - * Generated from protobuf field int64 urls_tested_count = 7; - * @param int|string $var - * @return $this - */ - public function setUrlsTestedCount($var) - { - GPBUtil::checkInt64($var); - $this->urls_tested_count = $var; - - return $this; - } - - /** - * Whether the scan run has found any vulnerabilities. - * - * Generated from protobuf field bool has_vulnerabilities = 8; - * @return bool - */ - public function getHasVulnerabilities() - { - return $this->has_vulnerabilities; - } - - /** - * Whether the scan run has found any vulnerabilities. - * - * Generated from protobuf field bool has_vulnerabilities = 8; - * @param bool $var - * @return $this - */ - public function setHasVulnerabilities($var) - { - GPBUtil::checkBool($var); - $this->has_vulnerabilities = $var; - - return $this; - } - - /** - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * - * Generated from protobuf field int32 progress_percent = 9; - * @return int - */ - public function getProgressPercent() - { - return $this->progress_percent; - } - - /** - * The percentage of total completion ranging from 0 to 100. - * If the scan is in queue, the value is 0. - * If the scan is running, the value ranges from 0 to 100. - * If the scan is finished, the value is 100. - * - * Generated from protobuf field int32 progress_percent = 9; - * @param int $var - * @return $this - */ - public function setProgressPercent($var) - { - GPBUtil::checkInt32($var); - $this->progress_percent = $var; - - return $this; - } - - /** - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace error_trace = 10; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace|null - */ - public function getErrorTrace() - { - return $this->error_trace; - } - - public function hasErrorTrace() - { - return isset($this->error_trace); - } - - public function clearErrorTrace() - { - unset($this->error_trace); - } - - /** - * If result_state is an ERROR, this field provides the primary reason for - * scan's termination and more details, if such are available. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace error_trace = 10; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace $var - * @return $this - */ - public function setErrorTrace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace::class); - $this->error_trace = $var; - - return $this; - } - - /** - * A list of warnings, if such are encountered during this scan run. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace warning_traces = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWarningTraces() - { - return $this->warning_traces; - } - - /** - * A list of warnings, if such are encountered during this scan run. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace warning_traces = 11; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWarningTraces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace::class); - $this->warning_traces = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php b/WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php deleted file mode 100644 index e8ae96619ebd..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRun/ExecutionState.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState - */ -class ExecutionState -{ - /** - * Represents an invalid state caused by internal server error. This value - * should never be returned. - * - * Generated from protobuf enum EXECUTION_STATE_UNSPECIFIED = 0; - */ - const EXECUTION_STATE_UNSPECIFIED = 0; - /** - * The scan is waiting in the queue. - * - * Generated from protobuf enum QUEUED = 1; - */ - const QUEUED = 1; - /** - * The scan is in progress. - * - * Generated from protobuf enum SCANNING = 2; - */ - const SCANNING = 2; - /** - * The scan is either finished or stopped by user. - * - * Generated from protobuf enum FINISHED = 3; - */ - const FINISHED = 3; - - private static $valueToName = [ - self::EXECUTION_STATE_UNSPECIFIED => 'EXECUTION_STATE_UNSPECIFIED', - self::QUEUED => 'QUEUED', - self::SCANNING => 'SCANNING', - self::FINISHED => 'FINISHED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRun/ResultState.php b/WebSecurityScanner/src/V1beta/ScanRun/ResultState.php deleted file mode 100644 index 55493b551227..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRun/ResultState.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRun.ResultState - */ -class ResultState -{ - /** - * Default value. This value is returned when the ScanRun is not yet - * finished. - * - * Generated from protobuf enum RESULT_STATE_UNSPECIFIED = 0; - */ - const RESULT_STATE_UNSPECIFIED = 0; - /** - * The scan finished without errors. - * - * Generated from protobuf enum SUCCESS = 1; - */ - const SUCCESS = 1; - /** - * The scan finished with errors. - * - * Generated from protobuf enum ERROR = 2; - */ - const ERROR = 2; - /** - * The scan was terminated by user. - * - * Generated from protobuf enum KILLED = 3; - */ - const KILLED = 3; - - private static $valueToName = [ - self::RESULT_STATE_UNSPECIFIED => 'RESULT_STATE_UNSPECIFIED', - self::SUCCESS => 'SUCCESS', - self::ERROR => 'ERROR', - self::KILLED => 'KILLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php b/WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php deleted file mode 100644 index e273282c5e1a..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace.php +++ /dev/null @@ -1,162 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace - */ -class ScanRunErrorTrace extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates the error reason code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code code = 1; - */ - private $code = 0; - /** - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError scan_config_error = 2; - */ - private $scan_config_error = null; - /** - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * - * Generated from protobuf field int32 most_common_http_error_code = 3; - */ - private $most_common_http_error_code = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $code - * Indicates the error reason code. - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError $scan_config_error - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * @type int $most_common_http_error_code - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanRunErrorTrace::initOnce(); - parent::__construct($data); - } - - /** - * Indicates the error reason code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code code = 1; - * @return int - */ - public function getCode() - { - return $this->code; - } - - /** - * Indicates the error reason code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code code = 1; - * @param int $var - * @return $this - */ - public function setCode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunErrorTrace\Code::class); - $this->code = $var; - - return $this; - } - - /** - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError scan_config_error = 2; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError|null - */ - public function getScanConfigError() - { - return $this->scan_config_error; - } - - public function hasScanConfigError() - { - return isset($this->scan_config_error); - } - - public function clearScanConfigError() - { - unset($this->scan_config_error); - } - - /** - * If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - * message encountered during scan configuration validation that is performed - * before each scan run. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfigError scan_config_error = 2; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError $var - * @return $this - */ - public function setScanConfigError($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError::class); - $this->scan_config_error = $var; - - return $this; - } - - /** - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * - * Generated from protobuf field int32 most_common_http_error_code = 3; - * @return int - */ - public function getMostCommonHttpErrorCode() - { - return $this->most_common_http_error_code; - } - - /** - * If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - * common HTTP error code, if such is available. For example, if this code is - * 404, the scan has encountered too many NOT_FOUND responses. - * - * Generated from protobuf field int32 most_common_http_error_code = 3; - * @param int $var - * @return $this - */ - public function setMostCommonHttpErrorCode($var) - { - GPBUtil::checkInt32($var); - $this->most_common_http_error_code = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php b/WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php deleted file mode 100644 index 779044e6e53a..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunErrorTrace/Code.php +++ /dev/null @@ -1,97 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code - */ -class Code -{ - /** - * Default value is never used. - * - * Generated from protobuf enum CODE_UNSPECIFIED = 0; - */ - const CODE_UNSPECIFIED = 0; - /** - * Indicates that the scan run failed due to an internal server error. - * - * Generated from protobuf enum INTERNAL_ERROR = 1; - */ - const INTERNAL_ERROR = 1; - /** - * Indicates a scan configuration error, usually due to outdated ScanConfig - * settings, such as starting_urls or the DNS configuration. - * - * Generated from protobuf enum SCAN_CONFIG_ISSUE = 2; - */ - const SCAN_CONFIG_ISSUE = 2; - /** - * Indicates an authentication error, usually due to outdated ScanConfig - * authentication settings. - * - * Generated from protobuf enum AUTHENTICATION_CONFIG_ISSUE = 3; - */ - const AUTHENTICATION_CONFIG_ISSUE = 3; - /** - * Indicates a scan operation timeout, usually caused by a very large site. - * - * Generated from protobuf enum TIMED_OUT_WHILE_SCANNING = 4; - */ - const TIMED_OUT_WHILE_SCANNING = 4; - /** - * Indicates that a scan encountered excessive redirects, either to - * authentication or some other page outside of the scan scope. - * - * Generated from protobuf enum TOO_MANY_REDIRECTS = 5; - */ - const TOO_MANY_REDIRECTS = 5; - /** - * Indicates that a scan encountered numerous errors from the web site - * pages. When available, most_common_http_error_code field indicates the - * most common HTTP error code encountered during the scan. - * - * Generated from protobuf enum TOO_MANY_HTTP_ERRORS = 6; - */ - const TOO_MANY_HTTP_ERRORS = 6; - - private static $valueToName = [ - self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', - self::INTERNAL_ERROR => 'INTERNAL_ERROR', - self::SCAN_CONFIG_ISSUE => 'SCAN_CONFIG_ISSUE', - self::AUTHENTICATION_CONFIG_ISSUE => 'AUTHENTICATION_CONFIG_ISSUE', - self::TIMED_OUT_WHILE_SCANNING => 'TIMED_OUT_WHILE_SCANNING', - self::TOO_MANY_REDIRECTS => 'TOO_MANY_REDIRECTS', - self::TOO_MANY_HTTP_ERRORS => 'TOO_MANY_HTTP_ERRORS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php b/WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php deleted file mode 100644 index b83f4a95a1af..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace - */ -class ScanRunWarningTrace extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates the warning code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code code = 1; - */ - private $code = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $code - * Indicates the warning code. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\ScanRunWarningTrace::initOnce(); - parent::__construct($data); - } - - /** - * Indicates the warning code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code code = 1; - * @return int - */ - public function getCode() - { - return $this->code; - } - - /** - * Indicates the warning code. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code code = 1; - * @param int $var - * @return $this - */ - public function setCode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanRunWarningTrace\Code::class); - $this->code = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php b/WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php deleted file mode 100644 index 35bb0edf4be0..000000000000 --- a/WebSecurityScanner/src/V1beta/ScanRunWarningTrace/Code.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code - */ -class Code -{ - /** - * Default value is never used. - * - * Generated from protobuf enum CODE_UNSPECIFIED = 0; - */ - const CODE_UNSPECIFIED = 0; - /** - * Indicates that a scan discovered an unexpectedly low number of URLs. This - * is sometimes caused by complex navigation features or by using a single - * URL for numerous pages. - * - * Generated from protobuf enum INSUFFICIENT_CRAWL_RESULTS = 1; - */ - const INSUFFICIENT_CRAWL_RESULTS = 1; - /** - * Indicates that a scan discovered too many URLs to test, or excessive - * redundant URLs. - * - * Generated from protobuf enum TOO_MANY_CRAWL_RESULTS = 2; - */ - const TOO_MANY_CRAWL_RESULTS = 2; - /** - * Indicates that too many tests have been generated for the scan. Customer - * should try reducing the number of starting URLs, increasing the QPS rate, - * or narrowing down the scope of the scan using the excluded patterns. - * - * Generated from protobuf enum TOO_MANY_FUZZ_TASKS = 3; - */ - const TOO_MANY_FUZZ_TASKS = 3; - /** - * Indicates that a scan is blocked by IAP. - * - * Generated from protobuf enum BLOCKED_BY_IAP = 4; - */ - const BLOCKED_BY_IAP = 4; - - private static $valueToName = [ - self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', - self::INSUFFICIENT_CRAWL_RESULTS => 'INSUFFICIENT_CRAWL_RESULTS', - self::TOO_MANY_CRAWL_RESULTS => 'TOO_MANY_CRAWL_RESULTS', - self::TOO_MANY_FUZZ_TASKS => 'TOO_MANY_FUZZ_TASKS', - self::BLOCKED_BY_IAP => 'BLOCKED_BY_IAP', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/WebSecurityScanner/src/V1beta/StartScanRunRequest.php b/WebSecurityScanner/src/V1beta/StartScanRunRequest.php deleted file mode 100644 index 88c291c52f62..000000000000 --- a/WebSecurityScanner/src/V1beta/StartScanRunRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.websecurityscanner.v1beta.StartScanRunRequest - */ -class StartScanRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanConfig to be used. The name follows the - * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/StopScanRunRequest.php b/WebSecurityScanner/src/V1beta/StopScanRunRequest.php deleted file mode 100644 index a7a8c3093ae2..000000000000 --- a/WebSecurityScanner/src/V1beta/StopScanRunRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.websecurityscanner.v1beta.StopScanRunRequest - */ -class StopScanRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the ScanRun to be stopped. The name follows the - * format of - * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php b/WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php deleted file mode 100644 index 73096f603bcd..000000000000 --- a/WebSecurityScanner/src/V1beta/UpdateScanConfigRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest - */ -class UpdateScanConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $scan_config = null; - /** - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $scan_config - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\WebSecurityScanner::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig|null - */ - public function getScanConfig() - { - return $this->scan_config; - } - - public function hasScanConfig() - { - return isset($this->scan_config); - } - - public function clearScanConfig() - { - unset($this->scan_config); - } - - /** - * Required. The ScanConfig to be updated. The name field must be set to identify the - * resource to be updated. The values of fields not covered by the mask - * will be ignored. - * - * Generated from protobuf field .google.cloud.websecurityscanner.v1beta.ScanConfig scan_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig $var - * @return $this - */ - public function setScanConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfig::class); - $this->scan_config = $var; - - return $this; - } - - /** - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. The update mask applies to the resource. For the `FieldMask` definition, - * see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/ViolatingResource.php b/WebSecurityScanner/src/V1beta/ViolatingResource.php deleted file mode 100644 index 6189691969f8..000000000000 --- a/WebSecurityScanner/src/V1beta/ViolatingResource.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.websecurityscanner.v1beta.ViolatingResource - */ -class ViolatingResource extends \Google\Protobuf\Internal\Message -{ - /** - * The MIME type of this resource. - * - * Generated from protobuf field string content_type = 1; - */ - private $content_type = ''; - /** - * URL of this violating resource. - * - * Generated from protobuf field string resource_url = 2; - */ - private $resource_url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content_type - * The MIME type of this resource. - * @type string $resource_url - * URL of this violating resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * The MIME type of this resource. - * - * Generated from protobuf field string content_type = 1; - * @return string - */ - public function getContentType() - { - return $this->content_type; - } - - /** - * The MIME type of this resource. - * - * Generated from protobuf field string content_type = 1; - * @param string $var - * @return $this - */ - public function setContentType($var) - { - GPBUtil::checkString($var, True); - $this->content_type = $var; - - return $this; - } - - /** - * URL of this violating resource. - * - * Generated from protobuf field string resource_url = 2; - * @return string - */ - public function getResourceUrl() - { - return $this->resource_url; - } - - /** - * URL of this violating resource. - * - * Generated from protobuf field string resource_url = 2; - * @param string $var - * @return $this - */ - public function setResourceUrl($var) - { - GPBUtil::checkString($var, True); - $this->resource_url = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/VulnerableHeaders.php b/WebSecurityScanner/src/V1beta/VulnerableHeaders.php deleted file mode 100644 index 9f1a8f040533..000000000000 --- a/WebSecurityScanner/src/V1beta/VulnerableHeaders.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.websecurityscanner.v1beta.VulnerableHeaders - */ -class VulnerableHeaders extends \Google\Protobuf\Internal\Message -{ - /** - * List of vulnerable headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header headers = 1; - */ - private $headers; - /** - * List of missing headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header missing_headers = 2; - */ - private $missing_headers; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $headers - * List of vulnerable headers. - * @type array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $missing_headers - * List of missing headers. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * List of vulnerable headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header headers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * List of vulnerable headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header headers = 1; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header::class); - $this->headers = $arr; - - return $this; - } - - /** - * List of missing headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header missing_headers = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMissingHeaders() - { - return $this->missing_headers; - } - - /** - * List of missing headers. - * - * Generated from protobuf field repeated .google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header missing_headers = 2; - * @param array<\Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMissingHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\WebSecurityScanner\V1beta\VulnerableHeaders\Header::class); - $this->missing_headers = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php b/WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php deleted file mode 100644 index 607df91305dd..000000000000 --- a/WebSecurityScanner/src/V1beta/VulnerableHeaders/Header.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header - */ -class Header extends \Google\Protobuf\Internal\Message -{ - /** - * Header name. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Header value. - * - * Generated from protobuf field string value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Header name. - * @type string $value - * Header value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * Header name. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Header name. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Header value. - * - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Header value. - * - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - - diff --git a/WebSecurityScanner/src/V1beta/VulnerableParameters.php b/WebSecurityScanner/src/V1beta/VulnerableParameters.php deleted file mode 100644 index 97f40daec8ea..000000000000 --- a/WebSecurityScanner/src/V1beta/VulnerableParameters.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.websecurityscanner.v1beta.VulnerableParameters - */ -class VulnerableParameters extends \Google\Protobuf\Internal\Message -{ - /** - * The vulnerable parameter names. - * - * Generated from protobuf field repeated string parameter_names = 1; - */ - private $parameter_names; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $parameter_names - * The vulnerable parameter names. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * The vulnerable parameter names. - * - * Generated from protobuf field repeated string parameter_names = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getParameterNames() - { - return $this->parameter_names; - } - - /** - * The vulnerable parameter names. - * - * Generated from protobuf field repeated string parameter_names = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setParameterNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->parameter_names = $arr; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php b/WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php deleted file mode 100644 index 827b581bf9bb..000000000000 --- a/WebSecurityScanner/src/V1beta/WebSecurityScannerClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Deletes an existing ScanConfig and its child resources. - * @param \Google\Cloud\WebSecurityScanner\V1beta\DeleteScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteScanConfig(\Google\Cloud\WebSecurityScanner\V1beta\DeleteScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/DeleteScanConfig', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1beta\GetScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanConfig(\Google\Cloud\WebSecurityScanner\V1beta\GetScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanConfigs under a given project. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListScanConfigsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanConfigs(\Google\Cloud\WebSecurityScanner\V1beta\ListScanConfigsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanConfigs', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListScanConfigsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a ScanConfig. This method support partial update of a ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1beta\UpdateScanConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateScanConfig(\Google\Cloud\WebSecurityScanner\V1beta\UpdateScanConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/UpdateScanConfig', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanConfig', 'decode'], - $metadata, $options); - } - - /** - * Start a ScanRun according to the given ScanConfig. - * @param \Google\Cloud\WebSecurityScanner\V1beta\StartScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StartScanRun(\Google\Cloud\WebSecurityScanner\V1beta\StartScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StartScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Gets a ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\GetScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetScanRun(\Google\Cloud\WebSecurityScanner\V1beta\GetScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - * stop time. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListScanRunsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListScanRuns(\Google\Cloud\WebSecurityScanner\V1beta\ListScanRunsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanRuns', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListScanRunsResponse', 'decode'], - $metadata, $options); - } - - /** - * Stops a ScanRun. The stopped ScanRun is returned. - * @param \Google\Cloud\WebSecurityScanner\V1beta\StopScanRunRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function StopScanRun(\Google\Cloud\WebSecurityScanner\V1beta\StopScanRunRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StopScanRun', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ScanRun', 'decode'], - $metadata, $options); - } - - /** - * List CrawledUrls under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListCrawledUrlsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCrawledUrls(\Google\Cloud\WebSecurityScanner\V1beta\ListCrawledUrlsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListCrawledUrls', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListCrawledUrlsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a Finding. - * @param \Google\Cloud\WebSecurityScanner\V1beta\GetFindingRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetFinding(\Google\Cloud\WebSecurityScanner\V1beta\GetFindingRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetFinding', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\Finding', 'decode'], - $metadata, $options); - } - - /** - * List Findings under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListFindingsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindings(\Google\Cloud\WebSecurityScanner\V1beta\ListFindingsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindings', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListFindingsResponse', 'decode'], - $metadata, $options); - } - - /** - * List all FindingTypeStats under a given ScanRun. - * @param \Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListFindingTypeStats(\Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindingTypeStats', - $argument, - ['\Google\Cloud\WebSecurityScanner\V1beta\ListFindingTypeStatsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/WebSecurityScanner/src/V1beta/Xss.php b/WebSecurityScanner/src/V1beta/Xss.php deleted file mode 100644 index f12e4dca81cb..000000000000 --- a/WebSecurityScanner/src/V1beta/Xss.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.websecurityscanner.v1beta.Xss - */ -class Xss extends \Google\Protobuf\Internal\Message -{ - /** - * Stack traces leading to the point where the XSS occurred. - * - * Generated from protobuf field repeated string stack_traces = 1; - */ - private $stack_traces; - /** - * An error message generated by a javascript breakage. - * - * Generated from protobuf field string error_message = 2; - */ - private $error_message = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $stack_traces - * Stack traces leading to the point where the XSS occurred. - * @type string $error_message - * An error message generated by a javascript breakage. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Websecurityscanner\V1Beta\FindingAddon::initOnce(); - parent::__construct($data); - } - - /** - * Stack traces leading to the point where the XSS occurred. - * - * Generated from protobuf field repeated string stack_traces = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStackTraces() - { - return $this->stack_traces; - } - - /** - * Stack traces leading to the point where the XSS occurred. - * - * Generated from protobuf field repeated string stack_traces = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStackTraces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->stack_traces = $arr; - - return $this; - } - - /** - * An error message generated by a javascript breakage. - * - * Generated from protobuf field string error_message = 2; - * @return string - */ - public function getErrorMessage() - { - return $this->error_message; - } - - /** - * An error message generated by a javascript breakage. - * - * Generated from protobuf field string error_message = 2; - * @param string $var - * @return $this - */ - public function setErrorMessage($var) - { - GPBUtil::checkString($var, True); - $this->error_message = $var; - - return $this; - } - -} - diff --git a/WebSecurityScanner/src/V1beta/gapic_metadata.json b/WebSecurityScanner/src/V1beta/gapic_metadata.json deleted file mode 100644 index d4fd47e4dfb8..000000000000 --- a/WebSecurityScanner/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.websecurityscanner.v1beta", - "libraryPackage": "Google\\Cloud\\WebSecurityScanner\\V1beta", - "services": { - "WebSecurityScanner": { - "clients": { - "grpc": { - "libraryClient": "WebSecurityScannerGapicClient", - "rpcs": { - "CreateScanConfig": { - "methods": [ - "createScanConfig" - ] - }, - "DeleteScanConfig": { - "methods": [ - "deleteScanConfig" - ] - }, - "GetFinding": { - "methods": [ - "getFinding" - ] - }, - "GetScanConfig": { - "methods": [ - "getScanConfig" - ] - }, - "GetScanRun": { - "methods": [ - "getScanRun" - ] - }, - "ListCrawledUrls": { - "methods": [ - "listCrawledUrls" - ] - }, - "ListFindingTypeStats": { - "methods": [ - "listFindingTypeStats" - ] - }, - "ListFindings": { - "methods": [ - "listFindings" - ] - }, - "ListScanConfigs": { - "methods": [ - "listScanConfigs" - ] - }, - "ListScanRuns": { - "methods": [ - "listScanRuns" - ] - }, - "StartScanRun": { - "methods": [ - "startScanRun" - ] - }, - "StopScanRun": { - "methods": [ - "stopScanRun" - ] - }, - "UpdateScanConfig": { - "methods": [ - "updateScanConfig" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json b/WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json deleted file mode 100644 index e905462ef39f..000000000000 --- a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_client_config.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "interfaces": { - "google.cloud.websecurityscanner.v1beta.WebSecurityScanner": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetFinding": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetScanRun": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListCrawledUrls": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListFindingTypeStats": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListFindings": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListScanConfigs": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListScanRuns": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "StartScanRun": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "StopScanRun": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateScanConfig": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php b/WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php deleted file mode 100644 index 2e4d71ba0b62..000000000000 --- a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_descriptor_config.php +++ /dev/null @@ -1,68 +0,0 @@ - [ - 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' => [ - 'ListCrawledUrls' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCrawledUrls', - ], - ], - 'ListFindings' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFindings', - ], - ], - 'ListScanConfigs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getScanConfigs', - ], - ], - 'ListScanRuns' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getScanRuns', - ], - ], - ], - ], -]; diff --git a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php b/WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php deleted file mode 100644 index 1cd7634cf0da..000000000000 --- a/WebSecurityScanner/src/V1beta/resources/web_security_scanner_rest_client_config.php +++ /dev/null @@ -1,183 +0,0 @@ - [ - 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' => [ - 'CreateScanConfig' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*}/scanConfigs', - 'body' => 'scan_config', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteScanConfig' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetFinding' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetScanConfig' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetScanRun' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListCrawledUrls' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFindingTypeStats' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFindings' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'filter', - ], - ], - 'ListScanConfigs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*}/scanConfigs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListScanRuns' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'StartScanRun' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*}:start', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'StopScanRun' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'UpdateScanConfig' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{scan_config.name=projects/*/scanConfigs/*}', - 'body' => 'scan_config', - 'placeholders' => [ - 'scan_config.name' => [ - 'getters' => [ - 'getScanConfig', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php b/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php index c9d375b48fdc..c2f1d0615160 100644 --- a/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php +++ b/WebSecurityScanner/tests/Unit/V1/Client/WebSecurityScannerClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return WebSecurityScannerClient */ @@ -126,12 +128,15 @@ public function createScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new CreateScanConfigRequest(); try { @@ -179,12 +184,15 @@ public function deleteScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new DeleteScanConfigRequest(); try { @@ -253,12 +261,15 @@ public function getFindingExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetFindingRequest(); try { @@ -319,12 +330,15 @@ public function getScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetScanConfigRequest(); try { @@ -383,12 +397,15 @@ public function getScanRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetScanRunRequest(); try { @@ -415,9 +432,7 @@ public function listCrawledUrlsTest() // Mock response $nextPageToken = ''; $crawledUrlsElement = new CrawledUrl(); - $crawledUrls = [ - $crawledUrlsElement, - ]; + $crawledUrls = [$crawledUrlsElement]; $expectedResponse = new ListCrawledUrlsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setCrawledUrls($crawledUrls); @@ -447,12 +462,15 @@ public function listCrawledUrlsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListCrawledUrlsRequest(); try { @@ -486,7 +504,10 @@ public function listFindingTypeStatsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats', $actualFuncCall); + $this->assertSame( + '/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats', + $actualFuncCall + ); $this->assertTrue($transport->isExhausted()); } @@ -501,12 +522,15 @@ public function listFindingTypeStatsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListFindingTypeStatsRequest(); try { @@ -533,9 +557,7 @@ public function listFindingsTest() // Mock response $nextPageToken = ''; $findingsElement = new Finding(); - $findings = [ - $findingsElement, - ]; + $findings = [$findingsElement]; $expectedResponse = new ListFindingsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setFindings($findings); @@ -565,12 +587,15 @@ public function listFindingsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListFindingsRequest(); try { @@ -597,9 +622,7 @@ public function listScanConfigsTest() // Mock response $nextPageToken = ''; $scanConfigsElement = new ScanConfig(); - $scanConfigs = [ - $scanConfigsElement, - ]; + $scanConfigs = [$scanConfigsElement]; $expectedResponse = new ListScanConfigsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setScanConfigs($scanConfigs); @@ -629,12 +652,15 @@ public function listScanConfigsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListScanConfigsRequest(); try { @@ -661,9 +687,7 @@ public function listScanRunsTest() // Mock response $nextPageToken = ''; $scanRunsElement = new ScanRun(); - $scanRuns = [ - $scanRunsElement, - ]; + $scanRuns = [$scanRunsElement]; $expectedResponse = new ListScanRunsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setScanRuns($scanRuns); @@ -693,12 +717,15 @@ public function listScanRunsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListScanRunsRequest(); try { @@ -757,12 +784,15 @@ public function startScanRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new StartScanRunRequest(); try { @@ -821,12 +851,15 @@ public function stopScanRunExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new StopScanRunRequest(); try { @@ -887,12 +920,15 @@ public function updateScanConfigExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateScanConfigRequest(); try { diff --git a/WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php b/WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php deleted file mode 100644 index 2b85b60f324b..000000000000 --- a/WebSecurityScanner/tests/Unit/V1beta/WebSecurityScannerClientTest.php +++ /dev/null @@ -1,960 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return WebSecurityScannerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new WebSecurityScannerClient($options); - } - - /** @test */ - public function createScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxQps = 844445913; - $expectedResponse = new ScanConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxQps($maxQps); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - $response = $gapicClient->createScanConfig($formattedParent, $scanConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getScanConfig(); - $this->assertProtobufEquals($scanConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - try { - $gapicClient->createScanConfig($formattedParent, $scanConfig); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $gapicClient->deleteScanConfig($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/DeleteScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->deleteScanConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFindingTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $findingType = 'findingType274496048'; - $httpMethod = 'httpMethod820747384'; - $fuzzedUrl = 'fuzzedUrl-2120677666'; - $body = 'body3029410'; - $description = 'description-1724546052'; - $reproductionUrl = 'reproductionUrl-244934180'; - $frameUrl = 'frameUrl545464221'; - $finalUrl = 'finalUrl355601190'; - $trackingId = 'trackingId1878901667'; - $expectedResponse = new Finding(); - $expectedResponse->setName($name2); - $expectedResponse->setFindingType($findingType); - $expectedResponse->setHttpMethod($httpMethod); - $expectedResponse->setFuzzedUrl($fuzzedUrl); - $expectedResponse->setBody($body); - $expectedResponse->setDescription($description); - $expectedResponse->setReproductionUrl($reproductionUrl); - $expectedResponse->setFrameUrl($frameUrl); - $expectedResponse->setFinalUrl($finalUrl); - $expectedResponse->setTrackingId($trackingId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->findingName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]'); - $response = $gapicClient->getFinding($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetFinding', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFindingExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->findingName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]'); - try { - $gapicClient->getFinding($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $maxQps = 844445913; - $expectedResponse = new ScanConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxQps($maxQps); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $response = $gapicClient->getScanConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->getScanConfig($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $urlsCrawledCount = 1749797253; - $urlsTestedCount = 1498664068; - $hasVulnerabilities = false; - $progressPercent = 2137894861; - $expectedResponse = new ScanRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUrlsCrawledCount($urlsCrawledCount); - $expectedResponse->setUrlsTestedCount($urlsTestedCount); - $expectedResponse->setHasVulnerabilities($hasVulnerabilities); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->getScanRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getScanRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->getScanRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCrawledUrlsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $crawledUrlsElement = new CrawledUrl(); - $crawledUrls = [ - $crawledUrlsElement, - ]; - $expectedResponse = new ListCrawledUrlsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCrawledUrls($crawledUrls); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->listCrawledUrls($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCrawledUrls()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListCrawledUrls', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCrawledUrlsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->listCrawledUrls($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingTypeStatsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListFindingTypeStatsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->listFindingTypeStats($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindingTypeStats', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingTypeStatsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->listFindingTypeStats($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $findingsElement = new Finding(); - $findings = [ - $findingsElement, - ]; - $expectedResponse = new ListFindingsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFindings($findings); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->listFindings($formattedParent, $filter); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFindings()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindings', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFindingsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $filter = 'filter-1274492040'; - try { - $gapicClient->listFindings($formattedParent, $filter); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanConfigsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $scanConfigsElement = new ScanConfig(); - $scanConfigs = [ - $scanConfigsElement, - ]; - $expectedResponse = new ListScanConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setScanConfigs($scanConfigs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listScanConfigs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getScanConfigs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanConfigsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listScanConfigs($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $scanRunsElement = new ScanRun(); - $scanRuns = [ - $scanRunsElement, - ]; - $expectedResponse = new ListScanRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setScanRuns($scanRuns); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $response = $gapicClient->listScanRuns($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getScanRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listScanRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->listScanRuns($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function startScanRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $urlsCrawledCount = 1749797253; - $urlsTestedCount = 1498664068; - $hasVulnerabilities = false; - $progressPercent = 2137894861; - $expectedResponse = new ScanRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUrlsCrawledCount($urlsCrawledCount); - $expectedResponse->setUrlsTestedCount($urlsTestedCount); - $expectedResponse->setHasVulnerabilities($hasVulnerabilities); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - $response = $gapicClient->startScanRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StartScanRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function startScanRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanConfigName('[PROJECT]', '[SCAN_CONFIG]'); - try { - $gapicClient->startScanRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function stopScanRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $urlsCrawledCount = 1749797253; - $urlsTestedCount = 1498664068; - $hasVulnerabilities = false; - $progressPercent = 2137894861; - $expectedResponse = new ScanRun(); - $expectedResponse->setName($name2); - $expectedResponse->setUrlsCrawledCount($urlsCrawledCount); - $expectedResponse->setUrlsTestedCount($urlsTestedCount); - $expectedResponse->setHasVulnerabilities($hasVulnerabilities); - $expectedResponse->setProgressPercent($progressPercent); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - $response = $gapicClient->stopScanRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StopScanRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function stopScanRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->scanRunName('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]'); - try { - $gapicClient->stopScanRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateScanConfigTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $maxQps = 844445913; - $expectedResponse = new ScanConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setMaxQps($maxQps); - $transport->addResponse($expectedResponse); - // Mock request - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - $updateMask = new FieldMask(); - $response = $gapicClient->updateScanConfig($scanConfig, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/UpdateScanConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getScanConfig(); - $this->assertProtobufEquals($scanConfig, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateScanConfigExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $scanConfig = new ScanConfig(); - $scanConfigDisplayName = 'scanConfigDisplayName-609132338'; - $scanConfig->setDisplayName($scanConfigDisplayName); - $scanConfigStartingUrls = []; - $scanConfig->setStartingUrls($scanConfigStartingUrls); - $updateMask = new FieldMask(); - try { - $gapicClient->updateScanConfig($scanConfig, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}