# Stackdriver Error Reporting V1beta1 Client - Class SourceLocation (0.26.1)

0.26.1 (latest) 0.26.0 0.25.3 0.24.0 0.23.1 0.22.10 0.21.1 0.20.2 0.19.12

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class SourceLocation.

Indicates a location in the source code of the service for which errors are
reported. `functionName` must be provided by the application when reporting
an error, unless the error report contains a `message` with a supported
exception stack trace. All fields are optional for the later case.

Generated from protobuf message `google.devtools.clouderrorreporting.v1beta1.SourceLocation`

## Namespace

Google \\ Cloud \\ ErrorReporting \\ V1beta1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ file_path` | `string` The source code filename, which can include a truncated relative path, or a full path from a production machine. |
| `↳ line_number` | `int` 1-based. 0 indicates that the line number is unknown. |
| `↳ function_name` | `string` Human-readable name of a function or method. The value can include optional context like the class or package name. For example, `my.package.MyClass.method` in case of Java. |

### getFilePath

The source code filename, which can include a truncated relative
path, or a full path from a production machine.

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

### setFilePath

The source code filename, which can include a truncated relative
path, or a full path from a production machine.

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

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

### getLineNumber

1-based. 0 indicates that the line number is unknown.

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

### setLineNumber

1-based. 0 indicates that the line number is unknown.

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

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

### getFunctionName

Human-readable name of a function or method.

The value can include optional context like the class or package name.
For example, `my.package.MyClass.method` in case of Java.

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

### setFunctionName

Human-readable name of a function or method.

The value can include optional context like the class or package name.
For example, `my.package.MyClass.method` in case of Java.

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

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