# Networking

# VPCs

## Create VPC

`client.Networking.VPCs.New(ctx, body) (*Operation, error)`

**post** `/v1/networking/vpcs`

Create a VPC

### Parameters

- `body VPCNewParams`

  - `Name param.Field[string]`

    Name of the VPC.

  - `ProjectID param.Field[string]`

    Project ID the VPC belongs to.

  - `Region param.Field[RegionName]`

    Region the resource is in.

  - `SubnetName param.Field[string]`

    Name of the subnet to create.

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

    Tags to attach to the VPC.

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/networking"
  "github.com/nirvana-labs/nirvana-go/option"
  "github.com/nirvana-labs/nirvana-go/shared"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.VPCs.New(context.TODO(), networking.VPCNewParams{
    Name: "my-vpc",
    ProjectID: "123e4567-e89b-12d3-a456-426614174000",
    Region: shared.RegionNameUsSva2,
    SubnetName: "my-subnet",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", operation.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Get VPC Details

`client.Networking.VPCs.Get(ctx, vpcID) (*VPC, error)`

**get** `/v1/networking/vpcs/{vpc_id}`

Get details about a VPC

### Parameters

- `vpcID string`

### Returns

- `type VPC struct{…}`

  VPC details.

  - `ID string`

    Unique identifier for the VPC.

  - `CreatedAt Time`

    When the VPC was created.

  - `FirewallRuleIDs []string`

    IDs of the Firewall Rules associated with the VPC.

  - `Name string`

    Name of the VPC.

  - `ProjectID string`

    Project ID the VPC belongs to.

  - `Region RegionName`

    Region the resource is in.

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

  - `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"`

  - `Subnet Subnet`

    Subnet of the VPC.

    - `ID string`

      Unique identifier for the Subnet.

    - `CIDR string`

      CIDR block for the Subnet.

    - `CreatedAt Time`

      When the Subnet was created.

    - `Name string`

      Name of the Subnet.

    - `UpdatedAt Time`

      When the Subnet was updated.

  - `Tags []string`

    Tags to attach to the VPC.

  - `UpdatedAt Time`

    When the VPC was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  vpc, err := client.Networking.VPCs.Get(context.TODO(), "vpc_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vpc.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "firewall_rule_ids": [
    "123e4567-e89b-12d3-a456-426614174001",
    "123e4567-e89b-12d3-a456-426614174002"
  ],
  "name": "my-vpc",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "region": "us-sva-2",
  "status": "ready",
  "subnet": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "cidr": "10.128.35.128/25",
    "created_at": "2025-01-01T00:00:00Z",
    "name": "my-subnet",
    "updated_at": "2025-01-01T00:00:00Z"
  },
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Update VPC

`client.Networking.VPCs.Update(ctx, vpcID, body) (*Operation, error)`

**patch** `/v1/networking/vpcs/{vpc_id}`

Update a VPC

### Parameters

- `vpcID string`

- `body VPCUpdateParams`

  - `Name param.Field[string]`

    Name of the VPC.

  - `SubnetName param.Field[string]`

    Name of the subnet to create.

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

    Tags to attach to the VPC.

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.VPCs.Update(
    context.TODO(),
    "vpc_id",
    networking.VPCUpdateParams{

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

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete VPC

`client.Networking.VPCs.Delete(ctx, vpcID) (*Operation, error)`

**delete** `/v1/networking/vpcs/{vpc_id}`

Delete a VPC

### Parameters

- `vpcID string`

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.VPCs.Delete(context.TODO(), "vpc_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", operation.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## List VPCs

`client.Networking.VPCs.List(ctx, query) (*Cursor[VPC], error)`

**get** `/v1/networking/vpcs`

List all VPCs

### Parameters

- `query VPCListParams`

  - `ProjectID param.Field[string]`

    Project ID of resources to request

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type VPC struct{…}`

  VPC details.

  - `ID string`

    Unique identifier for the VPC.

  - `CreatedAt Time`

    When the VPC was created.

  - `FirewallRuleIDs []string`

    IDs of the Firewall Rules associated with the VPC.

  - `Name string`

    Name of the VPC.

  - `ProjectID string`

    Project ID the VPC belongs to.

  - `Region RegionName`

    Region the resource is in.

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

  - `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"`

  - `Subnet Subnet`

    Subnet of the VPC.

    - `ID string`

      Unique identifier for the Subnet.

    - `CIDR string`

      CIDR block for the Subnet.

    - `CreatedAt Time`

      When the Subnet was created.

    - `Name string`

      Name of the Subnet.

    - `UpdatedAt Time`

      When the Subnet was updated.

  - `Tags []string`

    Tags to attach to the VPC.

  - `UpdatedAt Time`

    When the VPC was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Networking.VPCs.List(context.TODO(), networking.VPCListParams{
    ProjectID: "project_id",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "firewall_rule_ids": [
        "123e4567-e89b-12d3-a456-426614174001",
        "123e4567-e89b-12d3-a456-426614174002"
      ],
      "name": "my-vpc",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "us-sva-2",
      "status": "ready",
      "subnet": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "cidr": "10.128.35.128/25",
        "created_at": "2025-01-01T00:00:00Z",
        "name": "my-subnet",
        "updated_at": "2025-01-01T00:00:00Z"
      },
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Domain Types

### Subnet

- `type Subnet struct{…}`

  Subnet of the VPC.

  - `ID string`

    Unique identifier for the Subnet.

  - `CIDR string`

    CIDR block for the Subnet.

  - `CreatedAt Time`

    When the Subnet was created.

  - `Name string`

    Name of the Subnet.

  - `UpdatedAt Time`

    When the Subnet was updated.

### VPC

- `type VPC struct{…}`

  VPC details.

  - `ID string`

    Unique identifier for the VPC.

  - `CreatedAt Time`

    When the VPC was created.

  - `FirewallRuleIDs []string`

    IDs of the Firewall Rules associated with the VPC.

  - `Name string`

    Name of the VPC.

  - `ProjectID string`

    Project ID the VPC belongs to.

  - `Region RegionName`

    Region the resource is in.

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

  - `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"`

  - `Subnet Subnet`

    Subnet of the VPC.

    - `ID string`

      Unique identifier for the Subnet.

    - `CIDR string`

      CIDR block for the Subnet.

    - `CreatedAt Time`

      When the Subnet was created.

    - `Name string`

      Name of the Subnet.

    - `UpdatedAt Time`

      When the Subnet was updated.

  - `Tags []string`

    Tags to attach to the VPC.

  - `UpdatedAt Time`

    When the VPC was updated.

### VPC List

- `type VPCList struct{…}`

  - `Items []VPC`

    - `ID string`

      Unique identifier for the VPC.

    - `CreatedAt Time`

      When the VPC was created.

    - `FirewallRuleIDs []string`

      IDs of the Firewall Rules associated with the VPC.

    - `Name string`

      Name of the VPC.

    - `ProjectID string`

      Project ID the VPC belongs to.

    - `Region RegionName`

      Region the resource is in.

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

    - `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"`

    - `Subnet Subnet`

      Subnet of the VPC.

      - `ID string`

        Unique identifier for the Subnet.

      - `CIDR string`

        CIDR block for the Subnet.

      - `CreatedAt Time`

        When the Subnet was created.

      - `Name string`

        Name of the Subnet.

      - `UpdatedAt Time`

        When the Subnet was updated.

    - `Tags []string`

      Tags to attach to the VPC.

    - `UpdatedAt Time`

      When the VPC was updated.

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

# Availability

## Check Create VPC Availability

`client.Networking.VPCs.Availability.New(ctx, body) error`

**post** `/v1/networking/vpcs/availability`

Check if a VPC can be created

### Parameters

- `body VPCAvailabilityNewParams`

  - `Name param.Field[string]`

    Name of the VPC.

  - `ProjectID param.Field[string]`

    Project ID the VPC belongs to.

  - `Region param.Field[RegionName]`

    Region the resource is in.

  - `SubnetName param.Field[string]`

    Name of the subnet to create.

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

    Tags to attach to the VPC.

### Example

```go
package main

import (
  "context"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/networking"
  "github.com/nirvana-labs/nirvana-go/option"
  "github.com/nirvana-labs/nirvana-go/shared"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  err := client.Networking.VPCs.Availability.New(context.TODO(), networking.VPCAvailabilityNewParams{
    Name: "my-vpc",
    ProjectID: "123e4567-e89b-12d3-a456-426614174000",
    Region: shared.RegionNameUsSva2,
    SubnetName: "my-subnet",
  })
  if err != nil {
    panic(err.Error())
  }
}
```

## Check Update VPC Availability

`client.Networking.VPCs.Availability.Update(ctx, vpcID, body) error`

**patch** `/v1/networking/vpcs/{vpc_id}/availability`

Check if a VPC can be updated

### Parameters

- `vpcID string`

- `body VPCAvailabilityUpdateParams`

  - `Name param.Field[string]`

    Name of the VPC.

  - `SubnetName param.Field[string]`

    Name of the subnet to create.

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

    Tags to attach to the VPC.

### Example

```go
package main

import (
  "context"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  err := client.Networking.VPCs.Availability.Update(
    context.TODO(),
    "vpc_id",
    networking.VPCAvailabilityUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
}
```

# Firewall Rules

## Create Firewall Rule

`client.Networking.FirewallRules.New(ctx, vpcID, body) (*Operation, error)`

**post** `/v1/networking/vpcs/{vpc_id}/firewall_rules`

Create a firewall rule

### Parameters

- `vpcID string`

- `body FirewallRuleNewParams`

  - `DestinationAddress param.Field[string]`

    Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC. Must be in network-aligned/canonical form.

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

    Destination ports of the Firewall Rule.

  - `Name param.Field[string]`

    Name of the Firewall Rule.

  - `Protocol param.Field[FirewallRuleNewParamsProtocol]`

    Protocol of the Firewall Rule.

    - `const FirewallRuleNewParamsProtocolTcp FirewallRuleNewParamsProtocol = "tcp"`

    - `const FirewallRuleNewParamsProtocolUdp FirewallRuleNewParamsProtocol = "udp"`

  - `SourceAddress param.Field[string]`

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0. Must be in network-aligned/canonical form.

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

    Tags to attach to the Firewall Rule.

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.FirewallRules.New(
    context.TODO(),
    "vpc_id",
    networking.FirewallRuleNewParams{
      DestinationAddress: "10.0.0.0/25",
      DestinationPorts: []string{"22", "80", "443"},
      Name: "my-firewall-rule",
      Protocol: networking.FirewallRuleNewParamsProtocolTcp,
      SourceAddress: "0.0.0.0/0",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", operation.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Firewall Rule Details

`client.Networking.FirewallRules.Get(ctx, vpcID, firewallRuleID) (*FirewallRule, error)`

**get** `/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}`

Get details about a firewall rule

### Parameters

- `vpcID string`

- `firewallRuleID string`

### Returns

- `type FirewallRule struct{…}`

  Firewall rule details.

  - `ID string`

    Unique identifier for the Firewall Rule.

  - `CreatedAt Time`

    When the Firewall Rule was created.

  - `DestinationAddress string`

    Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.

  - `DestinationPorts []string`

    Destination ports of the Firewall Rule.

  - `Name string`

    Name of the Firewall Rule.

  - `Protocol FirewallRuleProtocol`

    Protocol of the Firewall Rule.

    - `const FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"`

    - `const FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"`

  - `SourceAddress string`

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0.

  - `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"`

  - `Tags []string`

    Tags to attach to the Firewall Rule.

  - `UpdatedAt Time`

    When the Firewall Rule was updated.

  - `VPCID string`

    ID of the VPC the Firewall Rule belongs to.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  firewallRule, err := client.Networking.FirewallRules.Get(
    context.TODO(),
    "vpc_id",
    "firewall_rule_id",
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", firewallRule.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "destination_address": "10.0.0.0/25",
  "destination_ports": [
    "22",
    "80",
    "443"
  ],
  "name": "my-firewall-rule",
  "protocol": "tcp",
  "source_address": "0.0.0.0/0",
  "status": "ready",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z",
  "vpc_id": "123e4567-e89b-12d3-a456-426614174000"
}
```

## Update Firewall Rule

`client.Networking.FirewallRules.Update(ctx, vpcID, firewallRuleID, body) (*Operation, error)`

**patch** `/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}`

Update a firewall rule

### Parameters

- `vpcID string`

- `firewallRuleID string`

- `body FirewallRuleUpdateParams`

  - `DestinationAddress param.Field[string]`

    Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC. Must be in network-aligned/canonical form.

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

    Destination ports of the Firewall Rule.

  - `Name param.Field[string]`

    Name of the Firewall Rule.

  - `Protocol param.Field[FirewallRuleUpdateParamsProtocol]`

    Protocol of the Firewall Rule.

    - `const FirewallRuleUpdateParamsProtocolTcp FirewallRuleUpdateParamsProtocol = "tcp"`

    - `const FirewallRuleUpdateParamsProtocolUdp FirewallRuleUpdateParamsProtocol = "udp"`

  - `SourceAddress param.Field[string]`

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0. Must be in network-aligned/canonical form.

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

    Tags to attach to the Firewall Rule.

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.FirewallRules.Update(
    context.TODO(),
    "vpc_id",
    "firewall_rule_id",
    networking.FirewallRuleUpdateParams{

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

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete Firewall Rule

`client.Networking.FirewallRules.Delete(ctx, vpcID, firewallRuleID) (*Operation, error)`

**delete** `/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}`

Delete a firewall rule

### Parameters

- `vpcID string`

- `firewallRuleID string`

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.FirewallRules.Delete(
    context.TODO(),
    "vpc_id",
    "firewall_rule_id",
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", operation.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## List Firewall Rules

`client.Networking.FirewallRules.List(ctx, vpcID, query) (*Cursor[FirewallRule], error)`

**get** `/v1/networking/vpcs/{vpc_id}/firewall_rules`

List all firewall rules

### Parameters

- `vpcID string`

- `query FirewallRuleListParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type FirewallRule struct{…}`

  Firewall rule details.

  - `ID string`

    Unique identifier for the Firewall Rule.

  - `CreatedAt Time`

    When the Firewall Rule was created.

  - `DestinationAddress string`

    Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.

  - `DestinationPorts []string`

    Destination ports of the Firewall Rule.

  - `Name string`

    Name of the Firewall Rule.

  - `Protocol FirewallRuleProtocol`

    Protocol of the Firewall Rule.

    - `const FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"`

    - `const FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"`

  - `SourceAddress string`

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0.

  - `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"`

  - `Tags []string`

    Tags to attach to the Firewall Rule.

  - `UpdatedAt Time`

    When the Firewall Rule was updated.

  - `VPCID string`

    ID of the VPC the Firewall Rule belongs to.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Networking.FirewallRules.List(
    context.TODO(),
    "vpc_id",
    networking.FirewallRuleListParams{

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

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "destination_address": "10.0.0.0/25",
      "destination_ports": [
        "22",
        "80",
        "443"
      ],
      "name": "my-firewall-rule",
      "protocol": "tcp",
      "source_address": "0.0.0.0/0",
      "status": "ready",
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z",
      "vpc_id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Domain Types

### Firewall Rule

- `type FirewallRule struct{…}`

  Firewall rule details.

  - `ID string`

    Unique identifier for the Firewall Rule.

  - `CreatedAt Time`

    When the Firewall Rule was created.

  - `DestinationAddress string`

    Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.

  - `DestinationPorts []string`

    Destination ports of the Firewall Rule.

  - `Name string`

    Name of the Firewall Rule.

  - `Protocol FirewallRuleProtocol`

    Protocol of the Firewall Rule.

    - `const FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"`

    - `const FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"`

  - `SourceAddress string`

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0.

  - `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"`

  - `Tags []string`

    Tags to attach to the Firewall Rule.

  - `UpdatedAt Time`

    When the Firewall Rule was updated.

  - `VPCID string`

    ID of the VPC the Firewall Rule belongs to.

### Firewall Rule List

- `type FirewallRuleList struct{…}`

  - `Items []FirewallRule`

    - `ID string`

      Unique identifier for the Firewall Rule.

    - `CreatedAt Time`

      When the Firewall Rule was created.

    - `DestinationAddress string`

      Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.

    - `DestinationPorts []string`

      Destination ports of the Firewall Rule.

    - `Name string`

      Name of the Firewall Rule.

    - `Protocol FirewallRuleProtocol`

      Protocol of the Firewall Rule.

      - `const FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"`

      - `const FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"`

    - `SourceAddress string`

      Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0.

    - `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"`

    - `Tags []string`

      Tags to attach to the Firewall Rule.

    - `UpdatedAt Time`

      When the Firewall Rule was updated.

    - `VPCID string`

      ID of the VPC the Firewall Rule belongs to.

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

# Connect

## Domain Types

### Connect Bandwidth Mbps

- `type ConnectBandwidthMbps int64`

  Connect Connection speed in Mbps

  - `const ConnectBandwidthMbps50 ConnectBandwidthMbps = 50`

  - `const ConnectBandwidthMbps200 ConnectBandwidthMbps = 200`

  - `const ConnectBandwidthMbps500 ConnectBandwidthMbps = 500`

  - `const ConnectBandwidthMbps1000 ConnectBandwidthMbps = 1000`

  - `const ConnectBandwidthMbps2000 ConnectBandwidthMbps = 2000`

### Connect Connection

- `type ConnectConnection struct{…}`

  Connect Connection details.

  - `ID string`

    Unique identifier for the Connect Connection

  - `ASN int64`

    ASN

  - `AWS ConnectConnectionAWSConfig`

    AWS provider configuration

    - `Region string`

      AWS region where the connection is established

  - `BandwidthMbps int64`

    Connect Connection speed in Mbps

    - `const ConnectBandwidthMbps50 ConnectBandwidthMbps = 50`

    - `const ConnectBandwidthMbps200 ConnectBandwidthMbps = 200`

    - `const ConnectBandwidthMbps500 ConnectBandwidthMbps = 500`

    - `const ConnectBandwidthMbps1000 ConnectBandwidthMbps = 1000`

    - `const ConnectBandwidthMbps2000 ConnectBandwidthMbps = 2000`

  - `CIDRs []string`

    CIDRs for the Connect Connection

  - `CreatedAt Time`

    When the Connect Connection was created

  - `Name string`

    Name of the Connect Connection

  - `ProjectID string`

    Project ID the Connect Connection belongs to

  - `ProviderASN int64`

    Provider ASN

  - `ProviderCIDRs []string`

    Provider CIDRs for the Connect Connection

  - `ProviderRouterIP string`

    Provider Router IP for the Connect Connection

  - `Region RegionName`

    Region the resource is in.

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

  - `RouterIP string`

    Router IP

  - `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"`

  - `Tags []string`

    Tags to attach to the Connect Connection

  - `UpdatedAt Time`

    When the Connect Connection was updated

### Connect Connection AWS Config

- `type ConnectConnectionAWSConfig struct{…}`

  AWS provider configuration

  - `Region string`

    AWS region where the connection is established

### Connect Connection AWS Config Request

- `type ConnectConnectionAWSConfigRequest struct{…}`

  AWS provider configuration

  - `AccountID string`

    AWS account id

  - `Region string`

    AWS region where the connection will be established

### Connect Connection List

- `type ConnectConnectionList struct{…}`

  - `Items []ConnectConnection`

    - `ID string`

      Unique identifier for the Connect Connection

    - `ASN int64`

      ASN

    - `AWS ConnectConnectionAWSConfig`

      AWS provider configuration

      - `Region string`

        AWS region where the connection is established

    - `BandwidthMbps int64`

      Connect Connection speed in Mbps

      - `const ConnectBandwidthMbps50 ConnectBandwidthMbps = 50`

      - `const ConnectBandwidthMbps200 ConnectBandwidthMbps = 200`

      - `const ConnectBandwidthMbps500 ConnectBandwidthMbps = 500`

      - `const ConnectBandwidthMbps1000 ConnectBandwidthMbps = 1000`

      - `const ConnectBandwidthMbps2000 ConnectBandwidthMbps = 2000`

    - `CIDRs []string`

      CIDRs for the Connect Connection

    - `CreatedAt Time`

      When the Connect Connection was created

    - `Name string`

      Name of the Connect Connection

    - `ProjectID string`

      Project ID the Connect Connection belongs to

    - `ProviderASN int64`

      Provider ASN

    - `ProviderCIDRs []string`

      Provider CIDRs for the Connect Connection

    - `ProviderRouterIP string`

      Provider Router IP for the Connect Connection

    - `Region RegionName`

      Region the resource is in.

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

    - `RouterIP string`

      Router IP

    - `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"`

    - `Tags []string`

      Tags to attach to the Connect Connection

    - `UpdatedAt Time`

      When the Connect Connection was updated

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

### Connect Route

- `type ConnectRoute struct{…}`

  Routes supported for Connect.

  - `NirvanaRegion RegionName`

    Region the resource is in.

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

  - `Provider string`

    Provider name.

  - `ProviderRegion string`

    Provider region name.

### Connect Route List

- `type ConnectRouteList struct{…}`

  - `Items []ConnectRoute`

    - `NirvanaRegion RegionName`

      Region the resource is in.

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

    - `Provider string`

      Provider name.

    - `ProviderRegion string`

      Provider region name.

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

# Connections

## Create Connect Connection

`client.Networking.Connect.Connections.New(ctx, body) (*Operation, error)`

**post** `/v1/networking/connect/connections`

Create a Connect Connection

### Parameters

- `body ConnectConnectionNewParams`

  - `BandwidthMbps param.Field[int64]`

    Connect Connection speed in Mbps

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

    CIDRs for the Connect Connection. Must be in network-aligned/canonical form.

  - `Name param.Field[string]`

    Name of the Connect Connection

  - `ProjectID param.Field[string]`

    Project ID the Connect Connection belongs to

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

    Provider CIDRs. Must be in network-aligned/canonical form.

  - `Region param.Field[RegionName]`

    Region the resource is in.

  - `AWS param.Field[ConnectConnectionAWSConfigRequest]`

    AWS provider configuration

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

    Tags to attach to the Connect Connection

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/networking"
  "github.com/nirvana-labs/nirvana-go/option"
  "github.com/nirvana-labs/nirvana-go/shared"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.Connect.Connections.New(context.TODO(), networking.ConnectConnectionNewParams{
    BandwidthMbps: 50,
    CIDRs: []string{"10.0.0.0/16"},
    Name: "my-connect-connection",
    ProjectID: "123e4567-e89b-12d3-a456-426614174000",
    ProviderCIDRs: []string{"172.16.0.0/16"},
    Region: shared.RegionNameUsSva2,
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", operation.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Get Connect Connection

`client.Networking.Connect.Connections.Get(ctx, connectionID) (*ConnectConnection, error)`

**get** `/v1/networking/connect/connections/{connection_id}`

Get Connect Connection details

### Parameters

- `connectionID string`

### Returns

- `type ConnectConnection struct{…}`

  Connect Connection details.

  - `ID string`

    Unique identifier for the Connect Connection

  - `ASN int64`

    ASN

  - `AWS ConnectConnectionAWSConfig`

    AWS provider configuration

    - `Region string`

      AWS region where the connection is established

  - `BandwidthMbps int64`

    Connect Connection speed in Mbps

    - `const ConnectBandwidthMbps50 ConnectBandwidthMbps = 50`

    - `const ConnectBandwidthMbps200 ConnectBandwidthMbps = 200`

    - `const ConnectBandwidthMbps500 ConnectBandwidthMbps = 500`

    - `const ConnectBandwidthMbps1000 ConnectBandwidthMbps = 1000`

    - `const ConnectBandwidthMbps2000 ConnectBandwidthMbps = 2000`

  - `CIDRs []string`

    CIDRs for the Connect Connection

  - `CreatedAt Time`

    When the Connect Connection was created

  - `Name string`

    Name of the Connect Connection

  - `ProjectID string`

    Project ID the Connect Connection belongs to

  - `ProviderASN int64`

    Provider ASN

  - `ProviderCIDRs []string`

    Provider CIDRs for the Connect Connection

  - `ProviderRouterIP string`

    Provider Router IP for the Connect Connection

  - `Region RegionName`

    Region the resource is in.

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

  - `RouterIP string`

    Router IP

  - `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"`

  - `Tags []string`

    Tags to attach to the Connect Connection

  - `UpdatedAt Time`

    When the Connect Connection was updated

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  connectConnection, err := client.Networking.Connect.Connections.Get(context.TODO(), "connection_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", connectConnection.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "asn": 64512,
  "aws": {
    "region": "us-east-1"
  },
  "bandwidth_mbps": 50,
  "cidrs": [
    "10.0.0.0/16"
  ],
  "created_at": "2025-01-01T00:00:00Z",
  "name": "my-connect-connection",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "provider_asn": 64513,
  "provider_cidrs": [
    "172.16.0.0/16"
  ],
  "provider_router_ip": "169.254.1.43",
  "region": "us-sva-2",
  "router_ip": "169.254.1.42",
  "status": "ready",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Update Connect Connection

`client.Networking.Connect.Connections.Update(ctx, connectionID, body) (*Operation, error)`

**patch** `/v1/networking/connect/connections/{connection_id}`

Update Connect Connection details

### Parameters

- `connectionID string`

- `body ConnectConnectionUpdateParams`

  - `Name param.Field[string]`

    Name of the Connect Connection.

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

    Tags to attach to the Connect Connection

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.Connect.Connections.Update(
    context.TODO(),
    "connection_id",
    networking.ConnectConnectionUpdateParams{

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

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete Connect Connection

`client.Networking.Connect.Connections.Delete(ctx, connectionID) (*Operation, error)`

**delete** `/v1/networking/connect/connections/{connection_id}`

Delete Connect Connection

### Parameters

- `connectionID string`

### Returns

- `type Operation struct{…}`

  Operation details.

  - `ID string`

    Unique identifier for the Operation.

  - `CreatedAt Time`

    When the Operation was created.

  - `Details OperationDetails`

    Structured details about what an operation is changing.

    - `Changes OperationChanges`

      Map of changed field names to their from/to diffs. Keys depend on the parent operation's kind+type.

      - `From OperationFieldDiffFromUnion`

        Previous value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffFromArray []string`

      - `To OperationFieldDiffToUnion`

        New value.

        - `string`

        - `float64`

        - `bool`

        - `type OperationFieldDiffToArray []string`

  - `Kind OperationKind`

    Kind of Operation.

    - `const OperationKindVM OperationKind = "vm"`

    - `const OperationKindVolume OperationKind = "volume"`

    - `const OperationKindVPC OperationKind = "vpc"`

    - `const OperationKindFirewallRule OperationKind = "firewall_rule"`

    - `const OperationKindNKSCluster OperationKind = "nks_cluster"`

    - `const OperationKindNKSNodePool OperationKind = "nks_node_pool"`

  - `ProjectID string`

    Project ID the Operation belongs to.

  - `ResourceID string`

    ID of the resource that the Operation is acting on.

  - `Status OperationStatus`

    Status of the Operation.

    - `const OperationStatusPending OperationStatus = "pending"`

    - `const OperationStatusRunning OperationStatus = "running"`

    - `const OperationStatusDone OperationStatus = "done"`

    - `const OperationStatusFailed OperationStatus = "failed"`

    - `const OperationStatusUnknown OperationStatus = "unknown"`

  - `Type OperationType`

    Type of Operation.

    - `const OperationTypeCreate OperationType = "create"`

    - `const OperationTypeUpdate OperationType = "update"`

    - `const OperationTypeDelete OperationType = "delete"`

    - `const OperationTypeRestart OperationType = "restart"`

  - `UpdatedAt Time`

    When the Operation was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  operation, err := client.Networking.Connect.Connections.Delete(context.TODO(), "connection_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", operation.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "details": {
    "changes": {
      "foo": {
        "from": "string",
        "to": "string"
      }
    }
  },
  "kind": "vm",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "resource_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "pending",
  "type": "create",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## List Connect Connection

`client.Networking.Connect.Connections.List(ctx, query) (*Cursor[ConnectConnection], error)`

**get** `/v1/networking/connect/connections`

List all Connect Connections

### Parameters

- `query ConnectConnectionListParams`

  - `ProjectID param.Field[string]`

    Project ID of resources to request

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type ConnectConnection struct{…}`

  Connect Connection details.

  - `ID string`

    Unique identifier for the Connect Connection

  - `ASN int64`

    ASN

  - `AWS ConnectConnectionAWSConfig`

    AWS provider configuration

    - `Region string`

      AWS region where the connection is established

  - `BandwidthMbps int64`

    Connect Connection speed in Mbps

    - `const ConnectBandwidthMbps50 ConnectBandwidthMbps = 50`

    - `const ConnectBandwidthMbps200 ConnectBandwidthMbps = 200`

    - `const ConnectBandwidthMbps500 ConnectBandwidthMbps = 500`

    - `const ConnectBandwidthMbps1000 ConnectBandwidthMbps = 1000`

    - `const ConnectBandwidthMbps2000 ConnectBandwidthMbps = 2000`

  - `CIDRs []string`

    CIDRs for the Connect Connection

  - `CreatedAt Time`

    When the Connect Connection was created

  - `Name string`

    Name of the Connect Connection

  - `ProjectID string`

    Project ID the Connect Connection belongs to

  - `ProviderASN int64`

    Provider ASN

  - `ProviderCIDRs []string`

    Provider CIDRs for the Connect Connection

  - `ProviderRouterIP string`

    Provider Router IP for the Connect Connection

  - `Region RegionName`

    Region the resource is in.

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

  - `RouterIP string`

    Router IP

  - `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"`

  - `Tags []string`

    Tags to attach to the Connect Connection

  - `UpdatedAt Time`

    When the Connect Connection was updated

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Networking.Connect.Connections.List(context.TODO(), networking.ConnectConnectionListParams{
    ProjectID: "project_id",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "asn": 64512,
      "aws": {
        "region": "us-east-1"
      },
      "bandwidth_mbps": 50,
      "cidrs": [
        "10.0.0.0/16"
      ],
      "created_at": "2025-01-01T00:00:00Z",
      "name": "my-connect-connection",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "provider_asn": 64513,
      "provider_cidrs": [
        "172.16.0.0/16"
      ],
      "provider_router_ip": "169.254.1.43",
      "region": "us-sva-2",
      "router_ip": "169.254.1.42",
      "status": "ready",
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

# Routes

## List Connect Supported Routes

`client.Networking.Connect.Routes.List(ctx, query) (*Cursor[ConnectRoute], error)`

**get** `/v1/networking/connect/routes`

List all supported routes with regions for Connect.

### Parameters

- `query ConnectRouteListParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type ConnectRoute struct{…}`

  Routes supported for Connect.

  - `NirvanaRegion RegionName`

    Region the resource is in.

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

  - `Provider string`

    Provider name.

  - `ProviderRegion string`

    Provider region name.

### Example

```go
package main

import (
  "context"
  "fmt"

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

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Networking.Connect.Routes.List(context.TODO(), networking.ConnectRouteListParams{

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

#### Response

```json
{
  "items": [
    {
      "nirvana_region": "us-sva-2",
      "provider": "aws",
      "provider_region": "us-east-1"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
