# Google API Common Protos Client - Class AuditContext (4.14.0)

4.14.0 (latest) 4.13.0 4.12.5 4.11.0 4.10.0 4.9.0 4.8.3 Reference documentation and code samples for the Google API Common Protos Client class AuditContext.

`AuditContext` provides information that is needed for audit logging.

Generated from protobuf message `google.rpc.context.AuditContext`

## Namespace

Google \\ Rpc \\ Context

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ audit_log` | `string` Serialized audit log. |
| `↳ scrubbed_request` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` An API request message that is scrubbed based on the method annotation. This field should only be filled if audit_log field is present. Service Control will use this to assemble a complete log for Cloud Audit Logs and Google internal audit logs. |
| `↳ scrubbed_response` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` An API response message that is scrubbed based on the method annotation. This field should only be filled if audit_log field is present. Service Control will use this to assemble a complete log for Cloud Audit Logs and Google internal audit logs. |
| `↳ scrubbed_response_item_count` | `int` Number of scrubbed response items. |
| `↳ target_resource` | `string` Audit resource name which is scrubbed. |

### getAuditLog

Serialized audit log.

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

### setAuditLog

Serialized audit log.

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

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

### getScrubbedRequest

An API request message that is scrubbed based on the method annotation.

This field should only be filled if audit_log field is present.
Service Control will use this to assemble a complete log for Cloud Audit
Logs and Google internal audit logs.

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

### hasScrubbedRequest

### clearScrubbedRequest

### setScrubbedRequest

An API request message that is scrubbed based on the method annotation.

This field should only be filled if audit_log field is present.
Service Control will use this to assemble a complete log for Cloud Audit
Logs and Google internal audit logs.

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

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

### getScrubbedResponse

An API response message that is scrubbed based on the method annotation.

This field should only be filled if audit_log field is present.
Service Control will use this to assemble a complete log for Cloud Audit
Logs and Google internal audit logs.

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

### hasScrubbedResponse

### clearScrubbedResponse

### setScrubbedResponse

An API response message that is scrubbed based on the method annotation.

This field should only be filled if audit_log field is present.
Service Control will use this to assemble a complete log for Cloud Audit
Logs and Google internal audit logs.

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

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

### getScrubbedResponseItemCount

Number of scrubbed response items.

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

### setScrubbedResponseItemCount

Number of scrubbed response items.

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

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

### getTargetResource

Audit resource name which is scrubbed.

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

### setTargetResource

Audit resource name which is scrubbed.

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

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