Skip to content

Commit

Permalink
Generated Xendit go SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
xendit-devx-bot committed Jan 30, 2025
1 parent 7132b34 commit 7678f03
Show file tree
Hide file tree
Showing 58 changed files with 941 additions and 107 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2024 Xendit
Copyright (c) 2017-2025 Xendit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API
in applications written in Go.

* Package version: 6.0.0
* Package version: 6.1.0

# Getting Started

Expand Down
6 changes: 5 additions & 1 deletion balance_and_transaction/api_balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package balance_and_transaction
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -153,7 +154,10 @@ func (a *BalanceApiService) GetBalanceExecute(r ApiGetBalanceRequest) (*Balance,

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: BalanceApiService.GetBalanceExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down
11 changes: 9 additions & 2 deletions balance_and_transaction/api_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package balance_and_transaction
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -143,7 +144,10 @@ func (a *TransactionApiService) GetTransactionByIDExecute(r ApiGetTransactionByI

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: TransactionApiService.GetTransactionByIDExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down Expand Up @@ -388,7 +392,10 @@ func (a *TransactionApiService) GetAllTransactionsExecute(r ApiGetAllTransaction

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: TransactionApiService.GetAllTransactionsExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (c *APIClient) PrepareRequest(
headerParams["xendit-lib"] = "go"

// TODO: overwrite this line from buddy pipeline
headerParams["xendit-lib-ver"] = "6.0.0"
headerParams["xendit-lib-ver"] = "6.1.0"

var body *bytes.Buffer

Expand Down
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var Default Configuration = *NewConfiguration()
func NewConfiguration() *Configuration {
cfg := &Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/6.0.0/go",
UserAgent: "OpenAPI-Generator/6.1.0/go",
Debug: false,
Servers: ServerConfigurations{
{
Expand Down
21 changes: 17 additions & 4 deletions customer/api_customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package customer
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -186,7 +187,10 @@ func (a *CustomerApiService) CreateCustomerExecute(r ApiCreateCustomerRequest) (

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.CreateCustomerExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down Expand Up @@ -284,7 +288,10 @@ func (a *CustomerApiService) GetCustomerExecute(r ApiGetCustomerRequest) (*Custo

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.GetCustomerExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down Expand Up @@ -392,7 +399,10 @@ func (a *CustomerApiService) GetCustomerByReferenceIDExecute(r ApiGetCustomerByR

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.GetCustomerByReferenceIDExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down Expand Up @@ -499,7 +509,10 @@ func (a *CustomerApiService) UpdateCustomerExecute(r ApiUpdateCustomerRequest) (

localVarHTTPResponse, err := a.client.CallAPI(req)

localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
if err != nil {
return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.UpdateCustomerExecute: %v", err))
}
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))

Expand Down
14 changes: 14 additions & 0 deletions docs/invoice/BankCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ Representing the available bank channels used for invoice-related transactions.

* `CIMB` (value: `"CIMB"`)

* `VIETCAPITAL` (value: `"VIETCAPITAL"`)

* `WOORI` (value: `"WOORI"`)

* `PV` (value: `"PV"`)

* `MSB` (value: `"MSB"`)

* `VPB` (value: `"VPB"`)

* `BIDV` (value: `"BIDV"`)

* `CAKE` (value: `"CAKE"`)

* `BNC` (value: `"BNC"`)

* `HANA` (value: `"HANA"`)
Expand Down
26 changes: 26 additions & 0 deletions docs/invoice/ChannelPropertiesCards.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ An object representing properties specific for credit card payment method.
| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **AllowedBins** | Pointer to **string[]** | | An array of allowed BINs (6 or 8 digits) for credit card payments. | |
| **InstallmentConfiguration** | Pointer to [**ChannelPropertiesCardsInstallmentConfiguration**](ChannelPropertiesCardsInstallmentConfiguration.md) | | | |

## Methods

Expand Down Expand Up @@ -50,6 +51,31 @@ SetAllowedBins sets AllowedBins field to given value.

HasAllowedBins returns a boolean if a field has been set.

### GetInstallmentConfiguration

`func (o *ChannelPropertiesCards) GetInstallmentConfiguration() ChannelPropertiesCardsInstallmentConfiguration`

GetInstallmentConfiguration returns the InstallmentConfiguration field if non-nil, zero value otherwise.

### GetInstallmentConfigurationOk

`func (o *ChannelPropertiesCards) GetInstallmentConfigurationOk() (*ChannelPropertiesCardsInstallmentConfiguration, bool)`

GetInstallmentConfigurationOk returns a tuple with the InstallmentConfiguration field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetInstallmentConfiguration

`func (o *ChannelPropertiesCards) SetInstallmentConfiguration(v ChannelPropertiesCardsInstallmentConfiguration)`

SetInstallmentConfiguration sets InstallmentConfiguration field to given value.

### HasInstallmentConfiguration

`func (o *ChannelPropertiesCards) HasInstallmentConfiguration() bool`

HasInstallmentConfiguration returns a boolean if a field has been set.


[[Back to README]](../../README.md)

Expand Down
82 changes: 82 additions & 0 deletions docs/invoice/ChannelPropertiesCardsInstallmentConfiguration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ChannelPropertiesCardsInstallmentConfiguration
An object to pre-set cards installment for a specific invoice

## Properties
| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **AllowFullPayment** | Pointer to **bool** | | Indicate whether full payment (without installment) is allowed | |
| **AllowedTerms** | Pointer to [**ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner[]**](ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md) | | An object to set what kind (from specific bank / specific tenor) of cards installments will be available on a specific invoice | |

## Methods

### NewChannelPropertiesCardsInstallmentConfiguration

`func NewChannelPropertiesCardsInstallmentConfiguration() *ChannelPropertiesCardsInstallmentConfiguration`

NewChannelPropertiesCardsInstallmentConfiguration instantiates a new ChannelPropertiesCardsInstallmentConfiguration object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewChannelPropertiesCardsInstallmentConfigurationWithDefaults

`func NewChannelPropertiesCardsInstallmentConfigurationWithDefaults() *ChannelPropertiesCardsInstallmentConfiguration`

NewChannelPropertiesCardsInstallmentConfigurationWithDefaults instantiates a new ChannelPropertiesCardsInstallmentConfiguration object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetAllowFullPayment

`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowFullPayment() bool`

GetAllowFullPayment returns the AllowFullPayment field if non-nil, zero value otherwise.

### GetAllowFullPaymentOk

`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowFullPaymentOk() (*bool, bool)`

GetAllowFullPaymentOk returns a tuple with the AllowFullPayment field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAllowFullPayment

`func (o *ChannelPropertiesCardsInstallmentConfiguration) SetAllowFullPayment(v bool)`

SetAllowFullPayment sets AllowFullPayment field to given value.

### HasAllowFullPayment

`func (o *ChannelPropertiesCardsInstallmentConfiguration) HasAllowFullPayment() bool`

HasAllowFullPayment returns a boolean if a field has been set.

### GetAllowedTerms

`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowedTerms() []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner`

GetAllowedTerms returns the AllowedTerms field if non-nil, zero value otherwise.

### GetAllowedTermsOk

`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowedTermsOk() (*[]ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner, bool)`

GetAllowedTermsOk returns a tuple with the AllowedTerms field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAllowedTerms

`func (o *ChannelPropertiesCardsInstallmentConfiguration) SetAllowedTerms(v []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner)`

SetAllowedTerms sets AllowedTerms field to given value.

### HasAllowedTerms

`func (o *ChannelPropertiesCardsInstallmentConfiguration) HasAllowedTerms() bool`

HasAllowedTerms returns a boolean if a field has been set.


[[Back to README]](../../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner


## Properties
| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **Issuer** | Pointer to **string** | | The bank code of the installment provider / issuer | |
| **AllowedTerms** | Pointer to **float32[]** | | An array containing list of installment tenor available to choose | |

## Methods

### NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner

`func NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner`

NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner instantiates a new ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults

`func NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner`

NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults instantiates a new ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetIssuer

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetIssuer() string`

GetIssuer returns the Issuer field if non-nil, zero value otherwise.

### GetIssuerOk

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetIssuerOk() (*string, bool)`

GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetIssuer

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) SetIssuer(v string)`

SetIssuer sets Issuer field to given value.

### HasIssuer

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) HasIssuer() bool`

HasIssuer returns a boolean if a field has been set.

### GetAllowedTerms

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetAllowedTerms() []float32`

GetAllowedTerms returns the AllowedTerms field if non-nil, zero value otherwise.

### GetAllowedTermsOk

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetAllowedTermsOk() (*[]float32, bool)`

GetAllowedTermsOk returns a tuple with the AllowedTerms field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAllowedTerms

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) SetAllowedTerms(v []float32)`

SetAllowedTerms sets AllowedTerms field to given value.

### HasAllowedTerms

`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) HasAllowedTerms() bool`

HasAllowedTerms returns a boolean if a field has been set.


[[Back to README]](../../README.md)


Loading

0 comments on commit 7678f03

Please sign in to comment.