## Update Bucket

`client.Storage.Buckets.Update(ctx, bucketID, body) (*Bucket, error)`

**patch** `/v1/storage/buckets/{bucket_id}`

Update a Bucket's tags. A Bucket's name is its S3 name and cannot be changed.

### Parameters

- `bucketID string`

- `body BucketUpdateParams`

  - `Tags param.Field[[]string]`

    Tags to attach to the Bucket.

### Returns

- `type Bucket struct{…}`

  Bucket details.

  - `ID string`

    Unique identifier for the Bucket.

  - `CreatedAt Time`

    When the Bucket was created.

  - `Endpoint string`

    S3 endpoint of the Bucket's region. Point S3 clients at it, with an Object
    Storage Key of the same project and region.

  - `Name string`

    Name of the Bucket, used to address it over S3.

  - `ObjectCount int64`

    Number of objects in the Bucket. Updated periodically, so it can lag behind
    recent writes.

  - `ProjectID string`

    Project ID the Bucket belongs to.

  - `Region RegionName`

    Region the resource is in.

    - `const RegionNameUsSva2 RegionName = "us-sva-2"`

    - `const RegionNameUsWdc1 RegionName = "us-wdc-1"`

  - `SigningRegion string`

    Region S3 clients must sign their requests for (the SigV4 region). Configure
    it as the region of any S3 client or SDK used with the Bucket.

  - `SizeBytes int64`

    Total size of the objects in the Bucket, in bytes. Updated periodically,
    so it can lag behind recent writes.

  - `Status ResourceStatus`

    Status of the resource.

    - `const ResourceStatusPending ResourceStatus = "pending"`

    - `const ResourceStatusCreating ResourceStatus = "creating"`

    - `const ResourceStatusUpdating ResourceStatus = "updating"`

    - `const ResourceStatusReady ResourceStatus = "ready"`

    - `const ResourceStatusDeleting ResourceStatus = "deleting"`

    - `const ResourceStatusDeleted ResourceStatus = "deleted"`

    - `const ResourceStatusError ResourceStatus = "error"`

    - `const ResourceStatusSuspended ResourceStatus = "suspended"`

  - `Tags []string`

    Tags attached to the Bucket.

  - `UpdatedAt Time`

    When the Bucket was updated.

  - `URL string`

    Path-style URL of the Bucket.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
  "github.com/nirvana-labs/nirvana-go/storage"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  bucket, err := client.Storage.Buckets.Update(
    context.TODO(),
    "bucket_id",
    storage.BucketUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", bucket.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "endpoint": "https://s3.sva2.nirvanacloud.io",
  "name": "my-bucket",
  "object_count": 1024,
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "region": "us-sva-2",
  "signing_region": "us-east-1",
  "size_bytes": 1073741824,
  "status": "ready",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z",
  "url": "https://s3.sva2.nirvanacloud.io/my-bucket"
}
```
