# Google Cloud Web Security Scanner V1 Client - Class WebSecurityScannerClient (1.2.0)

1.2.0 (latest) 1.1.2 1.0.5 0.8.5 0.7.18 Reference documentation and code samples for the Google Cloud Web Security Scanner V1 Client class WebSecurityScannerClient.

Service Description: Web Security Scanner Service identifies security vulnerabilities in web
applications hosted on Google Cloud. It crawls your application, and
attempts to exercise as many user inputs and event handlers as possible.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.

## Namespace

Google \\ Cloud \\ WebSecurityScanner \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\WebSecurityScanner\V1\WebSecurityScannerClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new WebSecurityScannerClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ credentialsConfig` | `array` Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see [Google\\ApiCore\\CredentialsWrapper::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_Google_ApiCore_CredentialsWrapper__build__) . |
| `↳ disableRetries` | `bool` Determines whether or not retries defined by the client configuration should be disabled. Defaults to `false`. |
| `↳ clientConfig` | `string|array` 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. |
| `↳ transport` | `string|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` 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 [Google\\ApiCore\\Transport\\TransportInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored. |
| `↳ transportConfig` | `array` 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 [Google\\ApiCore\\Transport\\GrpcTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) methods for the supported options. |
| `↳ clientCertSource` | `callable` 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. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### createScanConfig

Creates a new ScanConfig.

The async variant is [WebSecurityScannerClient::createScanConfigAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__createScanConfigAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.CreateScanConfigRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanConfig` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\CreateScanConfigRequest;
    use Google\Cloud\WebSecurityScanner\V1\ScanConfig;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function create_scan_config_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new CreateScanConfigRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ScanConfig $response */
            $response = $webSecurityScannerClient->createScanConfig($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### deleteScanConfig

Deletes an existing ScanConfig and its child resources.

The async variant is [WebSecurityScannerClient::deleteScanConfigAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__deleteScanConfigAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.DeleteScanConfigRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\DeleteScanConfigRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function delete_scan_config_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new DeleteScanConfigRequest();

        // Call the API and handle any network failures.
        try {
            $webSecurityScannerClient->deleteScanConfig($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### getFinding

Gets a Finding.

The async variant is [WebSecurityScannerClient::getFindingAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__getFindingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.GetFindingRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Finding` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\Finding;
    use Google\Cloud\WebSecurityScanner\V1\GetFindingRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function get_finding_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new GetFindingRequest();

        // Call the API and handle any network failures.
        try {
            /** @var Finding $response */
            $response = $webSecurityScannerClient->getFinding($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### getScanConfig

Gets a ScanConfig.

The async variant is [WebSecurityScannerClient::getScanConfigAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__getScanConfigAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.GetScanConfigRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanConfig` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\GetScanConfigRequest;
    use Google\Cloud\WebSecurityScanner\V1\ScanConfig;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function get_scan_config_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new GetScanConfigRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ScanConfig $response */
            $response = $webSecurityScannerClient->getScanConfig($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### getScanRun

Gets a ScanRun.

The async variant is [WebSecurityScannerClient::getScanRunAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__getScanRunAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.GetScanRunRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\GetScanRunRequest;
    use Google\Cloud\WebSecurityScanner\V1\ScanRun;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function get_scan_run_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new GetScanRunRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ScanRun $response */
            $response = $webSecurityScannerClient->getScanRun($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### listCrawledUrls

List CrawledUrls under a given ScanRun.

The async variant is [WebSecurityScannerClient::listCrawledUrlsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__listCrawledUrlsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListCrawledUrlsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\CrawledUrl;
    use Google\Cloud\WebSecurityScanner\V1\ListCrawledUrlsRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function list_crawled_urls_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new ListCrawledUrlsRequest();

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $webSecurityScannerClient->listCrawledUrls($request);

            /** @var CrawledUrl $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### listFindingTypeStats

List all FindingTypeStats under a given ScanRun.

The async variant is
[WebSecurityScannerClient::listFindingTypeStatsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__listFindingTypeStatsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListFindingTypeStatsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListFindingTypeStatsResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsRequest;
    use Google\Cloud\WebSecurityScanner\V1\ListFindingTypeStatsResponse;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function list_finding_type_stats_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new ListFindingTypeStatsRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ListFindingTypeStatsResponse $response */
            $response = $webSecurityScannerClient->listFindingTypeStats($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### listFindings

List Findings under a given ScanRun.

The async variant is [WebSecurityScannerClient::listFindingsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__listFindingsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListFindingsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\Finding;
    use Google\Cloud\WebSecurityScanner\V1\ListFindingsRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function list_findings_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new ListFindingsRequest();

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $webSecurityScannerClient->listFindings($request);

            /** @var Finding $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### listScanConfigs

Lists ScanConfigs under a given project.

The async variant is [WebSecurityScannerClient::listScanConfigsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__listScanConfigsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListScanConfigsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\ListScanConfigsRequest;
    use Google\Cloud\WebSecurityScanner\V1\ScanConfig;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function list_scan_configs_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new ListScanConfigsRequest();

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $webSecurityScannerClient->listScanConfigs($request);

            /** @var ScanConfig $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### listScanRuns

Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
stop time.

The async variant is [WebSecurityScannerClient::listScanRunsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__listScanRunsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListScanRunsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\ListScanRunsRequest;
    use Google\Cloud\WebSecurityScanner\V1\ScanRun;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function list_scan_runs_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new ListScanRunsRequest();

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $webSecurityScannerClient->listScanRuns($request);

            /** @var ScanRun $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### startScanRun

Start a ScanRun according to the given ScanConfig.

The async variant is [WebSecurityScannerClient::startScanRunAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__startScanRunAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.StartScanRunRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\ScanRun;
    use Google\Cloud\WebSecurityScanner\V1\StartScanRunRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function start_scan_run_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new StartScanRunRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ScanRun $response */
            $response = $webSecurityScannerClient->startScanRun($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### stopScanRun

Stops a ScanRun. The stopped ScanRun is returned.

The async variant is [WebSecurityScannerClient::stopScanRunAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__stopScanRunAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.StopScanRunRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\ScanRun;
    use Google\Cloud\WebSecurityScanner\V1\StopScanRunRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function stop_scan_run_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new StopScanRunRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ScanRun $response */
            $response = $webSecurityScannerClient->stopScanRun($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### updateScanConfig

Updates a ScanConfig. This method support partial update of a ScanConfig.

The async variant is [WebSecurityScannerClient::updateScanConfigAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Client.WebSecurityScannerClient#_Google_Cloud_WebSecurityScanner_V1_Client_WebSecurityScannerClient__updateScanConfigAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.UpdateScanConfigRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanConfig` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\WebSecurityScanner\V1\Client\WebSecurityScannerClient;
    use Google\Cloud\WebSecurityScanner\V1\ScanConfig;
    use Google\Cloud\WebSecurityScanner\V1\UpdateScanConfigRequest;

    /**
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_scan_config_sample(): void
    {
        // Create a client.
        $webSecurityScannerClient = new WebSecurityScannerClient();

        // Prepare the request message.
        $request = new UpdateScanConfigRequest();

        // Call the API and handle any network failures.
        try {
            /** @var ScanConfig $response */
            $response = $webSecurityScannerClient->updateScanConfig($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### createScanConfigAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.CreateScanConfigRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanConfig>` |   |

### deleteScanConfigAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.DeleteScanConfigRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### getFindingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.GetFindingRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.Finding>` |   |

### getScanConfigAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.GetScanConfigRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanConfig>` |   |

### getScanRunAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.GetScanRunRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun>` |   |

### listCrawledUrlsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListCrawledUrlsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listFindingTypeStatsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListFindingTypeStatsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListFindingTypeStatsResponse>` |   |

### listFindingsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListFindingsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listScanConfigsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListScanConfigsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listScanRunsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ListScanRunsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### startScanRunAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.StartScanRunRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun>` |   |

### stopScanRunAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.StopScanRunRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun>` |   |

### updateScanConfigAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.UpdateScanConfigRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanConfig>` |   |