# Google Cloud Web Security Scanner V1 Client - Class ScanRun (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 ScanRun.

A ScanRun is a output-only resource representing an actual run of the scan.

Next id: 12

Generated from protobuf message `google.cloud.websecurityscanner.v1.ScanRun`

## Namespace

Google \\ Cloud \\ WebSecurityScanner \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. 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. |
| `↳ execution_state` | `int` Output only. The execution state of the ScanRun. |
| `↳ result_state` | `int` Output only. The result state of the ScanRun. This field is only available after the execution state reaches "FINISHED". |
| `↳ start_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time at which the ScanRun started. |
| `↳ end_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time at which the ScanRun reached termination state - that the ScanRun is either finished or stopped by user. |
| `↳ urls_crawled_count` | `int|string` 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. |
| `↳ urls_tested_count` | `int|string` 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 URLs tested is usually larger than the number URLS crawled because typically a crawled URL is tested with multiple test payloads. |
| `↳ has_vulnerabilities` | `bool` Output only. Whether the scan run has found any vulnerabilities. |
| `↳ progress_percent` | `int` Output only. 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. |
| `↳ error_trace` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRunErrorTrace` 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. |
| `↳ warning_traces` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRunWarningTrace>` Output only. A list of warnings, if such are encountered during this scan run. |

### getName

Output only. 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Output only. 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getExecutionState

Output only. The execution state of the ScanRun.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ExecutionState](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun.ExecutionState). |

### setExecutionState

Output only. The execution state of the ScanRun.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ExecutionState](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun.ExecutionState). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResultState

Output only. The result state of the ScanRun. This field is only available after the
execution state reaches "FINISHED".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ResultState](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun.ResultState). |

### setResultState

Output only. The result state of the ScanRun. This field is only available after the
execution state reaches "FINISHED".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ResultState](https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRun.ResultState). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStartTime

Output only. The time at which the ScanRun started.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasStartTime

### clearStartTime

### setStartTime

Output only. The time at which the ScanRun started.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEndTime

Output only. The time at which the ScanRun reached termination state - that the ScanRun
is either finished or stopped by user.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasEndTime

### clearEndTime

### setEndTime

Output only. The time at which the ScanRun reached termination state - that the ScanRun
is either finished or stopped by user.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUrlsCrawledCount

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setUrlsCrawledCount

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUrlsTestedCount

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
URLs tested is usually larger than the number URLS crawled because
typically a crawled URL is tested with multiple test payloads.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setUrlsTestedCount

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
URLs tested is usually larger than the number URLS crawled because
typically a crawled URL is tested with multiple test payloads.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getHasVulnerabilities

Output only. Whether the scan run has found any vulnerabilities.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setHasVulnerabilities

Output only. Whether the scan run has found any vulnerabilities.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProgressPercent

Output only. 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setProgressPercent

Output only. 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getErrorTrace

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.

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

### hasErrorTrace

### clearErrorTrace

### setErrorTrace

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRunErrorTrace` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getWarningTraces

Output only. A list of warnings, if such are encountered during this scan run.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRunWarningTrace>` |   |

### setWarningTraces

Output only. A list of warnings, if such are encountered during this scan run.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-web-security-scanner/latest/V1.ScanRunWarningTrace>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |