Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion accounting/accounting_periods.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package accounting
type AccountingPeriodsListRequest struct {
// The pagination cursor value.
Cursor *string `json:"-"`
// Whether to include data that was marked as deleted by third party webhooks.
// Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
IncludeDeletedData *bool `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
// Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
IncludeShellData *bool `json:"-"`
// Number of results to return per page.
PageSize *int `json:"-"`
}
Expand Down
3 changes: 3 additions & 0 deletions accounting/accountingperiods/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func (c *Client) List(ctx context.Context, request *accounting.AccountingPeriods
if request.IncludeRemoteData != nil {
queryParams.Add("include_remote_data", fmt.Sprintf("%v", *request.IncludeRemoteData))
}
if request.IncludeShellData != nil {
queryParams.Add("include_shell_data", fmt.Sprintf("%v", *request.IncludeShellData))
}
if request.PageSize != nil {
queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize))
}
Expand Down
6 changes: 5 additions & 1 deletion accounting/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type AccountEndpointRequest struct {
}

type AccountsListRequest struct {
// If provided, will only provide accounts with the passed in enum.
AccountType *string `json:"-"`
// If provided, will only return accounts for this company.
CompanyId *string `json:"-"`
// If provided, will only return objects created after this datetime.
Expand All @@ -26,10 +28,12 @@ type AccountsListRequest struct {
Cursor *string `json:"-"`
// Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
Expand *string `json:"-"`
// Whether to include data that was marked as deleted by third party webhooks.
// Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
IncludeDeletedData *bool `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
// Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
IncludeShellData *bool `json:"-"`
// If provided, only objects synced by Merge after this date time will be returned.
ModifiedAfter *time.Time `json:"-"`
// If provided, only objects synced by Merge before this date time will be returned.
Expand Down
6 changes: 6 additions & 0 deletions accounting/accounts/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func (c *Client) List(ctx context.Context, request *accounting.AccountsListReque
endpointURL := baseURL + "/" + "accounting/v1/accounts"

queryParams := make(url.Values)
if request.AccountType != nil {
queryParams.Add("account_type", fmt.Sprintf("%v", *request.AccountType))
}
if request.CompanyId != nil {
queryParams.Add("company_id", fmt.Sprintf("%v", *request.CompanyId))
}
Expand All @@ -60,6 +63,9 @@ func (c *Client) List(ctx context.Context, request *accounting.AccountsListReque
if request.IncludeRemoteData != nil {
queryParams.Add("include_remote_data", fmt.Sprintf("%v", *request.IncludeRemoteData))
}
if request.IncludeShellData != nil {
queryParams.Add("include_shell_data", fmt.Sprintf("%v", *request.IncludeShellData))
}
if request.ModifiedAfter != nil {
queryParams.Add("modified_after", fmt.Sprintf("%v", request.ModifiedAfter.Format(time.RFC3339)))
}
Expand Down
65 changes: 65 additions & 0 deletions accounting/async_passthrough.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// This file was auto-generated by Fern from our API Definition.

package accounting

import (
json "encoding/json"
fmt "fmt"
)

type AsyncPassthroughRetrieveResponse struct {
typeName string
RemoteResponse *RemoteResponse
String string
}

func NewAsyncPassthroughRetrieveResponseFromRemoteResponse(value *RemoteResponse) *AsyncPassthroughRetrieveResponse {
return &AsyncPassthroughRetrieveResponse{typeName: "remoteResponse", RemoteResponse: value}
}

func NewAsyncPassthroughRetrieveResponseFromString(value string) *AsyncPassthroughRetrieveResponse {
return &AsyncPassthroughRetrieveResponse{typeName: "string", String: value}
}

func (a *AsyncPassthroughRetrieveResponse) UnmarshalJSON(data []byte) error {
valueRemoteResponse := new(RemoteResponse)
if err := json.Unmarshal(data, &valueRemoteResponse); err == nil {
a.typeName = "remoteResponse"
a.RemoteResponse = valueRemoteResponse
return nil
}
var valueString string
if err := json.Unmarshal(data, &valueString); err == nil {
a.typeName = "string"
a.String = valueString
return nil
}
return fmt.Errorf("%s cannot be deserialized as a %T", data, a)
}

func (a AsyncPassthroughRetrieveResponse) MarshalJSON() ([]byte, error) {
switch a.typeName {
default:
return nil, fmt.Errorf("invalid type %s in %T", a.typeName, a)
case "remoteResponse":
return json.Marshal(a.RemoteResponse)
case "string":
return json.Marshal(a.String)
}
}

type AsyncPassthroughRetrieveResponseVisitor interface {
VisitRemoteResponse(*RemoteResponse) error
VisitString(string) error
}

func (a *AsyncPassthroughRetrieveResponse) Accept(visitor AsyncPassthroughRetrieveResponseVisitor) error {
switch a.typeName {
default:
return fmt.Errorf("invalid type %s in %T", a.typeName, a)
case "remoteResponse":
return visitor.VisitRemoteResponse(a.RemoteResponse)
case "string":
return visitor.VisitString(a.String)
}
}
4 changes: 2 additions & 2 deletions accounting/asyncpassthrough/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ func (c *Client) Create(ctx context.Context, request *accounting.DataPassthrough
}

// Retrieves data from earlier async-passthrough POST request
func (c *Client) Retrieve(ctx context.Context, asyncPassthroughReceiptId string) (*accounting.RemoteResponse, error) {
func (c *Client) Retrieve(ctx context.Context, asyncPassthroughReceiptId string) (*accounting.AsyncPassthroughRetrieveResponse, error) {
baseURL := "https://api.merge.dev/api"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"accounting/v1/async-passthrough/%v", asyncPassthroughReceiptId)

var response *accounting.RemoteResponse
var response *accounting.AsyncPassthroughRetrieveResponse
if err := c.caller.Call(
ctx,
&core.CallParams{
Expand Down
52 changes: 52 additions & 0 deletions accounting/asynctasks/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// This file was auto-generated by Fern from our API Definition.

package asynctasks

import (
context "context"
fmt "fmt"
accounting "github.com/merge-api/merge-go-client/accounting"
core "github.com/merge-api/merge-go-client/core"
http "net/http"
)

type Client struct {
baseURL string
caller *core.Caller
header http.Header
}

func NewClient(opts ...core.ClientOption) *Client {
options := core.NewClientOptions()
for _, opt := range opts {
opt(options)
}
return &Client{
baseURL: options.BaseURL,
caller: core.NewCaller(options.HTTPClient),
header: options.ToHeader(),
}
}

// Returns an `AsyncPostTask` object with the given `id`.
func (c *Client) Retrieve(ctx context.Context, id string) (*accounting.AsyncPostTask, error) {
baseURL := "https://api.merge.dev/api"
if c.baseURL != "" {
baseURL = c.baseURL
}
endpointURL := fmt.Sprintf(baseURL+"/"+"accounting/v1/async-tasks/%v", id)

var response *accounting.AsyncPostTask
if err := c.caller.Call(
ctx,
&core.CallParams{
URL: endpointURL,
Method: http.MethodGet,
Headers: c.header,
Response: &response,
},
); err != nil {
return nil, err
}
return response, nil
}
4 changes: 3 additions & 1 deletion accounting/attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ type AttachmentsListRequest struct {
CreatedBefore *time.Time `json:"-"`
// The pagination cursor value.
Cursor *string `json:"-"`
// Whether to include data that was marked as deleted by third party webhooks.
// Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
IncludeDeletedData *bool `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
// Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
IncludeShellData *bool `json:"-"`
// If provided, only objects synced by Merge after this date time will be returned.
ModifiedAfter *time.Time `json:"-"`
// If provided, only objects synced by Merge before this date time will be returned.
Expand Down
3 changes: 3 additions & 0 deletions accounting/attachments/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func (c *Client) List(ctx context.Context, request *accounting.AttachmentsListRe
if request.IncludeRemoteData != nil {
queryParams.Add("include_remote_data", fmt.Sprintf("%v", *request.IncludeRemoteData))
}
if request.IncludeShellData != nil {
queryParams.Add("include_shell_data", fmt.Sprintf("%v", *request.IncludeShellData))
}
if request.ModifiedAfter != nil {
queryParams.Add("modified_after", fmt.Sprintf("%v", request.ModifiedAfter.Format(time.RFC3339)))
}
Expand Down
2 changes: 1 addition & 1 deletion accounting/audit_trail.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type AuditTrailListRequest struct {
Cursor *string `json:"-"`
// If included, will only include audit trail events that occurred before this time
EndDate *string `json:"-"`
// If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`
// If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
EventType *string `json:"-"`
// Number of results to return per page.
PageSize *int `json:"-"`
Expand Down
4 changes: 3 additions & 1 deletion accounting/balance_sheets.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ type BalanceSheetsListRequest struct {
Cursor *string `json:"-"`
// Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
Expand *string `json:"-"`
// Whether to include data that was marked as deleted by third party webhooks.
// Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
IncludeDeletedData *bool `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
// Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
IncludeShellData *bool `json:"-"`
// If provided, only objects synced by Merge after this date time will be returned.
ModifiedAfter *time.Time `json:"-"`
// If provided, only objects synced by Merge before this date time will be returned.
Expand Down
3 changes: 3 additions & 0 deletions accounting/balancesheets/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func (c *Client) List(ctx context.Context, request *accounting.BalanceSheetsList
if request.IncludeRemoteData != nil {
queryParams.Add("include_remote_data", fmt.Sprintf("%v", *request.IncludeRemoteData))
}
if request.IncludeShellData != nil {
queryParams.Add("include_shell_data", fmt.Sprintf("%v", *request.IncludeShellData))
}
if request.ModifiedAfter != nil {
queryParams.Add("modified_after", fmt.Sprintf("%v", request.ModifiedAfter.Format(time.RFC3339)))
}
Expand Down
29 changes: 29 additions & 0 deletions accounting/bank_feed_accounts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// This file was auto-generated by Fern from our API Definition.

package accounting

type BankFeedAccountEndpointRequest struct {
// Whether to include debug fields (such as log file links) in the response.
IsDebugMode *bool `json:"-"`
// Whether or not third-party updates should be run asynchronously.
RunAsync *bool `json:"-"`
Model *BankFeedAccountRequest `json:"model,omitempty"`
}

type BankFeedAccountsListRequest struct {
// The pagination cursor value.
Cursor *string `json:"-"`
// Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
IncludeDeletedData *bool `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
// Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
IncludeShellData *bool `json:"-"`
// Number of results to return per page.
PageSize *int `json:"-"`
}

type BankFeedAccountsRetrieveRequest struct {
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
}
49 changes: 49 additions & 0 deletions accounting/bank_feed_transactions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// This file was auto-generated by Fern from our API Definition.

package accounting

import (
time "time"
)

type BankFeedTransactionEndpointRequest struct {
// Whether to include debug fields (such as log file links) in the response.
IsDebugMode *bool `json:"-"`
// Whether or not third-party updates should be run asynchronously.
RunAsync *bool `json:"-"`
Model *BankFeedTransactionRequestRequest `json:"model,omitempty"`
}

type BankFeedTransactionsListRequest struct {
// If provided, will only return objects created after this datetime.
CreatedAfter *time.Time `json:"-"`
// If provided, will only return objects created before this datetime.
CreatedBefore *time.Time `json:"-"`
// The pagination cursor value.
Cursor *string `json:"-"`
// Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
Expand *string `json:"-"`
// Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
IncludeDeletedData *bool `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
// Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
IncludeShellData *bool `json:"-"`
// If provided, will only return bank feed transactions with this is_processed value
IsProcessed *bool `json:"-"`
// If provided, only objects synced by Merge after this date time will be returned.
ModifiedAfter *time.Time `json:"-"`
// If provided, only objects synced by Merge before this date time will be returned.
ModifiedBefore *time.Time `json:"-"`
// Number of results to return per page.
PageSize *int `json:"-"`
// The API provider's ID for the given object.
RemoteId *string `json:"-"`
}

type BankFeedTransactionsRetrieveRequest struct {
// Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
Expand *string `json:"-"`
// Whether to include the original data Merge fetched from the third-party to produce these models.
IncludeRemoteData *bool `json:"-"`
}
Loading
Loading