Skip to main content

Get Compute Pricing

You can obtain compute pricing information by using the PricingComputePost method provided by the Go SDK.
package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/baselinehq/pricingapi-client-golang"
)

func main() {
	instance := *openapiclient.NewGithubComBaselinehqGolangSharedTypesInstance() 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DefaultAPI.PricingComputePost(context.Background()).Instance(instance).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PricingComputePost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PricingComputePost`: SchemaComputePricingsRow
	fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PricingComputePost`: %v\n", resp)
}
instance refers to the type GithubComBaselinehqGolangSharedTypesInstance, which represents the instance details for which you want to compute pricing.