All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| CreateAutoTopUp | Post /billing/auto-topup | Create an auto top up configuration and initiate Stripe setup |
| DisableAutoTopUp | Delete /billing/auto-topup | Disable auto top up, preventing any future automatic charges |
| GetAutoTopUp | Get /billing/auto-topup | Retrieve the current auto top up configuration and transaction history |
| GetAutoTopUpStatus | Get /billing/auto-topup/status | Get auto top-up status and configuration |
| UpdateAutoTopUp | Put /billing/auto-topup | Update an existing active auto top up configuration |
CreateAutoTopupResponse CreateAutoTopUp(ctx).Payload(payload).Execute()
Create an auto top up configuration and initiate Stripe setup
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
payload := *openapiclient.NewCreateAutoTopupPayload(float32(123), float32(123)) // CreateAutoTopupPayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AutoTopupAPI.CreateAutoTopUp(context.Background()).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutoTopupAPI.CreateAutoTopUp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAutoTopUp`: CreateAutoTopupResponse
fmt.Fprintf(os.Stdout, "Response from `AutoTopupAPI.CreateAutoTopUp`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateAutoTopUpRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| payload | CreateAutoTopupPayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DisableAutoTopupResponse DisableAutoTopUp(ctx).Execute()
Disable auto top up, preventing any future automatic charges
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AutoTopupAPI.DisableAutoTopUp(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutoTopupAPI.DisableAutoTopUp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DisableAutoTopUp`: DisableAutoTopupResponse
fmt.Fprintf(os.Stdout, "Response from `AutoTopupAPI.DisableAutoTopUp`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiDisableAutoTopUpRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAutoTopupResponse GetAutoTopUp(ctx).Execute()
Retrieve the current auto top up configuration and transaction history
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AutoTopupAPI.GetAutoTopUp(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutoTopupAPI.GetAutoTopUp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAutoTopUp`: GetAutoTopupResponse
fmt.Fprintf(os.Stdout, "Response from `AutoTopupAPI.GetAutoTopUp`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetAutoTopUpRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AutoTopupStatusSchema GetAutoTopUpStatus(ctx).Execute()
Get auto top-up status and configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AutoTopupAPI.GetAutoTopUpStatus(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutoTopupAPI.GetAutoTopUpStatus``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAutoTopUpStatus`: AutoTopupStatusSchema
fmt.Fprintf(os.Stdout, "Response from `AutoTopupAPI.GetAutoTopUpStatus`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetAutoTopUpStatusRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateAutoTopupResponse UpdateAutoTopUp(ctx).Payload(payload).Execute()
Update an existing active auto top up configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
payload := *openapiclient.NewUpdateAutoTopupPayload(float32(123), float32(123)) // UpdateAutoTopupPayload |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AutoTopupAPI.UpdateAutoTopUp(context.Background()).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutoTopupAPI.UpdateAutoTopUp``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateAutoTopUp`: UpdateAutoTopupResponse
fmt.Fprintf(os.Stdout, "Response from `AutoTopupAPI.UpdateAutoTopUp`: %v\n", resp)
}Other parameters are passed through a pointer to a apiUpdateAutoTopUpRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| payload | UpdateAutoTopupPayload |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]