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

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

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

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

    res, err := s.Plans.GetBandwidth(ctx, latitudeshgosdk.Pointer("2023-06-01"), nil, latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
    if err != nil {
        log.Fatal(err)
    }
    if res.BandwidthPlans != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
{
  "data": [
    {
      "id": "argentina",
      "type": "bandwidth_plan",
      "attributes": {
        "region": "Argentina",
        "locations": [
          "ASH",
          "SAO"
        ],
        "pricing": {
          "usd": {
            "monthly": 8000,
            "yearly": 0
          },
          "brl": {
            "monthly": 4000,
            "yearly": null
          }
        }
      }
    }
  ],
  "meta": {}
}

Authorizations

Authorization
string
header
required

Headers

API-Version
string
default:2023-06-01

Query Parameters

filter[id]
string

The plan ID to filter by

page[size]
integer
default:20

Number of items to return per page

Required range: x >= 1
page[number]
integer
default:1

Page number to return (starts at 1)

Required range: x >= 1

Response

200 - application/vnd.api+json

Success

data
object[]
meta
object