Skip to content

Latest commit

 

History

History
350 lines (249 loc) · 13.9 KB

README.md

File metadata and controls

350 lines (249 loc) · 13.9 KB

BillingV1

(billingV1())

Overview

Available Operations

getBalance

GetBalance

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetBalanceResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetBalanceResponse res = sdk.billingV1().getBalance()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.number().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetBalanceResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getInvoices

GetInvoices

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetInvoicesResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetInvoicesResponse res = sdk.billingV1().getInvoices()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.classes().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetInvoicesResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getPaymentMethod

GetPaymentMethod

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetPaymentMethodResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetPaymentMethodResponse res = sdk.billingV1().getPaymentMethod()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.paymentMethod().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetPaymentMethodResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429, 500 application/json
models/errors/SDKError 4XX, 5XX */*

getUpcomingInvoiceItems

GetUpcomingInvoiceItems

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetUpcomingInvoiceItemsResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetUpcomingInvoiceItemsResponse res = sdk.billingV1().getUpcomingInvoiceItems()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.invoiceItemPage().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetUpcomingInvoiceItemsResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getUpcomingInvoiceTotal

GetUpcomingInvoiceTotal

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetUpcomingInvoiceTotalResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetUpcomingInvoiceTotalResponse res = sdk.billingV1().getUpcomingInvoiceTotal()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.object().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetUpcomingInvoiceTotalResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

initStripeCustomerPortalUrl

InitStripeCustomerPortalUrl

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.InitStripeCustomerPortalUrlResponse;
import dev.hathora.cloud_sdk.models.shared.CustomerPortalUrl;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        InitStripeCustomerPortalUrlResponse res = sdk.billingV1().initStripeCustomerPortalUrl()
                .customerPortalUrl(CustomerPortalUrl.builder()
                    .returnUrl("<value>")
                    .build())
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.string().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
customerPortalUrl CustomerPortalUrl ✔️ N/A
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

InitStripeCustomerPortalUrlResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 422, 429 application/json
models/errors/SDKError 4XX, 5XX */*