Skip to content

Latest commit

 

History

History
321 lines (253 loc) · 19 KB

README.md

File metadata and controls

321 lines (253 loc) · 19 KB

Account

(Account)

Available Operations

CreateAccountingAccount

Create an account

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.CreateAccountingAccountRequest{
        ConnectionID: "<value>",
    }
    ctx := context.Background()
    res, err := s.Account.CreateAccountingAccount(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingAccount != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.CreateAccountingAccountRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CreateAccountingAccountResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetAccountingAccount

Retrieve an account

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.GetAccountingAccountRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Account.GetAccountingAccount(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingAccount != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetAccountingAccountRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetAccountingAccountResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ListAccountingAccounts

List all accounts

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.ListAccountingAccountsRequest{
        ConnectionID: "<value>",
    }
    ctx := context.Background()
    res, err := s.Account.ListAccountingAccounts(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingAccounts != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.ListAccountingAccountsRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListAccountingAccountsResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

PatchAccountingAccount

Update an account

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.PatchAccountingAccountRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Account.PatchAccountingAccount(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingAccount != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.PatchAccountingAccountRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.PatchAccountingAccountResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

RemoveAccountingAccount

Remove an account

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.RemoveAccountingAccountRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Account.RemoveAccountingAccount(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.RemoveAccountingAccountRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.RemoveAccountingAccountResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

UpdateAccountingAccount

Update an account

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.UpdateAccountingAccountRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Account.UpdateAccountingAccount(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.AccountingAccount != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.UpdateAccountingAccountRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.UpdateAccountingAccountResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /