# Stackdriver Logging V2 Client - Class CreateSinkRequest (2.1.0)

2.1.0 (latest) 2.0.0 1.34.5 1.33.0 1.32.3 1.31.3 1.30.3 1.29.0 1.28.5 1.27.1 1.26.0 1.25.5 1.24.10 Reference documentation and code samples for the Stackdriver Logging V2 Client class CreateSinkRequest.

The parameters to `CreateSink`.

Generated from protobuf message `google.logging.v2.CreateSinkRequest`

## Namespace

Google \\ Cloud \\ Logging \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The resource in which to create the sink: "projects/\[PROJECT_ID\]" "organizations/\[ORGANIZATION_ID\]" "billingAccounts/\[BILLING_ACCOUNT_ID\]" "folders/\[FOLDER_ID\]" For examples: `"projects/my-project"` `"organizations/123456789"` |
| `↳ sink` | `https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink` Required. The new sink, whose `name` parameter is a sink identifier that is not already in use. |
| `↳ unique_writer_identity` | `bool` Optional. Determines the kind of IAM identity returned as `writer_identity` in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as `writer_identity` is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself. If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of `writer_identity` will be a unique service account used only for exports from the new sink. For more information, see `writer_identity` in [LogSink](https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink). |

### getParent

Required. The resource in which to create the sink:
"projects/\[PROJECT_ID\]"
"organizations/\[ORGANIZATION_ID\]"
"billingAccounts/\[BILLING_ACCOUNT_ID\]"
"folders/\[FOLDER_ID\]"
For examples:
`"projects/my-project"`
`"organizations/123456789"`

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

### setParent

Required. The resource in which to create the sink:
"projects/\[PROJECT_ID\]"
"organizations/\[ORGANIZATION_ID\]"
"billingAccounts/\[BILLING_ACCOUNT_ID\]"
"folders/\[FOLDER_ID\]"
For examples:
`"projects/my-project"`
`"organizations/123456789"`

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

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

### getSink

Required. The new sink, whose `name` parameter is a sink identifier that
is not already in use.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink|null` |   |

### hasSink

### clearSink

### setSink

Required. The new sink, whose `name` parameter is a sink identifier that
is not already in use.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink` |

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

### getUniqueWriterIdentity

Optional. Determines the kind of IAM identity returned as `writer_identity`
in the new sink. If this value is omitted or set to false, and if the
sink's parent is a project, then the value returned as `writer_identity` is
the same group or service account used by Cloud Logging before the addition
of writer identities to this API. The sink's destination must be in the
same project as the sink itself.

If this field is set to true, or if the sink is owned by a non-project
resource such as an organization, then the value of `writer_identity` will
be a unique service account used only for exports from the new sink. For
more information, see `writer_identity` in
[LogSink](https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink).

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

### setUniqueWriterIdentity

Optional. Determines the kind of IAM identity returned as `writer_identity`
in the new sink. If this value is omitted or set to false, and if the
sink's parent is a project, then the value returned as `writer_identity` is
the same group or service account used by Cloud Logging before the addition
of writer identities to this API. The sink's destination must be in the
same project as the sink itself.

If this field is set to true, or if the sink is owned by a non-project
resource such as an organization, then the value of `writer_identity` will
be a unique service account used only for exports from the new sink. For
more information, see `writer_identity` in
[LogSink](https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink).

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The resource in which to create the sink: "projects/\[PROJECT_ID\]" "organizations/\[ORGANIZATION_ID\]" "billingAccounts/\[BILLING_ACCOUNT_ID\]" "folders/\[FOLDER_ID\]" For examples: `"projects/my-project"` `"organizations/123456789"` Please see ConfigServiceV2Client::projectName() for help formatting this field. |
| `sink` | `https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogSink` Required. The new sink, whose `name` parameter is a sink identifier that is not already in use. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.CreateSinkRequest` |   |