Skip to main content
POST
/
plans
/
bandwidth
Go (SDK)
package main

import(
	"context"
	"os"
	latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
	"github.com/latitudesh/latitudesh-go-sdk/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := latitudeshgosdk.New(
        latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
    )

    res, err := s.Plans.UpdateBandwidth(ctx, operations.UpdatePlansBandwidthPlansRequestBody{
        Data: &operations.UpdatePlansBandwidthPlansData{
            Type: operations.UpdatePlansBandwidthPlansTypeBandwidthPackages.ToPointer(),
            Attributes: &operations.UpdatePlansBandwidthPlansAttributes{
                Project: latitudeshgosdk.Pointer("proj_z2A3DVZ3DnawP"),
                Quantity: latitudeshgosdk.Pointer[int64](5),
                RegionSlug: latitudeshgosdk.Pointer("brazil"),
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.BandwidthPackages != nil {
        // handle response
    }
}
{
  "data": {
    "type": "bandwidth_packages",
    "attributes": {
      "project": {
        "id": "proj_z2A3DVZ3DnawP",
        "name": "Renner-Rodriguez",
        "slug": "renner-rodriguez"
      },
      "packages": [
        {
          "region_slug": "united-states",
          "unit_price": 0.5,
          "currency": "USD",
          "contracted": 10,
          "total_price": 5
        },
        {
          "region_slug": "brazil",
          "unit_price": 4.6,
          "currency": "USD",
          "contracted": 0,
          "total_price": 0
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

Body

data
object

Response

200 - application/vnd.api+json

Success

type
enum<string>
Available options:
bandwidth_packages
attributes
object