Skip to content

Latest commit

 

History

History
243 lines (156 loc) · 6.65 KB

File metadata and controls

243 lines (156 loc) · 6.65 KB

HyperstackApi.AutoTopupApi

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

createAutoTopUp

CreateAutoTopupResponse createAutoTopUp(payload)

Create an auto top up configuration and initiate Stripe setup

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AutoTopupApi();
let payload = new HyperstackApi.CreateAutoTopupPayload(); // CreateAutoTopupPayload | 
apiInstance.createAutoTopUp(payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
payload CreateAutoTopupPayload

Return type

CreateAutoTopupResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

disableAutoTopUp

DisableAutoTopupResponse disableAutoTopUp()

Disable auto top up, preventing any future automatic charges

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AutoTopupApi();
apiInstance.disableAutoTopUp().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

DisableAutoTopupResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getAutoTopUp

GetAutoTopupResponse getAutoTopUp()

Retrieve the current auto top up configuration and transaction history

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AutoTopupApi();
apiInstance.getAutoTopUp().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

GetAutoTopupResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getAutoTopUpStatus

AutoTopupStatusSchema getAutoTopUpStatus()

Get auto top-up status and configuration

Retrieves the current auto top-up configuration and status for your organization. Returns the status (active, disabled, pending_setup, or null if never configured), along with the threshold and top-up amounts. For additional information, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AutoTopupApi();
apiInstance.getAutoTopUpStatus().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

AutoTopupStatusSchema

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateAutoTopUp

UpdateAutoTopupResponse updateAutoTopUp(payload)

Update an existing active auto top up configuration

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AutoTopupApi();
let payload = new HyperstackApi.UpdateAutoTopupPayload(); // UpdateAutoTopupPayload | 
apiInstance.updateAutoTopUp(payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
payload UpdateAutoTopupPayload

Return type

UpdateAutoTopupResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json