# Stackdriver Logging V2 Client - Class CreateBucketRequest (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 CreateBucketRequest.

The parameters to `CreateBucket`.

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

## 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 log bucket: "projects/\[PROJECT_ID\]/locations/\[LOCATION_ID\]" For example: `"projects/my-project/locations/global"` |
| `↳ bucket_id` | `string` Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. |
| `↳ bucket` | `https://docs.cloud.google.com/php/docs/reference/cloud-logging/latest/V2.LogBucket` Required. The new bucket. The region specified in the new bucket must be compliant with any Location Restriction Org Policy. The name field in the bucket is ignored. |

### getParent

Required. The resource in which to create the log bucket:
"projects/\[PROJECT_ID\]/locations/\[LOCATION_ID\]"
For example:
`"projects/my-project/locations/global"`

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

### setParent

Required. The resource in which to create the log bucket:
"projects/\[PROJECT_ID\]/locations/\[LOCATION_ID\]"
For example:
`"projects/my-project/locations/global"`

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

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

### getBucketId

Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
are limited to 100 characters and can include only letters, digits,
underscores, hyphens, and periods.

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

### setBucketId

Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
are limited to 100 characters and can include only letters, digits,
underscores, hyphens, and periods.

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

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

### getBucket

Required. The new bucket. The region specified in the new bucket must be
compliant with any Location Restriction Org Policy. The name field in the
bucket is ignored.

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

### hasBucket

### clearBucket

### setBucket

Required. The new bucket. The region specified in the new bucket must be
compliant with any Location Restriction Org Policy. The name field in the
bucket is ignored.

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

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