From b0929a8981ae0be8e4d380ee0e6e45ed5f168eec Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 15:17:16 +0000 Subject: [PATCH] SDK regeneration --- accounting/audit_trail.go | 2 +- accounting/client/client.go | 3 - accounting/link_token.go | 2 + accounting/selective_sync.go | 16 - accounting/selectivesync/client.go | 114 ---- accounting/types.go | 826 ++++++++++++++-------------- ats/audit_trail.go | 2 +- ats/client/client.go | 3 - ats/job_postings.go | 4 + ats/jobpostings/client.go | 6 + ats/link_token.go | 2 + ats/selective_sync.go | 16 - ats/selectivesync/client.go | 114 ---- ats/types.go | 538 +++++------------- client/client.go | 4 +- core/client_option.go | 2 +- crm/audit_trail.go | 2 +- crm/client/client.go | 3 - crm/link_token.go | 2 + crm/selective_sync.go | 16 - crm/selectivesync/client.go | 114 ---- crm/types.go | 562 ++++++------------- filestorage/audit_trail.go | 2 +- filestorage/client/client.go | 3 - filestorage/link_token.go | 2 + filestorage/selective_sync.go | 16 - filestorage/selectivesync/client.go | 114 ---- filestorage/types.go | 469 ++++------------ hris/audit_trail.go | 2 +- hris/client/client.go | 3 - hris/groups.go | 2 + hris/groups/client.go | 3 + hris/link_token.go | 2 + hris/selective_sync.go | 16 - hris/selectivesync/client.go | 114 ---- hris/types.go | 542 +++++------------- ticketing/audit_trail.go | 2 +- ticketing/client/client.go | 3 - ticketing/contacts.go | 8 + ticketing/contacts/client.go | 58 ++ ticketing/link_token.go | 2 + ticketing/selective_sync.go | 16 - ticketing/selectivesync/client.go | 114 ---- ticketing/types.go | 565 ++++++++----------- 44 files changed, 1260 insertions(+), 3151 deletions(-) delete mode 100644 accounting/selective_sync.go delete mode 100644 accounting/selectivesync/client.go delete mode 100644 ats/selective_sync.go delete mode 100644 ats/selectivesync/client.go delete mode 100644 crm/selective_sync.go delete mode 100644 crm/selectivesync/client.go delete mode 100644 filestorage/selective_sync.go delete mode 100644 filestorage/selectivesync/client.go delete mode 100644 hris/selective_sync.go delete mode 100644 hris/selectivesync/client.go delete mode 100644 ticketing/selective_sync.go delete mode 100644 ticketing/selectivesync/client.go diff --git a/accounting/audit_trail.go b/accounting/audit_trail.go index 09d4184..136bcd0 100644 --- a/accounting/audit_trail.go +++ b/accounting/audit_trail.go @@ -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` + // 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` EventType *string `json:"-"` // Number of results to return per page. PageSize *int `json:"-"` diff --git a/accounting/client/client.go b/accounting/client/client.go index 986b4fb..c7e7427 100644 --- a/accounting/client/client.go +++ b/accounting/client/client.go @@ -35,7 +35,6 @@ import ( purchaseorders "github.com/merge-api/merge-go-client/accounting/purchaseorders" regeneratekey "github.com/merge-api/merge-go-client/accounting/regeneratekey" scopes "github.com/merge-api/merge-go-client/accounting/scopes" - selectivesync "github.com/merge-api/merge-go-client/accounting/selectivesync" syncstatus "github.com/merge-api/merge-go-client/accounting/syncstatus" taxrates "github.com/merge-api/merge-go-client/accounting/taxrates" trackingcategories "github.com/merge-api/merge-go-client/accounting/trackingcategories" @@ -82,7 +81,6 @@ type Client struct { PhoneNumbers *phonenumbers.Client PurchaseOrders *purchaseorders.Client RegenerateKey *regeneratekey.Client - SelectiveSync *selectivesync.Client SyncStatus *syncstatus.Client ForceResync *forceresync.Client TaxRates *taxrates.Client @@ -132,7 +130,6 @@ func NewClient(opts ...core.ClientOption) *Client { PhoneNumbers: phonenumbers.NewClient(opts...), PurchaseOrders: purchaseorders.NewClient(opts...), RegenerateKey: regeneratekey.NewClient(opts...), - SelectiveSync: selectivesync.NewClient(opts...), SyncStatus: syncstatus.NewClient(opts...), ForceResync: forceresync.NewClient(opts...), TaxRates: taxrates.NewClient(opts...), diff --git a/accounting/link_token.go b/accounting/link_token.go index f2ca2c7..97f6b62 100644 --- a/accounting/link_token.go +++ b/accounting/link_token.go @@ -23,4 +23,6 @@ type EndUserDetailsRequest struct { CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` // The language code for the language to localize Merge Link to. Language *string `json:"language,omitempty"` + // A JSON object containing integration-specific configuration options. + IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty"` } diff --git a/accounting/selective_sync.go b/accounting/selective_sync.go deleted file mode 100644 index dbf81c8..0000000 --- a/accounting/selective_sync.go +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package accounting - -type LinkedAccountSelectiveSyncConfigurationListRequest struct { - // The selective syncs associated with a linked account. - SyncConfigurations []*LinkedAccountSelectiveSyncConfigurationRequest `json:"sync_configurations,omitempty"` -} - -type SelectiveSyncMetaListRequest struct { - CommonModel *string `json:"-"` - // The pagination cursor value. - Cursor *string `json:"-"` - // Number of results to return per page. - PageSize *int `json:"-"` -} diff --git a/accounting/selectivesync/client.go b/accounting/selectivesync/client.go deleted file mode 100644 index 26d542e..0000000 --- a/accounting/selectivesync/client.go +++ /dev/null @@ -1,114 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package selectivesync - -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" - url "net/url" -) - -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(), - } -} - -// Get a linked account's selective syncs. -func (c *Client) ConfigurationsList(ctx context.Context) ([]*accounting.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "accounting/v1/selective-sync/configurations" - - var response []*accounting.LinkedAccountSelectiveSyncConfiguration - 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 -} - -// Replace a linked account's selective syncs. -func (c *Client) ConfigurationsUpdate(ctx context.Context, request *accounting.LinkedAccountSelectiveSyncConfigurationListRequest) ([]*accounting.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "accounting/v1/selective-sync/configurations" - - var response []*accounting.LinkedAccountSelectiveSyncConfiguration - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// Get metadata for the conditions available to a linked account. -func (c *Client) MetaList(ctx context.Context, request *accounting.SelectiveSyncMetaListRequest) (*accounting.PaginatedConditionSchemaList, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "accounting/v1/selective-sync/meta" - - queryParams := make(url.Values) - if request.CommonModel != nil { - queryParams.Add("common_model", fmt.Sprintf("%v", *request.CommonModel)) - } - if request.Cursor != nil { - queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) - } - if request.PageSize != nil { - queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *accounting.PaginatedConditionSchemaList - 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 -} diff --git a/accounting/types.go b/accounting/types.go index 80c2341..0a73997 100644 --- a/accounting/types.go +++ b/accounting/types.go @@ -29,9 +29,10 @@ import ( type Account struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The account's name. Name *string `json:"name,omitempty"` @@ -2069,9 +2070,10 @@ func (a *AccountToken) String() string { type AccountingAttachment struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The attachment's name. FileName *string `json:"file_name,omitempty"` @@ -2197,9 +2199,10 @@ func (a *AccountingAttachmentResponse) String() string { // // Common models like `Invoice` and `Transaction` will have `AccountingPeriod` objects which will denote when they occurred. type AccountingPeriod struct { - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // Beginning date of the period StartDate *time.Time `json:"start_date,omitempty"` @@ -2326,8 +2329,9 @@ func (a AccountingPeriodStatusEnum) Ptr() *AccountingPeriodStatusEnum { // // Fetch from the `GET CompanyInfo` endpoint and view the company's phone numbers. type AccountingPhoneNumber struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The phone number. Number *string `json:"number,omitempty"` @@ -2413,8 +2417,9 @@ func (a *AccountingPhoneNumberRequest) String() string { // // Fetch from the `GET CompanyInfo` endpoint and view the company's addresses. type Address struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The address type. // @@ -3894,6 +3899,9 @@ type AuditLogEvent struct { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + // - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + // - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + // - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED EventType *AuditLogEventEventType `json:"event_type,omitempty"` EventDescription string `json:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty"` @@ -3960,6 +3968,9 @@ func (a *AuditLogEvent) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type AuditLogEventEventType struct { typeName string EventTypeEnum EventTypeEnum @@ -4134,9 +4145,10 @@ func (a *AvailableActions) String() string { type BalanceSheet struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The balance sheet's name. Name *string `json:"name,omitempty"` @@ -4926,9 +4938,10 @@ func (b *BalanceSheetCurrency) Accept(visitor BalanceSheetCurrencyVisitor) error type CashFlowStatement struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The cash flow statement's name. Name *string `json:"name,omitempty"` @@ -5931,9 +5944,10 @@ func (c *CommonModelScopesBodyRequest) String() string { type CompanyInfo struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The company's name. Name *string `json:"name,omitempty"` @@ -6656,164 +6670,6 @@ func (c *CompanyInfoCurrency) Accept(visitor CompanyInfoCurrencyVisitor) error { } } -type ConditionSchema struct { - // The ID of the condition schema. This ID is used when updating selective syncs for a linked account. - Id string `json:"id"` - // The common model for which a condition schema is defined. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - FieldName *string `json:"field_name,omitempty"` - // Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - // The type of value(s) that can be set for this condition. - // - // - `BOOLEAN` - BOOLEAN - // - `DATE` - DATE - // - `DATE_TIME` - DATE_TIME - // - `INTEGER` - INTEGER - // - `FLOAT` - FLOAT - // - `STRING` - STRING - // - `LIST_OF_STRINGS` - LIST_OF_STRINGS - ConditionType *ConditionSchemaConditionType `json:"condition_type,omitempty"` - // The schemas for the operators that can be used on a condition. - Operators []*OperatorSchema `json:"operators,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *ConditionSchema) UnmarshalJSON(data []byte) error { - type unmarshaler ConditionSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConditionSchema(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConditionSchema) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -// The type of value(s) that can be set for this condition. -// -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionSchemaConditionType struct { - typeName string - ConditionTypeEnum ConditionTypeEnum - String string -} - -func NewConditionSchemaConditionTypeFromConditionTypeEnum(value ConditionTypeEnum) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "conditionTypeEnum", ConditionTypeEnum: value} -} - -func NewConditionSchemaConditionTypeFromString(value string) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "string", String: value} -} - -func (c *ConditionSchemaConditionType) UnmarshalJSON(data []byte) error { - var valueConditionTypeEnum ConditionTypeEnum - if err := json.Unmarshal(data, &valueConditionTypeEnum); err == nil { - c.typeName = "conditionTypeEnum" - c.ConditionTypeEnum = valueConditionTypeEnum - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) -} - -func (c ConditionSchemaConditionType) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return json.Marshal(c.ConditionTypeEnum) - case "string": - return json.Marshal(c.String) - } -} - -type ConditionSchemaConditionTypeVisitor interface { - VisitConditionTypeEnum(ConditionTypeEnum) error - VisitString(string) error -} - -func (c *ConditionSchemaConditionType) Accept(visitor ConditionSchemaConditionTypeVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return visitor.VisitConditionTypeEnum(c.ConditionTypeEnum) - case "string": - return visitor.VisitString(c.String) - } -} - -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionTypeEnum string - -const ( - ConditionTypeEnumBoolean ConditionTypeEnum = "BOOLEAN" - ConditionTypeEnumDate ConditionTypeEnum = "DATE" - ConditionTypeEnumDateTime ConditionTypeEnum = "DATE_TIME" - ConditionTypeEnumInteger ConditionTypeEnum = "INTEGER" - ConditionTypeEnumFloat ConditionTypeEnum = "FLOAT" - ConditionTypeEnumString ConditionTypeEnum = "STRING" - ConditionTypeEnumListOfStrings ConditionTypeEnum = "LIST_OF_STRINGS" -) - -func NewConditionTypeEnumFromString(s string) (ConditionTypeEnum, error) { - switch s { - case "BOOLEAN": - return ConditionTypeEnumBoolean, nil - case "DATE": - return ConditionTypeEnumDate, nil - case "DATE_TIME": - return ConditionTypeEnumDateTime, nil - case "INTEGER": - return ConditionTypeEnumInteger, nil - case "FLOAT": - return ConditionTypeEnumFloat, nil - case "STRING": - return ConditionTypeEnumString, nil - case "LIST_OF_STRINGS": - return ConditionTypeEnumListOfStrings, nil - } - var t ConditionTypeEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { - return &c -} - // # The Contact Object // // ### Description @@ -6829,9 +6685,10 @@ func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { type Contact struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The contact's name. Name *string `json:"name,omitempty"` @@ -8246,9 +8103,10 @@ func (c CountryEnum) Ptr() *CountryEnum { type CreditNote struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The credit note's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty"` @@ -9221,9 +9079,10 @@ func (c *CreditNoteCurrency) Accept(visitor CreditNoteCurrencyVisitor) error { type CreditNoteLineItem struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` Item *CreditNoteLineItemItem `json:"item,omitempty"` // The credit note line item's name. @@ -9236,8 +9095,6 @@ type CreditNoteLineItem struct { Memo *string `json:"memo,omitempty"` // The credit note line item's unit price. UnitPrice *string `json:"unit_price,omitempty"` - // The credit note line item's tax rate. - TaxRate *string `json:"tax_rate,omitempty"` // The credit note line item's total. TotalLineAmount *string `json:"total_line_amount,omitempty"` // The credit note line item's associated tracking category. @@ -11067,6 +10924,9 @@ func (e *ErrorValidationProblem) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type EventTypeEnum string const ( @@ -11104,6 +10964,9 @@ const ( EventTypeEnumForcedLinkedAccountResync EventTypeEnum = "FORCED_LINKED_ACCOUNT_RESYNC" EventTypeEnumMutedIssue EventTypeEnum = "MUTED_ISSUE" EventTypeEnumGeneratedMagicLink EventTypeEnum = "GENERATED_MAGIC_LINK" + EventTypeEnumEnabledMergeWebhook EventTypeEnum = "ENABLED_MERGE_WEBHOOK" + EventTypeEnumDisabledMergeWebhook EventTypeEnum = "DISABLED_MERGE_WEBHOOK" + EventTypeEnumMergeWebhookTargetChanged EventTypeEnum = "MERGE_WEBHOOK_TARGET_CHANGED" ) func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { @@ -11176,6 +11039,12 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumMutedIssue, nil case "GENERATED_MAGIC_LINK": return EventTypeEnumGeneratedMagicLink, nil + case "ENABLED_MERGE_WEBHOOK": + return EventTypeEnumEnabledMergeWebhook, nil + case "DISABLED_MERGE_WEBHOOK": + return EventTypeEnumDisabledMergeWebhook, nil + case "MERGE_WEBHOOK_TARGET_CHANGED": + return EventTypeEnumMergeWebhookTargetChanged, nil } var t EventTypeEnum return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -11199,9 +11068,10 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { type Expense struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // When the transaction occurred. TransactionDate *time.Time `json:"transaction_date,omitempty"` @@ -12176,9 +12046,10 @@ func (e *ExpenseCurrency) Accept(visitor ExpenseCurrencyVisitor) error { type ExpenseLine struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The line's item. Item *ExpenseLineItem `json:"item,omitempty"` @@ -15675,9 +15546,10 @@ func (f *FieldPermissionDeserializerRequest) String() string { type IncomeStatement struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The income statement's name. Name *string `json:"name,omitempty"` @@ -16534,9 +16406,10 @@ func (i *IndividualCommonModelScopeDeserializerRequest) String() string { type Invoice struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // Whether the invoice is an accounts receivable or accounts payable. If `type` is `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is `ACCOUNTS_RECEIVABLE`, it is an invoice. // @@ -17536,9 +17409,10 @@ func (i *InvoiceCurrency) Accept(visitor InvoiceCurrencyVisitor) error { type InvoiceLineItem struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The line item's description. Description *string `json:"description,omitempty"` @@ -21148,9 +21022,10 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { type Item struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The item's name. Name *string `json:"name,omitempty"` @@ -21453,9 +21328,10 @@ func (i *ItemStatus) Accept(visitor ItemStatusVisitor) error { type JournalEntry struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The journal entry's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty"` @@ -23545,9 +23421,10 @@ func (j *JournalEntryTrackingCategoriesItem) Accept(visitor JournalEntryTracking type JournalLine struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` Account *JournalLineAccount `json:"account,omitempty"` // The value of the line item including taxes and other fees. @@ -25364,138 +25241,6 @@ func (l *LinkToken) String() string { return fmt.Sprintf("%#v", l) } -type LinkedAccountCondition struct { - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The common model for a specific condition. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - FieldName *string `json:"field_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountCondition) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountCondition - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountCondition(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountCondition) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountConditionRequest struct { - // The ID indicating which Linked Account Condition this is. - Id *string `json:"id,omitempty"` - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountConditionRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountConditionRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountConditionRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountConditionRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfiguration struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountCondition `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfiguration) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfiguration - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfiguration(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfiguration) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfigurationRequest struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountConditionRequest `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfigurationRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfigurationRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status"` CanMakeRequest bool `json:"can_make_request"` @@ -25815,38 +25560,6 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq } } -type OperatorSchema struct { - // The operator for which an operator schema is defined. - Operator *string `json:"operator,omitempty"` - // Whether the operator can be repeated multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - - _rawJSON json.RawMessage -} - -func (o *OperatorSchema) UnmarshalJSON(data []byte) error { - type unmarshaler OperatorSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *o = OperatorSchema(value) - o._rawJSON = json.RawMessage(data) - return nil -} - -func (o *OperatorSchema) String() string { - if len(o._rawJSON) > 0 { - if value, err := core.StringifyJSON(o._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(o); err == nil { - return value - } - return fmt.Sprintf("%#v", o) -} - type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -26095,37 +25808,6 @@ func (p *PaginatedCompanyInfoList) String() string { return fmt.Sprintf("%#v", p) } -type PaginatedConditionSchemaList struct { - Next *string `json:"next,omitempty"` - Previous *string `json:"previous,omitempty"` - Results []*ConditionSchema `json:"results,omitempty"` - - _rawJSON json.RawMessage -} - -func (p *PaginatedConditionSchemaList) UnmarshalJSON(data []byte) error { - type unmarshaler PaginatedConditionSchemaList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PaginatedConditionSchemaList(value) - p._rawJSON = json.RawMessage(data) - return nil -} - -func (p *PaginatedConditionSchemaList) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - type PaginatedContactList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -26921,7 +26603,12 @@ type PatchedPaymentRequest struct { // The company the payment belongs to. Company *PatchedPaymentRequestCompany `json:"company,omitempty"` // The total amount of money being paid to the supplier, or customer, after taxes. - TotalAmount *float64 `json:"total_amount,omitempty"` + TotalAmount *float64 `json:"total_amount,omitempty"` + // The type of the invoice. + // + // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE + Type *PatchedPaymentRequestType `json:"type,omitempty"` TrackingCategories []*PatchedPaymentRequestTrackingCategoriesItem `json:"tracking_categories,omitempty"` // The accounting period that the Payment was generated in. AccountingPeriod *PatchedPaymentRequestAccountingPeriod `json:"accounting_period,omitempty"` @@ -27667,6 +27354,67 @@ func (p *PatchedPaymentRequestTrackingCategoriesItem) Accept(visitor PatchedPaym } } +// The type of the invoice. +// +// - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE +// - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE +type PatchedPaymentRequestType struct { + typeName string + PaymentTypeEnum PaymentTypeEnum + String string +} + +func NewPatchedPaymentRequestTypeFromPaymentTypeEnum(value PaymentTypeEnum) *PatchedPaymentRequestType { + return &PatchedPaymentRequestType{typeName: "paymentTypeEnum", PaymentTypeEnum: value} +} + +func NewPatchedPaymentRequestTypeFromString(value string) *PatchedPaymentRequestType { + return &PatchedPaymentRequestType{typeName: "string", String: value} +} + +func (p *PatchedPaymentRequestType) UnmarshalJSON(data []byte) error { + var valuePaymentTypeEnum PaymentTypeEnum + if err := json.Unmarshal(data, &valuePaymentTypeEnum); err == nil { + p.typeName = "paymentTypeEnum" + p.PaymentTypeEnum = valuePaymentTypeEnum + return nil + } + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + p.typeName = "string" + p.String = valueString + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, p) +} + +func (p PatchedPaymentRequestType) MarshalJSON() ([]byte, error) { + switch p.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", p.typeName, p) + case "paymentTypeEnum": + return json.Marshal(p.PaymentTypeEnum) + case "string": + return json.Marshal(p.String) + } +} + +type PatchedPaymentRequestTypeVisitor interface { + VisitPaymentTypeEnum(PaymentTypeEnum) error + VisitString(string) error +} + +func (p *PatchedPaymentRequestType) Accept(visitor PatchedPaymentRequestTypeVisitor) error { + switch p.typeName { + default: + return fmt.Errorf("invalid type %s in %T", p.typeName, p) + case "paymentTypeEnum": + return visitor.VisitPaymentTypeEnum(p.PaymentTypeEnum) + case "string": + return visitor.VisitString(p.String) + } +} + // # The Payment Object // // ### Description @@ -27679,9 +27427,10 @@ func (p *PatchedPaymentRequestTrackingCategoriesItem) Accept(visitor PatchedPaym type Payment struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The payment's transaction date. TransactionDate *time.Time `json:"transaction_date,omitempty"` @@ -28003,7 +27752,12 @@ type Payment struct { // The company the payment belongs to. Company *PaymentCompany `json:"company,omitempty"` // The total amount of money being paid to the supplier, or customer, after taxes. - TotalAmount *float64 `json:"total_amount,omitempty"` + TotalAmount *float64 `json:"total_amount,omitempty"` + // The type of the invoice. + // + // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE + Type *PaymentType `json:"type,omitempty"` TrackingCategories []*PaymentTrackingCategoriesItem `json:"tracking_categories,omitempty"` // When the third party's payment entry was updated. RemoteUpdatedAt *time.Time `json:"remote_updated_at,omitempty"` @@ -28708,9 +28462,10 @@ func (p *PaymentCurrency) Accept(visitor PaymentCurrencyVisitor) error { type PaymentLineItem struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The amount being applied to the transaction. AppliedAmount *string `json:"applied_amount,omitempty"` @@ -29126,7 +28881,12 @@ type PaymentRequest struct { // The company the payment belongs to. Company *PaymentRequestCompany `json:"company,omitempty"` // The total amount of money being paid to the supplier, or customer, after taxes. - TotalAmount *float64 `json:"total_amount,omitempty"` + TotalAmount *float64 `json:"total_amount,omitempty"` + // The type of the invoice. + // + // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE + // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE + Type *PaymentRequestType `json:"type,omitempty"` TrackingCategories []*PaymentRequestTrackingCategoriesItem `json:"tracking_categories,omitempty"` // The accounting period that the Payment was generated in. AccountingPeriod *PaymentRequestAccountingPeriod `json:"accounting_period,omitempty"` @@ -29872,6 +29632,67 @@ func (p *PaymentRequestTrackingCategoriesItem) Accept(visitor PaymentRequestTrac } } +// The type of the invoice. +// +// - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE +// - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE +type PaymentRequestType struct { + typeName string + PaymentTypeEnum PaymentTypeEnum + String string +} + +func NewPaymentRequestTypeFromPaymentTypeEnum(value PaymentTypeEnum) *PaymentRequestType { + return &PaymentRequestType{typeName: "paymentTypeEnum", PaymentTypeEnum: value} +} + +func NewPaymentRequestTypeFromString(value string) *PaymentRequestType { + return &PaymentRequestType{typeName: "string", String: value} +} + +func (p *PaymentRequestType) UnmarshalJSON(data []byte) error { + var valuePaymentTypeEnum PaymentTypeEnum + if err := json.Unmarshal(data, &valuePaymentTypeEnum); err == nil { + p.typeName = "paymentTypeEnum" + p.PaymentTypeEnum = valuePaymentTypeEnum + return nil + } + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + p.typeName = "string" + p.String = valueString + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, p) +} + +func (p PaymentRequestType) MarshalJSON() ([]byte, error) { + switch p.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", p.typeName, p) + case "paymentTypeEnum": + return json.Marshal(p.PaymentTypeEnum) + case "string": + return json.Marshal(p.String) + } +} + +type PaymentRequestTypeVisitor interface { + VisitPaymentTypeEnum(PaymentTypeEnum) error + VisitString(string) error +} + +func (p *PaymentRequestType) Accept(visitor PaymentRequestTypeVisitor) error { + switch p.typeName { + default: + return fmt.Errorf("invalid type %s in %T", p.typeName, p) + case "paymentTypeEnum": + return visitor.VisitPaymentTypeEnum(p.PaymentTypeEnum) + case "string": + return visitor.VisitString(p.String) + } +} + type PaymentResponse struct { Model *Payment `json:"model,omitempty"` Warnings []*WarningValidationProblem `json:"warnings,omitempty"` @@ -29961,6 +29782,91 @@ func (p *PaymentTrackingCategoriesItem) Accept(visitor PaymentTrackingCategories } } +// The type of the invoice. +// +// - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE +// - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE +type PaymentType struct { + typeName string + PaymentTypeEnum PaymentTypeEnum + String string +} + +func NewPaymentTypeFromPaymentTypeEnum(value PaymentTypeEnum) *PaymentType { + return &PaymentType{typeName: "paymentTypeEnum", PaymentTypeEnum: value} +} + +func NewPaymentTypeFromString(value string) *PaymentType { + return &PaymentType{typeName: "string", String: value} +} + +func (p *PaymentType) UnmarshalJSON(data []byte) error { + var valuePaymentTypeEnum PaymentTypeEnum + if err := json.Unmarshal(data, &valuePaymentTypeEnum); err == nil { + p.typeName = "paymentTypeEnum" + p.PaymentTypeEnum = valuePaymentTypeEnum + return nil + } + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + p.typeName = "string" + p.String = valueString + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, p) +} + +func (p PaymentType) MarshalJSON() ([]byte, error) { + switch p.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", p.typeName, p) + case "paymentTypeEnum": + return json.Marshal(p.PaymentTypeEnum) + case "string": + return json.Marshal(p.String) + } +} + +type PaymentTypeVisitor interface { + VisitPaymentTypeEnum(PaymentTypeEnum) error + VisitString(string) error +} + +func (p *PaymentType) Accept(visitor PaymentTypeVisitor) error { + switch p.typeName { + default: + return fmt.Errorf("invalid type %s in %T", p.typeName, p) + case "paymentTypeEnum": + return visitor.VisitPaymentTypeEnum(p.PaymentTypeEnum) + case "string": + return visitor.VisitString(p.String) + } +} + +// - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE +// - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE +type PaymentTypeEnum string + +const ( + PaymentTypeEnumAccountsPayable PaymentTypeEnum = "ACCOUNTS_PAYABLE" + PaymentTypeEnumAccountsReceivable PaymentTypeEnum = "ACCOUNTS_RECEIVABLE" +) + +func NewPaymentTypeEnumFromString(s string) (PaymentTypeEnum, error) { + switch s { + case "ACCOUNTS_PAYABLE": + return PaymentTypeEnumAccountsPayable, nil + case "ACCOUNTS_RECEIVABLE": + return PaymentTypeEnumAccountsReceivable, nil + } + var t PaymentTypeEnum + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p PaymentTypeEnum) Ptr() *PaymentTypeEnum { + return &p +} + // - `UNPOSTED` - UNPOSTED // - `POSTED` - POSTED type PostingStatusEnum string @@ -29999,9 +29905,10 @@ func (p PostingStatusEnum) Ptr() *PostingStatusEnum { type PurchaseOrder struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The purchase order's status. // @@ -30930,9 +30837,10 @@ func (p *PurchaseOrderDeliveryAddress) Accept(visitor PurchaseOrderDeliveryAddre type PurchaseOrderLineItem struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // A description of the good being purchased. Description *string `json:"description,omitempty"` @@ -33853,11 +33761,12 @@ func (r *RemoteEndpointInfo) String() string { } type RemoteFieldApi struct { - Schema map[string]interface{} `json:"schema,omitempty"` - RemoteKeyName string `json:"remote_key_name"` - RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` - ExampleValues []interface{} `json:"example_values,omitempty"` - AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteKeyName string `json:"remote_key_name"` + RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + ExampleValues []interface{} `json:"example_values,omitempty"` + AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty"` _rawJSON json.RawMessage } @@ -33885,6 +33794,63 @@ func (r *RemoteFieldApi) String() string { return fmt.Sprintf("%#v", r) } +type RemoteFieldApiCoverage struct { + typeName string + Integer int + Double float64 +} + +func NewRemoteFieldApiCoverageFromInteger(value int) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "integer", Integer: value} +} + +func NewRemoteFieldApiCoverageFromDouble(value float64) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "double", Double: value} +} + +func (r *RemoteFieldApiCoverage) UnmarshalJSON(data []byte) error { + var valueInteger int + if err := json.Unmarshal(data, &valueInteger); err == nil { + r.typeName = "integer" + r.Integer = valueInteger + return nil + } + var valueDouble float64 + if err := json.Unmarshal(data, &valueDouble); err == nil { + r.typeName = "double" + r.Double = valueDouble + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, r) +} + +func (r RemoteFieldApiCoverage) MarshalJSON() ([]byte, error) { + switch r.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return json.Marshal(r.Integer) + case "double": + return json.Marshal(r.Double) + } +} + +type RemoteFieldApiCoverageVisitor interface { + VisitInteger(int) error + VisitDouble(float64) error +} + +func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) error { + switch r.typeName { + default: + return fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return visitor.VisitInteger(r.Integer) + case "double": + return visitor.VisitDouble(r.Double) + } +} + type RemoteFieldApiResponse struct { Account []*RemoteFieldApi `json:"Account,omitempty"` AccountingAttachment []*RemoteFieldApi `json:"AccountingAttachment,omitempty"` @@ -34026,9 +33992,10 @@ func (r *RemoteResponse) String() string { // Fetch from the `GET BalanceSheet` endpoint and view the balance sheet's report items. type ReportItem struct { // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The report item's name. Name *string `json:"name,omitempty"` @@ -34300,17 +34267,18 @@ func (s SyncStatusStatusEnum) Ptr() *SyncStatusStatusEnum { type TaxRate struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The tax rate's description. Description *string `json:"description,omitempty"` - // The tax rate's total tax rate. + // The tax’s total tax rate - sum of the tax components (not compounded). TotalTaxRate *float64 `json:"total_tax_rate,omitempty"` - // The tax rate's effective tax rate. + // The tax rate’s effective tax rate - total amount of tax with compounding. EffectiveTaxRate *float64 `json:"effective_tax_rate,omitempty"` - // The company the tax rate belongs to. + // The subsidiary that the tax rate belongs to (in the case of multi-entity systems). Company *TaxRateCompany `json:"company,omitempty"` // Indicates whether or not this object has been deleted in the third party platform. RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty"` @@ -34343,7 +34311,7 @@ func (t *TaxRate) String() string { return fmt.Sprintf("%#v", t) } -// The company the tax rate belongs to. +// The subsidiary that the tax rate belongs to (in the case of multi-entity systems). type TaxRateCompany struct { typeName string String string @@ -34413,9 +34381,10 @@ func (t *TaxRateCompany) Accept(visitor TaxRateCompanyVisitor) error { type TrackingCategory struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The tracking category's name. Name *string `json:"name,omitempty"` @@ -34664,9 +34633,10 @@ func (t *TrackingCategoryStatus) Accept(visitor TrackingCategoryStatusVisitor) e type Transaction struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The type of transaction, which can by any transaction object not already included in Merge’s common model. TransactionType *string `json:"transaction_type,omitempty"` @@ -35579,9 +35549,10 @@ func (t *TransactionCurrency) Accept(visitor TransactionCurrencyVisitor) error { type TransactionLineItem struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // An internal note used by the business to clarify purpose of the transaction. Memo *string `json:"memo,omitempty"` @@ -35598,8 +35569,7 @@ type TransactionLineItem struct { TrackingCategories []string `json:"tracking_categories,omitempty"` // The line item's total. TotalLineAmount *string `json:"total_line_amount,omitempty"` - // The line item's tax rate. - TaxRate *string `json:"tax_rate,omitempty"` + TaxRate *string `json:"tax_rate,omitempty"` // The line item's currency. // // - `XUA` - ADB Unit of Account @@ -36462,9 +36432,10 @@ func (v *ValidationProblemSource) String() string { type VendorCredit struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The vendor credit's number. Number *string `json:"number,omitempty"` @@ -37315,9 +37286,10 @@ func (v *VendorCreditCurrency) Accept(visitor VendorCreditCurrencyVisitor) error type VendorCreditLine struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The full value of the credit. NetAmount *float64 `json:"net_amount,omitempty"` diff --git a/ats/audit_trail.go b/ats/audit_trail.go index 8b38d6b..49148a3 100644 --- a/ats/audit_trail.go +++ b/ats/audit_trail.go @@ -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` + // 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` EventType *string `json:"-"` // Number of results to return per page. PageSize *int `json:"-"` diff --git a/ats/client/client.go b/ats/client/client.go index 4ae3cfc..cb5e47d 100644 --- a/ats/client/client.go +++ b/ats/client/client.go @@ -32,7 +32,6 @@ import ( rejectreasons "github.com/merge-api/merge-go-client/ats/rejectreasons" scopes "github.com/merge-api/merge-go-client/ats/scopes" scorecards "github.com/merge-api/merge-go-client/ats/scorecards" - selectivesync "github.com/merge-api/merge-go-client/ats/selectivesync" syncstatus "github.com/merge-api/merge-go-client/ats/syncstatus" tags "github.com/merge-api/merge-go-client/ats/tags" users "github.com/merge-api/merge-go-client/ats/users" @@ -74,7 +73,6 @@ type Client struct { RegenerateKey *regeneratekey.Client RejectReasons *rejectreasons.Client Scorecards *scorecards.Client - SelectiveSync *selectivesync.Client SyncStatus *syncstatus.Client ForceResync *forceresync.Client Tags *tags.Client @@ -119,7 +117,6 @@ func NewClient(opts ...core.ClientOption) *Client { RegenerateKey: regeneratekey.NewClient(opts...), RejectReasons: rejectreasons.NewClient(opts...), Scorecards: scorecards.NewClient(opts...), - SelectiveSync: selectivesync.NewClient(opts...), SyncStatus: syncstatus.NewClient(opts...), ForceResync: forceresync.NewClient(opts...), Tags: tags.NewClient(opts...), diff --git a/ats/job_postings.go b/ats/job_postings.go index b26c158..e269562 100644 --- a/ats/job_postings.go +++ b/ats/job_postings.go @@ -14,6 +14,8 @@ type JobPostingsListRequest struct { 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:"-"` // Whether to include data that was marked as deleted by third party webhooks. IncludeDeletedData *bool `json:"-"` // Whether to include the original data Merge fetched from the third-party to produce these models. @@ -37,6 +39,8 @@ type JobPostingsListRequest struct { } type JobPostingsRetrieveRequest 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:"-"` } diff --git a/ats/jobpostings/client.go b/ats/jobpostings/client.go index e9f99d6..af557bc 100644 --- a/ats/jobpostings/client.go +++ b/ats/jobpostings/client.go @@ -48,6 +48,9 @@ func (c *Client) List(ctx context.Context, request *ats.JobPostingsListRequest) if request.Cursor != nil { queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) } + if request.Expand != nil { + queryParams.Add("expand", fmt.Sprintf("%v", request.Expand)) + } if request.IncludeDeletedData != nil { queryParams.Add("include_deleted_data", fmt.Sprintf("%v", *request.IncludeDeletedData)) } @@ -97,6 +100,9 @@ func (c *Client) Retrieve(ctx context.Context, id string, request *ats.JobPostin endpointURL := fmt.Sprintf(baseURL+"/"+"ats/v1/job-postings/%v", id) queryParams := make(url.Values) + if request.Expand != nil { + queryParams.Add("expand", fmt.Sprintf("%v", request.Expand)) + } if request.IncludeRemoteData != nil { queryParams.Add("include_remote_data", fmt.Sprintf("%v", *request.IncludeRemoteData)) } diff --git a/ats/link_token.go b/ats/link_token.go index aafda3a..7b3f831 100644 --- a/ats/link_token.go +++ b/ats/link_token.go @@ -23,4 +23,6 @@ type EndUserDetailsRequest struct { CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` // The language code for the language to localize Merge Link to. Language *string `json:"language,omitempty"` + // A JSON object containing integration-specific configuration options. + IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty"` } diff --git a/ats/selective_sync.go b/ats/selective_sync.go deleted file mode 100644 index 429ae8f..0000000 --- a/ats/selective_sync.go +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package ats - -type LinkedAccountSelectiveSyncConfigurationListRequest struct { - // The selective syncs associated with a linked account. - SyncConfigurations []*LinkedAccountSelectiveSyncConfigurationRequest `json:"sync_configurations,omitempty"` -} - -type SelectiveSyncMetaListRequest struct { - CommonModel *string `json:"-"` - // The pagination cursor value. - Cursor *string `json:"-"` - // Number of results to return per page. - PageSize *int `json:"-"` -} diff --git a/ats/selectivesync/client.go b/ats/selectivesync/client.go deleted file mode 100644 index 9d17a01..0000000 --- a/ats/selectivesync/client.go +++ /dev/null @@ -1,114 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package selectivesync - -import ( - context "context" - fmt "fmt" - ats "github.com/merge-api/merge-go-client/ats" - core "github.com/merge-api/merge-go-client/core" - http "net/http" - url "net/url" -) - -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(), - } -} - -// Get a linked account's selective syncs. -func (c *Client) ConfigurationsList(ctx context.Context) ([]*ats.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "ats/v1/selective-sync/configurations" - - var response []*ats.LinkedAccountSelectiveSyncConfiguration - 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 -} - -// Replace a linked account's selective syncs. -func (c *Client) ConfigurationsUpdate(ctx context.Context, request *ats.LinkedAccountSelectiveSyncConfigurationListRequest) ([]*ats.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "ats/v1/selective-sync/configurations" - - var response []*ats.LinkedAccountSelectiveSyncConfiguration - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// Get metadata for the conditions available to a linked account. -func (c *Client) MetaList(ctx context.Context, request *ats.SelectiveSyncMetaListRequest) (*ats.PaginatedConditionSchemaList, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "ats/v1/selective-sync/meta" - - queryParams := make(url.Values) - if request.CommonModel != nil { - queryParams.Add("common_model", fmt.Sprintf("%v", *request.CommonModel)) - } - if request.Cursor != nil { - queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) - } - if request.PageSize != nil { - queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *ats.PaginatedConditionSchemaList - 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 -} diff --git a/ats/types.go b/ats/types.go index 4b9f1c1..f54784d 100644 --- a/ats/types.go +++ b/ats/types.go @@ -287,9 +287,10 @@ func (a *AccountToken) String() string { type Activity struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The user that performed the action. User *ActivityUser `json:"user,omitempty"` @@ -873,9 +874,10 @@ func (a *AdvancedMetadata) String() string { type Application struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The candidate applying. Candidate *ApplicationCandidate `json:"candidate,omitempty"` @@ -1748,9 +1750,10 @@ func (a *AsyncPassthroughReciept) String() string { type Attachment struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The attachment's name. FileName *string `json:"file_name,omitempty"` @@ -2087,6 +2090,9 @@ type AuditLogEvent struct { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + // - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + // - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + // - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED EventType *AuditLogEventEventType `json:"event_type,omitempty"` EventDescription string `json:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty"` @@ -2153,6 +2159,9 @@ func (a *AuditLogEvent) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type AuditLogEventEventType struct { typeName string EventTypeEnum EventTypeEnum @@ -2327,9 +2336,10 @@ func (a *AvailableActions) String() string { type Candidate struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The candidate's first name. FirstName *string `json:"first_name,omitempty"` @@ -2864,164 +2874,6 @@ func (c *CommonModelScopesBodyRequest) String() string { return fmt.Sprintf("%#v", c) } -type ConditionSchema struct { - // The ID of the condition schema. This ID is used when updating selective syncs for a linked account. - Id string `json:"id"` - // The common model for which a condition schema is defined. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - FieldName *string `json:"field_name,omitempty"` - // Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - // The type of value(s) that can be set for this condition. - // - // - `BOOLEAN` - BOOLEAN - // - `DATE` - DATE - // - `DATE_TIME` - DATE_TIME - // - `INTEGER` - INTEGER - // - `FLOAT` - FLOAT - // - `STRING` - STRING - // - `LIST_OF_STRINGS` - LIST_OF_STRINGS - ConditionType *ConditionSchemaConditionType `json:"condition_type,omitempty"` - // The schemas for the operators that can be used on a condition. - Operators []*OperatorSchema `json:"operators,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *ConditionSchema) UnmarshalJSON(data []byte) error { - type unmarshaler ConditionSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConditionSchema(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConditionSchema) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -// The type of value(s) that can be set for this condition. -// -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionSchemaConditionType struct { - typeName string - ConditionTypeEnum ConditionTypeEnum - String string -} - -func NewConditionSchemaConditionTypeFromConditionTypeEnum(value ConditionTypeEnum) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "conditionTypeEnum", ConditionTypeEnum: value} -} - -func NewConditionSchemaConditionTypeFromString(value string) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "string", String: value} -} - -func (c *ConditionSchemaConditionType) UnmarshalJSON(data []byte) error { - var valueConditionTypeEnum ConditionTypeEnum - if err := json.Unmarshal(data, &valueConditionTypeEnum); err == nil { - c.typeName = "conditionTypeEnum" - c.ConditionTypeEnum = valueConditionTypeEnum - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) -} - -func (c ConditionSchemaConditionType) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return json.Marshal(c.ConditionTypeEnum) - case "string": - return json.Marshal(c.String) - } -} - -type ConditionSchemaConditionTypeVisitor interface { - VisitConditionTypeEnum(ConditionTypeEnum) error - VisitString(string) error -} - -func (c *ConditionSchemaConditionType) Accept(visitor ConditionSchemaConditionTypeVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return visitor.VisitConditionTypeEnum(c.ConditionTypeEnum) - case "string": - return visitor.VisitString(c.String) - } -} - -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionTypeEnum string - -const ( - ConditionTypeEnumBoolean ConditionTypeEnum = "BOOLEAN" - ConditionTypeEnumDate ConditionTypeEnum = "DATE" - ConditionTypeEnumDateTime ConditionTypeEnum = "DATE_TIME" - ConditionTypeEnumInteger ConditionTypeEnum = "INTEGER" - ConditionTypeEnumFloat ConditionTypeEnum = "FLOAT" - ConditionTypeEnumString ConditionTypeEnum = "STRING" - ConditionTypeEnumListOfStrings ConditionTypeEnum = "LIST_OF_STRINGS" -) - -func NewConditionTypeEnumFromString(s string) (ConditionTypeEnum, error) { - switch s { - case "BOOLEAN": - return ConditionTypeEnumBoolean, nil - case "DATE": - return ConditionTypeEnumDate, nil - case "DATE_TIME": - return ConditionTypeEnumDateTime, nil - case "INTEGER": - return ConditionTypeEnumInteger, nil - case "FLOAT": - return ConditionTypeEnumFloat, nil - case "STRING": - return ConditionTypeEnumString, nil - case "LIST_OF_STRINGS": - return ConditionTypeEnumListOfStrings, nil - } - var t ConditionTypeEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { - return &c -} - // # The DataPassthrough Object // // ### Description @@ -3147,9 +2999,10 @@ func (d *DebugModelLogSummary) String() string { type Department struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The department's name. Name *string `json:"name,omitempty"` @@ -3224,9 +3077,10 @@ func (d DisabilityStatusEnum) Ptr() *DisabilityStatusEnum { type Eeoc struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The candidate being represented. Candidate *EeocCandidate `json:"candidate,omitempty"` @@ -3617,8 +3471,9 @@ func (e *EeocVeteranStatus) Accept(visitor EeocVeteranStatusVisitor) error { // // Fetch from the `GET Candidate` endpoint and view their email addresses. type EmailAddress struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The email address. Value *string `json:"value,omitempty"` @@ -3972,6 +3827,9 @@ func (e *ErrorValidationProblem) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type EventTypeEnum string const ( @@ -4009,6 +3867,9 @@ const ( EventTypeEnumForcedLinkedAccountResync EventTypeEnum = "FORCED_LINKED_ACCOUNT_RESYNC" EventTypeEnumMutedIssue EventTypeEnum = "MUTED_ISSUE" EventTypeEnumGeneratedMagicLink EventTypeEnum = "GENERATED_MAGIC_LINK" + EventTypeEnumEnabledMergeWebhook EventTypeEnum = "ENABLED_MERGE_WEBHOOK" + EventTypeEnumDisabledMergeWebhook EventTypeEnum = "DISABLED_MERGE_WEBHOOK" + EventTypeEnumMergeWebhookTargetChanged EventTypeEnum = "MERGE_WEBHOOK_TARGET_CHANGED" ) func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { @@ -4081,6 +3942,12 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumMutedIssue, nil case "GENERATED_MAGIC_LINK": return EventTypeEnumGeneratedMagicLink, nil + case "ENABLED_MERGE_WEBHOOK": + return EventTypeEnumEnabledMergeWebhook, nil + case "DISABLED_MERGE_WEBHOOK": + return EventTypeEnumDisabledMergeWebhook, nil + case "MERGE_WEBHOOK_TARGET_CHANGED": + return EventTypeEnumMergeWebhookTargetChanged, nil } var t EventTypeEnum return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -4661,9 +4528,10 @@ func (i IssueStatusEnum) Ptr() *IssueStatusEnum { type Job struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The job's name. Name *string `json:"name,omitempty"` @@ -4859,9 +4727,10 @@ func (j *JobHiringManagersItem) Accept(visitor JobHiringManagersItemVisitor) err type JobInterviewStage struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // Standard stage names are offered by ATS systems but can be modified by users. Name *string `json:"name,omitempty"` @@ -5027,9 +4896,10 @@ func (j *JobOfficesItem) Accept(visitor JobOfficesItemVisitor) error { type JobPosting struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The job posting’s title. Title *string `json:"title,omitempty"` @@ -5451,138 +5321,6 @@ func (l *LinkToken) String() string { return fmt.Sprintf("%#v", l) } -type LinkedAccountCondition struct { - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The common model for a specific condition. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - FieldName *string `json:"field_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountCondition) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountCondition - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountCondition(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountCondition) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountConditionRequest struct { - // The ID indicating which Linked Account Condition this is. - Id *string `json:"id,omitempty"` - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountConditionRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountConditionRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountConditionRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountConditionRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfiguration struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountCondition `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfiguration) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfiguration - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfiguration(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfiguration) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfigurationRequest struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountConditionRequest `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfigurationRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfigurationRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status"` CanMakeRequest bool `json:"can_make_request"` @@ -5914,9 +5652,10 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq type Offer struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The application who is receiving the offer. Application *OfferApplication `json:"application,omitempty"` @@ -6221,9 +5960,10 @@ func (o OfferStatusEnum) Ptr() *OfferStatusEnum { type Office struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The office's name. Name *string `json:"name,omitempty"` @@ -6260,38 +6000,6 @@ func (o *Office) String() string { return fmt.Sprintf("%#v", o) } -type OperatorSchema struct { - // The operator for which an operator schema is defined. - Operator *string `json:"operator,omitempty"` - // Whether the operator can be repeated multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - - _rawJSON json.RawMessage -} - -func (o *OperatorSchema) UnmarshalJSON(data []byte) error { - type unmarshaler OperatorSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *o = OperatorSchema(value) - o._rawJSON = json.RawMessage(data) - return nil -} - -func (o *OperatorSchema) String() string { - if len(o._rawJSON) > 0 { - if value, err := core.StringifyJSON(o._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(o); err == nil { - return value - } - return fmt.Sprintf("%#v", o) -} - // - `DEFINITELY_NO` - DEFINITELY_NO // - `NO` - NO // - `YES` - YES @@ -6514,37 +6222,6 @@ func (p *PaginatedCandidateList) String() string { return fmt.Sprintf("%#v", p) } -type PaginatedConditionSchemaList struct { - Next *string `json:"next,omitempty"` - Previous *string `json:"previous,omitempty"` - Results []*ConditionSchema `json:"results,omitempty"` - - _rawJSON json.RawMessage -} - -func (p *PaginatedConditionSchemaList) UnmarshalJSON(data []byte) error { - type unmarshaler PaginatedConditionSchemaList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PaginatedConditionSchemaList(value) - p._rawJSON = json.RawMessage(data) - return nil -} - -func (p *PaginatedConditionSchemaList) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - type PaginatedDepartmentList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -7085,8 +6762,9 @@ func (p *PatchedCandidateRequest) String() string { // // Fetch from the `GET Candidate` endpoint and view their phone numbers. type PhoneNumber struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The phone number. Value *string `json:"value,omitempty"` @@ -7426,9 +7104,10 @@ func (r ReasonEnum) Ptr() *ReasonEnum { type RejectReason struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The rejection reason’s name. Name *string `json:"name,omitempty"` @@ -7525,11 +7204,12 @@ func (r *RemoteEndpointInfo) String() string { } type RemoteFieldApi struct { - Schema map[string]interface{} `json:"schema,omitempty"` - RemoteKeyName string `json:"remote_key_name"` - RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` - ExampleValues []interface{} `json:"example_values,omitempty"` - AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteKeyName string `json:"remote_key_name"` + RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + ExampleValues []interface{} `json:"example_values,omitempty"` + AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty"` _rawJSON json.RawMessage } @@ -7557,6 +7237,63 @@ func (r *RemoteFieldApi) String() string { return fmt.Sprintf("%#v", r) } +type RemoteFieldApiCoverage struct { + typeName string + Integer int + Double float64 +} + +func NewRemoteFieldApiCoverageFromInteger(value int) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "integer", Integer: value} +} + +func NewRemoteFieldApiCoverageFromDouble(value float64) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "double", Double: value} +} + +func (r *RemoteFieldApiCoverage) UnmarshalJSON(data []byte) error { + var valueInteger int + if err := json.Unmarshal(data, &valueInteger); err == nil { + r.typeName = "integer" + r.Integer = valueInteger + return nil + } + var valueDouble float64 + if err := json.Unmarshal(data, &valueDouble); err == nil { + r.typeName = "double" + r.Double = valueDouble + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, r) +} + +func (r RemoteFieldApiCoverage) MarshalJSON() ([]byte, error) { + switch r.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return json.Marshal(r.Integer) + case "double": + return json.Marshal(r.Double) + } +} + +type RemoteFieldApiCoverageVisitor interface { + VisitInteger(int) error + VisitDouble(float64) error +} + +func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) error { + switch r.typeName { + default: + return fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return visitor.VisitInteger(r.Integer) + case "double": + return visitor.VisitDouble(r.Double) + } +} + type RemoteFieldApiResponse struct { Activity []*RemoteFieldApi `json:"Activity,omitempty"` Application []*RemoteFieldApi `json:"Application,omitempty"` @@ -7753,9 +7490,10 @@ func (r *RemoteResponseResponseType) Accept(visitor RemoteResponseResponseTypeVi type RemoteUser struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The user's first name. FirstName *string `json:"first_name,omitempty"` @@ -7974,9 +7712,10 @@ func (r RoleEnum) Ptr() *RoleEnum { type ScheduledInterview struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The application being interviewed. Application *ScheduledInterviewApplication `json:"application,omitempty"` @@ -8750,9 +8489,10 @@ func (s ScheduledInterviewStatusEnum) Ptr() *ScheduledInterviewStatusEnum { type Scorecard struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The application being scored. Application *ScorecardApplication `json:"application,omitempty"` @@ -9053,9 +8793,10 @@ func (s *ScorecardOverallRecommendation) Accept(visitor ScorecardOverallRecommen type ScreeningQuestion struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The job associated with the screening question. Job *ScreeningQuestionJob `json:"job,omitempty"` @@ -9174,9 +8915,10 @@ func (s *ScreeningQuestionJob) Accept(visitor ScreeningQuestionJobVisitor) error type ScreeningQuestionOption struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // Available response options Label *string `json:"label,omitempty"` @@ -9441,9 +9183,10 @@ func (s SyncStatusStatusEnum) Ptr() *SyncStatusStatusEnum { // Fetch from the `LIST Tags` endpoint and view the tags used within a company. type Tag struct { // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The tag's name. Name *string `json:"name,omitempty"` @@ -9488,8 +9231,9 @@ func (t *Tag) String() string { // // Fetch from the `GET Candidate` endpoint and view their website urls. type Url struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The site's url. Value *string `json:"value,omitempty"` diff --git a/client/client.go b/client/client.go index 0d4b056..2495a58 100644 --- a/client/client.go +++ b/client/client.go @@ -19,9 +19,9 @@ type Client struct { header http.Header Ats *atsclient.Client - Filestorage *filestorageclient.Client Crm *crmclient.Client Hris *hrisclient.Client + Filestorage *filestorageclient.Client Ticketing *ticketingclient.Client Accounting *accountingclient.Client } @@ -36,9 +36,9 @@ func NewClient(opts ...core.ClientOption) *Client { caller: core.NewCaller(options.HTTPClient), header: options.ToHeader(), Ats: atsclient.NewClient(opts...), - Filestorage: filestorageclient.NewClient(opts...), Crm: crmclient.NewClient(opts...), Hris: hrisclient.NewClient(opts...), + Filestorage: filestorageclient.NewClient(opts...), Ticketing: ticketingclient.NewClient(opts...), Accounting: accountingclient.NewClient(opts...), } diff --git a/core/client_option.go b/core/client_option.go index 7c55cb1..66c5136 100644 --- a/core/client_option.go +++ b/core/client_option.go @@ -48,6 +48,6 @@ func (c *ClientOptions) cloneHeader() http.Header { headers := c.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/merge-api/merge-go-client") - headers.Set("X-Fern-SDK-Version", "v1.0.7") + headers.Set("X-Fern-SDK-Version", "v1.0.8") return headers } diff --git a/crm/audit_trail.go b/crm/audit_trail.go index d09a4b5..33f052e 100644 --- a/crm/audit_trail.go +++ b/crm/audit_trail.go @@ -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` + // 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` EventType *string `json:"-"` // Number of results to return per page. PageSize *int `json:"-"` diff --git a/crm/client/client.go b/crm/client/client.go index 16780c1..c4b5c6f 100644 --- a/crm/client/client.go +++ b/crm/client/client.go @@ -30,7 +30,6 @@ import ( passthrough "github.com/merge-api/merge-go-client/crm/passthrough" regeneratekey "github.com/merge-api/merge-go-client/crm/regeneratekey" scopes "github.com/merge-api/merge-go-client/crm/scopes" - selectivesync "github.com/merge-api/merge-go-client/crm/selectivesync" stages "github.com/merge-api/merge-go-client/crm/stages" syncstatus "github.com/merge-api/merge-go-client/crm/syncstatus" tasks "github.com/merge-api/merge-go-client/crm/tasks" @@ -69,7 +68,6 @@ type Client struct { Opportunities *opportunities.Client Passthrough *passthrough.Client RegenerateKey *regeneratekey.Client - SelectiveSync *selectivesync.Client Stages *stages.Client SyncStatus *syncstatus.Client ForceResync *forceresync.Client @@ -112,7 +110,6 @@ func NewClient(opts ...core.ClientOption) *Client { Opportunities: opportunities.NewClient(opts...), Passthrough: passthrough.NewClient(opts...), RegenerateKey: regeneratekey.NewClient(opts...), - SelectiveSync: selectivesync.NewClient(opts...), Stages: stages.NewClient(opts...), SyncStatus: syncstatus.NewClient(opts...), ForceResync: forceresync.NewClient(opts...), diff --git a/crm/link_token.go b/crm/link_token.go index 653f648..156e9b7 100644 --- a/crm/link_token.go +++ b/crm/link_token.go @@ -23,4 +23,6 @@ type EndUserDetailsRequest struct { CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` // The language code for the language to localize Merge Link to. Language *string `json:"language,omitempty"` + // A JSON object containing integration-specific configuration options. + IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty"` } diff --git a/crm/selective_sync.go b/crm/selective_sync.go deleted file mode 100644 index 2382747..0000000 --- a/crm/selective_sync.go +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package crm - -type LinkedAccountSelectiveSyncConfigurationListRequest struct { - // The selective syncs associated with a linked account. - SyncConfigurations []*LinkedAccountSelectiveSyncConfigurationRequest `json:"sync_configurations,omitempty"` -} - -type SelectiveSyncMetaListRequest struct { - CommonModel *string `json:"-"` - // The pagination cursor value. - Cursor *string `json:"-"` - // Number of results to return per page. - PageSize *int `json:"-"` -} diff --git a/crm/selectivesync/client.go b/crm/selectivesync/client.go deleted file mode 100644 index 56b9246..0000000 --- a/crm/selectivesync/client.go +++ /dev/null @@ -1,114 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package selectivesync - -import ( - context "context" - fmt "fmt" - core "github.com/merge-api/merge-go-client/core" - crm "github.com/merge-api/merge-go-client/crm" - http "net/http" - url "net/url" -) - -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(), - } -} - -// Get a linked account's selective syncs. -func (c *Client) ConfigurationsList(ctx context.Context) ([]*crm.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "crm/v1/selective-sync/configurations" - - var response []*crm.LinkedAccountSelectiveSyncConfiguration - 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 -} - -// Replace a linked account's selective syncs. -func (c *Client) ConfigurationsUpdate(ctx context.Context, request *crm.LinkedAccountSelectiveSyncConfigurationListRequest) ([]*crm.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "crm/v1/selective-sync/configurations" - - var response []*crm.LinkedAccountSelectiveSyncConfiguration - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// Get metadata for the conditions available to a linked account. -func (c *Client) MetaList(ctx context.Context, request *crm.SelectiveSyncMetaListRequest) (*crm.PaginatedConditionSchemaList, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "crm/v1/selective-sync/meta" - - queryParams := make(url.Values) - if request.CommonModel != nil { - queryParams.Add("common_model", fmt.Sprintf("%v", *request.CommonModel)) - } - if request.Cursor != nil { - queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) - } - if request.PageSize != nil { - queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *crm.PaginatedConditionSchemaList - 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 -} diff --git a/crm/types.go b/crm/types.go index a7b1f79..de0381c 100644 --- a/crm/types.go +++ b/crm/types.go @@ -21,9 +21,10 @@ import ( type Account struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The account's owner. Owner *AccountOwner `json:"owner,omitempty"` @@ -355,7 +356,8 @@ type AccountRequest struct { // The account's website. Website *string `json:"website,omitempty"` // The account's number of employees. - NumberOfEmployees *int `json:"number_of_employees,omitempty"` + NumberOfEmployees *int `json:"number_of_employees,omitempty"` + Addresses []*AddressRequest `json:"addresses,omitempty"` // The last date (either most recent or furthest in the future) of when an activity occurs in an account. LastActivityAt *time.Time `json:"last_activity_at,omitempty"` IntegrationParams map[string]interface{} `json:"integration_params,omitempty"` @@ -514,8 +516,9 @@ func (a ActivityTypeEnum) Ptr() *ActivityTypeEnum { // // TODO type Address struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // Line 1 of the address's street. Street1 *string `json:"street_1,omitempty"` @@ -1923,11 +1926,13 @@ func (a *AdvancedMetadata) String() string { // // TODO type Association struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge - ModifiedAt *time.Time `json:"modified_at,omitempty"` - SourceObject map[string]interface{} `json:"source_object,omitempty"` - TargetObject map[string]interface{} `json:"target_object,omitempty"` + // The datetime that this object was modified by Merge. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + SourceObject map[string]interface{} `json:"source_object,omitempty"` + TargetObject map[string]interface{} `json:"target_object,omitempty"` + // The association type the association belongs to. AssociationType *AssociationAssociationType `json:"association_type,omitempty"` _rawJSON json.RawMessage @@ -1956,6 +1961,7 @@ func (a *Association) String() string { return fmt.Sprintf("%#v", a) } +// The association type the association belongs to. type AssociationAssociationType struct { typeName string String string @@ -2014,9 +2020,10 @@ func (a *AssociationAssociationType) Accept(visitor AssociationAssociationTypeVi } type AssociationSubType struct { - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` OriginType *string `json:"origin_type,omitempty"` @@ -2058,10 +2065,12 @@ func (a *AssociationSubType) String() string { type AssociationType struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge - ModifiedAt *time.Time `json:"modified_at,omitempty"` + // The datetime that this object was modified by Merge. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // The class of the source object (Custom Object or Common Model) for the association type. SourceObjectClass map[string]interface{} `json:"source_object_class,omitempty"` TargetObjectClasses []*AssociationSubType `json:"target_object_classes,omitempty"` RemoteKeyName *string `json:"remote_key_name,omitempty"` @@ -2267,6 +2276,9 @@ type AuditLogEvent struct { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + // - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + // - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + // - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED EventType *AuditLogEventEventType `json:"event_type,omitempty"` EventDescription string `json:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty"` @@ -2333,6 +2345,9 @@ func (a *AuditLogEvent) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type AuditLogEventEventType struct { typeName string EventTypeEnum EventTypeEnum @@ -2676,164 +2691,6 @@ func (c *CommonModelScopesBodyRequest) String() string { return fmt.Sprintf("%#v", c) } -type ConditionSchema struct { - // The ID of the condition schema. This ID is used when updating selective syncs for a linked account. - Id string `json:"id"` - // The common model for which a condition schema is defined. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - FieldName *string `json:"field_name,omitempty"` - // Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - // The type of value(s) that can be set for this condition. - // - // - `BOOLEAN` - BOOLEAN - // - `DATE` - DATE - // - `DATE_TIME` - DATE_TIME - // - `INTEGER` - INTEGER - // - `FLOAT` - FLOAT - // - `STRING` - STRING - // - `LIST_OF_STRINGS` - LIST_OF_STRINGS - ConditionType *ConditionSchemaConditionType `json:"condition_type,omitempty"` - // The schemas for the operators that can be used on a condition. - Operators []*OperatorSchema `json:"operators,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *ConditionSchema) UnmarshalJSON(data []byte) error { - type unmarshaler ConditionSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConditionSchema(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConditionSchema) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -// The type of value(s) that can be set for this condition. -// -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionSchemaConditionType struct { - typeName string - ConditionTypeEnum ConditionTypeEnum - String string -} - -func NewConditionSchemaConditionTypeFromConditionTypeEnum(value ConditionTypeEnum) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "conditionTypeEnum", ConditionTypeEnum: value} -} - -func NewConditionSchemaConditionTypeFromString(value string) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "string", String: value} -} - -func (c *ConditionSchemaConditionType) UnmarshalJSON(data []byte) error { - var valueConditionTypeEnum ConditionTypeEnum - if err := json.Unmarshal(data, &valueConditionTypeEnum); err == nil { - c.typeName = "conditionTypeEnum" - c.ConditionTypeEnum = valueConditionTypeEnum - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) -} - -func (c ConditionSchemaConditionType) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return json.Marshal(c.ConditionTypeEnum) - case "string": - return json.Marshal(c.String) - } -} - -type ConditionSchemaConditionTypeVisitor interface { - VisitConditionTypeEnum(ConditionTypeEnum) error - VisitString(string) error -} - -func (c *ConditionSchemaConditionType) Accept(visitor ConditionSchemaConditionTypeVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return visitor.VisitConditionTypeEnum(c.ConditionTypeEnum) - case "string": - return visitor.VisitString(c.String) - } -} - -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionTypeEnum string - -const ( - ConditionTypeEnumBoolean ConditionTypeEnum = "BOOLEAN" - ConditionTypeEnumDate ConditionTypeEnum = "DATE" - ConditionTypeEnumDateTime ConditionTypeEnum = "DATE_TIME" - ConditionTypeEnumInteger ConditionTypeEnum = "INTEGER" - ConditionTypeEnumFloat ConditionTypeEnum = "FLOAT" - ConditionTypeEnumString ConditionTypeEnum = "STRING" - ConditionTypeEnumListOfStrings ConditionTypeEnum = "LIST_OF_STRINGS" -) - -func NewConditionTypeEnumFromString(s string) (ConditionTypeEnum, error) { - switch s { - case "BOOLEAN": - return ConditionTypeEnumBoolean, nil - case "DATE": - return ConditionTypeEnumDate, nil - case "DATE_TIME": - return ConditionTypeEnumDateTime, nil - case "INTEGER": - return ConditionTypeEnumInteger, nil - case "FLOAT": - return ConditionTypeEnumFloat, nil - case "STRING": - return ConditionTypeEnumString, nil - case "LIST_OF_STRINGS": - return ConditionTypeEnumListOfStrings, nil - } - var t ConditionTypeEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { - return &c -} - // # The Contact Object // // ### Description @@ -2846,9 +2703,10 @@ func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { type Contact struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The contact's first name. FirstName *string `json:"first_name,omitempty"` @@ -4333,11 +4191,14 @@ func (c *CrmCustomObjectResponse) String() string { type CustomObject struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge - ModifiedAt *time.Time `json:"modified_at,omitempty"` - ObjectClass *string `json:"object_class,omitempty"` + // The datetime that this object was modified by Merge. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // The custom object class the custom object record belongs to. + ObjectClass *string `json:"object_class,omitempty"` + // The fields and values contained within the custom object record. Fields map[string]interface{} `json:"fields,omitempty"` RemoteFields []*RemoteField `json:"remote_fields,omitempty"` @@ -4379,14 +4240,18 @@ func (c *CustomObject) String() string { type CustomObjectClass struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - ModifiedAt *time.Time `json:"modified_at,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Labels map[string]*string `json:"labels,omitempty"` - Fields []*RemoteFieldClassForCustomObjectClass `json:"fields,omitempty"` - AssociationTypes []map[string]interface{} `json:"association_types,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // The custom object class's name. + Name *string `json:"name,omitempty"` + // The custom object class's description. + Description *string `json:"description,omitempty"` + // The custom object class's singular and plural labels. + Labels map[string]*string `json:"labels,omitempty"` + Fields []*RemoteFieldClassForCustomObjectClass `json:"fields,omitempty"` + // The types of associations with other models that the custom object class can have. + AssociationTypes []map[string]interface{} `json:"association_types,omitempty"` _rawJSON json.RawMessage } @@ -4590,8 +4455,9 @@ func (d DirectionEnum) Ptr() *DirectionEnum { // // Fetch from the `GET Contact` endpoint and view their email addresses. type EmailAddress struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The email address. EmailAddress *string `json:"email_address,omitempty"` @@ -4731,9 +4597,10 @@ func (e EncodingEnum) Ptr() *EncodingEnum { type Engagement struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The engagement's owner. Owner *EngagementOwner `json:"owner,omitempty"` @@ -5475,9 +5342,10 @@ func (e *EngagementResponse) String() string { type EngagementType struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The engagement type's activity type. // @@ -5643,6 +5511,9 @@ func (e *ErrorValidationProblem) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type EventTypeEnum string const ( @@ -5680,6 +5551,9 @@ const ( EventTypeEnumForcedLinkedAccountResync EventTypeEnum = "FORCED_LINKED_ACCOUNT_RESYNC" EventTypeEnumMutedIssue EventTypeEnum = "MUTED_ISSUE" EventTypeEnumGeneratedMagicLink EventTypeEnum = "GENERATED_MAGIC_LINK" + EventTypeEnumEnabledMergeWebhook EventTypeEnum = "ENABLED_MERGE_WEBHOOK" + EventTypeEnumDisabledMergeWebhook EventTypeEnum = "DISABLED_MERGE_WEBHOOK" + EventTypeEnumMergeWebhookTargetChanged EventTypeEnum = "MERGE_WEBHOOK_TARGET_CHANGED" ) func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { @@ -5752,6 +5626,12 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumMutedIssue, nil case "GENERATED_MAGIC_LINK": return EventTypeEnumGeneratedMagicLink, nil + case "ENABLED_MERGE_WEBHOOK": + return EventTypeEnumEnabledMergeWebhook, nil + case "DISABLED_MERGE_WEBHOOK": + return EventTypeEnumDisabledMergeWebhook, nil + case "MERGE_WEBHOOK_TARGET_CHANGED": + return EventTypeEnumMergeWebhookTargetChanged, nil } var t EventTypeEnum return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -6503,9 +6383,10 @@ func (i ItemTypeEnum) Ptr() *ItemTypeEnum { type Lead struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The lead's owner. Owner *LeadOwner `json:"owner,omitempty"` @@ -7035,138 +6916,6 @@ func (l *LinkToken) String() string { return fmt.Sprintf("%#v", l) } -type LinkedAccountCondition struct { - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The common model for a specific condition. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - FieldName *string `json:"field_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountCondition) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountCondition - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountCondition(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountCondition) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountConditionRequest struct { - // The ID indicating which Linked Account Condition this is. - Id *string `json:"id,omitempty"` - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountConditionRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountConditionRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountConditionRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountConditionRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfiguration struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountCondition `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfiguration) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfiguration - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfiguration(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfiguration) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfigurationRequest struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountConditionRequest `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfigurationRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfigurationRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status"` CanMakeRequest bool `json:"can_make_request"` @@ -7498,9 +7247,10 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq type Note struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The note's owner. Owner *NoteOwner `json:"owner,omitempty"` @@ -8123,38 +7873,6 @@ func (o *ObjectClassDescriptionRequest) String() string { return fmt.Sprintf("%#v", o) } -type OperatorSchema struct { - // The operator for which an operator schema is defined. - Operator *string `json:"operator,omitempty"` - // Whether the operator can be repeated multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - - _rawJSON json.RawMessage -} - -func (o *OperatorSchema) UnmarshalJSON(data []byte) error { - type unmarshaler OperatorSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *o = OperatorSchema(value) - o._rawJSON = json.RawMessage(data) - return nil -} - -func (o *OperatorSchema) String() string { - if len(o._rawJSON) > 0 { - if value, err := core.StringifyJSON(o._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(o); err == nil { - return value - } - return fmt.Sprintf("%#v", o) -} - // # The Opportunity Object // // ### Description @@ -8167,9 +7885,10 @@ func (o *OperatorSchema) String() string { type Opportunity struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The opportunity's name. Name *string `json:"name,omitempty"` @@ -9003,37 +8722,6 @@ func (p *PaginatedAuditLogEventList) String() string { return fmt.Sprintf("%#v", p) } -type PaginatedConditionSchemaList struct { - Next *string `json:"next,omitempty"` - Previous *string `json:"previous,omitempty"` - Results []*ConditionSchema `json:"results,omitempty"` - - _rawJSON json.RawMessage -} - -func (p *PaginatedConditionSchemaList) UnmarshalJSON(data []byte) error { - type unmarshaler PaginatedConditionSchemaList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PaginatedConditionSchemaList(value) - p._rawJSON = json.RawMessage(data) - return nil -} - -func (p *PaginatedConditionSchemaList) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - type PaginatedContactList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -9489,7 +9177,8 @@ type PatchedAccountRequest struct { // The account's website. Website *string `json:"website,omitempty"` // The account's number of employees. - NumberOfEmployees *int `json:"number_of_employees,omitempty"` + NumberOfEmployees *int `json:"number_of_employees,omitempty"` + Addresses []*AddressRequest `json:"addresses,omitempty"` // The last date (either most recent or furthest in the future) of when an activity occurs in an account. LastActivityAt *time.Time `json:"last_activity_at,omitempty"` IntegrationParams map[string]interface{} `json:"integration_params,omitempty"` @@ -10008,8 +9697,9 @@ func (p *PatchedTaskRequestStatus) Accept(visitor PatchedTaskRequestStatusVisito // // Fetch from the `GET Contact` endpoint and view their phone numbers. type PhoneNumber struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The phone number. PhoneNumber *string `json:"phone_number,omitempty"` @@ -10205,11 +9895,12 @@ func (r *RemoteField) String() string { } type RemoteFieldApi struct { - Schema map[string]interface{} `json:"schema,omitempty"` - RemoteKeyName string `json:"remote_key_name"` - RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` - ExampleValues []interface{} `json:"example_values,omitempty"` - AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteKeyName string `json:"remote_key_name"` + RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + ExampleValues []interface{} `json:"example_values,omitempty"` + AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty"` _rawJSON json.RawMessage } @@ -10237,6 +9928,63 @@ func (r *RemoteFieldApi) String() string { return fmt.Sprintf("%#v", r) } +type RemoteFieldApiCoverage struct { + typeName string + Integer int + Double float64 +} + +func NewRemoteFieldApiCoverageFromInteger(value int) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "integer", Integer: value} +} + +func NewRemoteFieldApiCoverageFromDouble(value float64) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "double", Double: value} +} + +func (r *RemoteFieldApiCoverage) UnmarshalJSON(data []byte) error { + var valueInteger int + if err := json.Unmarshal(data, &valueInteger); err == nil { + r.typeName = "integer" + r.Integer = valueInteger + return nil + } + var valueDouble float64 + if err := json.Unmarshal(data, &valueDouble); err == nil { + r.typeName = "double" + r.Double = valueDouble + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, r) +} + +func (r RemoteFieldApiCoverage) MarshalJSON() ([]byte, error) { + switch r.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return json.Marshal(r.Integer) + case "double": + return json.Marshal(r.Double) + } +} + +type RemoteFieldApiCoverageVisitor interface { + VisitInteger(int) error + VisitDouble(float64) error +} + +func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) error { + switch r.typeName { + default: + return fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return visitor.VisitInteger(r.Integer) + case "double": + return visitor.VisitDouble(r.Double) + } +} + type RemoteFieldApiResponse struct { Account []*RemoteFieldApi `json:"Account,omitempty"` Contact []*RemoteFieldApi `json:"Contact,omitempty"` @@ -10457,8 +10205,9 @@ func (r *RemoteFieldClassFieldType) Accept(visitor RemoteFieldClassFieldTypeVisi } type RemoteFieldClassForCustomObjectClass struct { + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` DisplayName *string `json:"display_name,omitempty"` RemoteKeyName *string `json:"remote_key_name,omitempty"` @@ -11025,9 +10774,10 @@ func (s SelectiveSyncConfigurationsUsageEnum) Ptr() *SelectiveSyncConfigurations type Stage struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The stage's name. Name *string `json:"name,omitempty"` @@ -11159,9 +10909,10 @@ func (s SyncStatusStatusEnum) Ptr() *SyncStatusStatusEnum { type Task struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The task's subject. Subject *string `json:"subject,omitempty"` @@ -11811,9 +11562,10 @@ func (t TaskStatusEnum) Ptr() *TaskStatusEnum { type User struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The user's name. Name *string `json:"name,omitempty"` diff --git a/filestorage/audit_trail.go b/filestorage/audit_trail.go index 08f296a..28a030b 100644 --- a/filestorage/audit_trail.go +++ b/filestorage/audit_trail.go @@ -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` + // 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` EventType *string `json:"-"` // Number of results to return per page. PageSize *int `json:"-"` diff --git a/filestorage/client/client.go b/filestorage/client/client.go index 19b389e..9f160e4 100644 --- a/filestorage/client/client.go +++ b/filestorage/client/client.go @@ -23,7 +23,6 @@ import ( passthrough "github.com/merge-api/merge-go-client/filestorage/passthrough" regeneratekey "github.com/merge-api/merge-go-client/filestorage/regeneratekey" scopes "github.com/merge-api/merge-go-client/filestorage/scopes" - selectivesync "github.com/merge-api/merge-go-client/filestorage/selectivesync" syncstatus "github.com/merge-api/merge-go-client/filestorage/syncstatus" users "github.com/merge-api/merge-go-client/filestorage/users" webhookreceivers "github.com/merge-api/merge-go-client/filestorage/webhookreceivers" @@ -53,7 +52,6 @@ type Client struct { LinkedAccounts *linkedaccounts.Client Passthrough *passthrough.Client RegenerateKey *regeneratekey.Client - SelectiveSync *selectivesync.Client SyncStatus *syncstatus.Client ForceResync *forceresync.Client Users *users.Client @@ -87,7 +85,6 @@ func NewClient(opts ...core.ClientOption) *Client { LinkedAccounts: linkedaccounts.NewClient(opts...), Passthrough: passthrough.NewClient(opts...), RegenerateKey: regeneratekey.NewClient(opts...), - SelectiveSync: selectivesync.NewClient(opts...), SyncStatus: syncstatus.NewClient(opts...), ForceResync: forceresync.NewClient(opts...), Users: users.NewClient(opts...), diff --git a/filestorage/link_token.go b/filestorage/link_token.go index 35526ef..bfc1741 100644 --- a/filestorage/link_token.go +++ b/filestorage/link_token.go @@ -23,4 +23,6 @@ type EndUserDetailsRequest struct { CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` // The language code for the language to localize Merge Link to. Language *string `json:"language,omitempty"` + // A JSON object containing integration-specific configuration options. + IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty"` } diff --git a/filestorage/selective_sync.go b/filestorage/selective_sync.go deleted file mode 100644 index 5080bc8..0000000 --- a/filestorage/selective_sync.go +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package filestorage - -type LinkedAccountSelectiveSyncConfigurationListRequest struct { - // The selective syncs associated with a linked account. - SyncConfigurations []*LinkedAccountSelectiveSyncConfigurationRequest `json:"sync_configurations,omitempty"` -} - -type SelectiveSyncMetaListRequest struct { - CommonModel *string `json:"-"` - // The pagination cursor value. - Cursor *string `json:"-"` - // Number of results to return per page. - PageSize *int `json:"-"` -} diff --git a/filestorage/selectivesync/client.go b/filestorage/selectivesync/client.go deleted file mode 100644 index bf39de5..0000000 --- a/filestorage/selectivesync/client.go +++ /dev/null @@ -1,114 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package selectivesync - -import ( - context "context" - fmt "fmt" - core "github.com/merge-api/merge-go-client/core" - filestorage "github.com/merge-api/merge-go-client/filestorage" - http "net/http" - url "net/url" -) - -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(), - } -} - -// Get a linked account's selective syncs. -func (c *Client) ConfigurationsList(ctx context.Context) ([]*filestorage.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "filestorage/v1/selective-sync/configurations" - - var response []*filestorage.LinkedAccountSelectiveSyncConfiguration - 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 -} - -// Replace a linked account's selective syncs. -func (c *Client) ConfigurationsUpdate(ctx context.Context, request *filestorage.LinkedAccountSelectiveSyncConfigurationListRequest) ([]*filestorage.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "filestorage/v1/selective-sync/configurations" - - var response []*filestorage.LinkedAccountSelectiveSyncConfiguration - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// Get metadata for the conditions available to a linked account. -func (c *Client) MetaList(ctx context.Context, request *filestorage.SelectiveSyncMetaListRequest) (*filestorage.PaginatedConditionSchemaList, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "filestorage/v1/selective-sync/meta" - - queryParams := make(url.Values) - if request.CommonModel != nil { - queryParams.Add("common_model", fmt.Sprintf("%v", *request.CommonModel)) - } - if request.Cursor != nil { - queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) - } - if request.PageSize != nil { - queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *filestorage.PaginatedConditionSchemaList - 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 -} diff --git a/filestorage/types.go b/filestorage/types.go index 54ecbea..61cf189 100644 --- a/filestorage/types.go +++ b/filestorage/types.go @@ -354,6 +354,9 @@ type AuditLogEvent struct { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + // - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + // - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + // - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED EventType *AuditLogEventEventType `json:"event_type,omitempty"` EventDescription string `json:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty"` @@ -420,6 +423,9 @@ func (a *AuditLogEvent) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type AuditLogEventEventType struct { typeName string EventTypeEnum EventTypeEnum @@ -731,164 +737,6 @@ func (c *CommonModelScopesBodyRequest) String() string { return fmt.Sprintf("%#v", c) } -type ConditionSchema struct { - // The ID of the condition schema. This ID is used when updating selective syncs for a linked account. - Id string `json:"id"` - // The common model for which a condition schema is defined. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - FieldName *string `json:"field_name,omitempty"` - // Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - // The type of value(s) that can be set for this condition. - // - // - `BOOLEAN` - BOOLEAN - // - `DATE` - DATE - // - `DATE_TIME` - DATE_TIME - // - `INTEGER` - INTEGER - // - `FLOAT` - FLOAT - // - `STRING` - STRING - // - `LIST_OF_STRINGS` - LIST_OF_STRINGS - ConditionType *ConditionSchemaConditionType `json:"condition_type,omitempty"` - // The schemas for the operators that can be used on a condition. - Operators []*OperatorSchema `json:"operators,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *ConditionSchema) UnmarshalJSON(data []byte) error { - type unmarshaler ConditionSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConditionSchema(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConditionSchema) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -// The type of value(s) that can be set for this condition. -// -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionSchemaConditionType struct { - typeName string - ConditionTypeEnum ConditionTypeEnum - String string -} - -func NewConditionSchemaConditionTypeFromConditionTypeEnum(value ConditionTypeEnum) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "conditionTypeEnum", ConditionTypeEnum: value} -} - -func NewConditionSchemaConditionTypeFromString(value string) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "string", String: value} -} - -func (c *ConditionSchemaConditionType) UnmarshalJSON(data []byte) error { - var valueConditionTypeEnum ConditionTypeEnum - if err := json.Unmarshal(data, &valueConditionTypeEnum); err == nil { - c.typeName = "conditionTypeEnum" - c.ConditionTypeEnum = valueConditionTypeEnum - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) -} - -func (c ConditionSchemaConditionType) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return json.Marshal(c.ConditionTypeEnum) - case "string": - return json.Marshal(c.String) - } -} - -type ConditionSchemaConditionTypeVisitor interface { - VisitConditionTypeEnum(ConditionTypeEnum) error - VisitString(string) error -} - -func (c *ConditionSchemaConditionType) Accept(visitor ConditionSchemaConditionTypeVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return visitor.VisitConditionTypeEnum(c.ConditionTypeEnum) - case "string": - return visitor.VisitString(c.String) - } -} - -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionTypeEnum string - -const ( - ConditionTypeEnumBoolean ConditionTypeEnum = "BOOLEAN" - ConditionTypeEnumDate ConditionTypeEnum = "DATE" - ConditionTypeEnumDateTime ConditionTypeEnum = "DATE_TIME" - ConditionTypeEnumInteger ConditionTypeEnum = "INTEGER" - ConditionTypeEnumFloat ConditionTypeEnum = "FLOAT" - ConditionTypeEnumString ConditionTypeEnum = "STRING" - ConditionTypeEnumListOfStrings ConditionTypeEnum = "LIST_OF_STRINGS" -) - -func NewConditionTypeEnumFromString(s string) (ConditionTypeEnum, error) { - switch s { - case "BOOLEAN": - return ConditionTypeEnumBoolean, nil - case "DATE": - return ConditionTypeEnumDate, nil - case "DATE_TIME": - return ConditionTypeEnumDateTime, nil - case "INTEGER": - return ConditionTypeEnumInteger, nil - case "FLOAT": - return ConditionTypeEnumFloat, nil - case "STRING": - return ConditionTypeEnumString, nil - case "LIST_OF_STRINGS": - return ConditionTypeEnumListOfStrings, nil - } - var t ConditionTypeEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { - return &c -} - // # The DataPassthrough Object // // ### Description @@ -1014,9 +862,10 @@ func (d *DebugModelLogSummary) String() string { type Drive struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The drive's name. Name *string `json:"name,omitempty"` @@ -1173,6 +1022,9 @@ func (e *ErrorValidationProblem) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type EventTypeEnum string const ( @@ -1210,6 +1062,9 @@ const ( EventTypeEnumForcedLinkedAccountResync EventTypeEnum = "FORCED_LINKED_ACCOUNT_RESYNC" EventTypeEnumMutedIssue EventTypeEnum = "MUTED_ISSUE" EventTypeEnumGeneratedMagicLink EventTypeEnum = "GENERATED_MAGIC_LINK" + EventTypeEnumEnabledMergeWebhook EventTypeEnum = "ENABLED_MERGE_WEBHOOK" + EventTypeEnumDisabledMergeWebhook EventTypeEnum = "DISABLED_MERGE_WEBHOOK" + EventTypeEnumMergeWebhookTargetChanged EventTypeEnum = "MERGE_WEBHOOK_TARGET_CHANGED" ) func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { @@ -1282,6 +1137,12 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumMutedIssue, nil case "GENERATED_MAGIC_LINK": return EventTypeEnumGeneratedMagicLink, nil + case "ENABLED_MERGE_WEBHOOK": + return EventTypeEnumEnabledMergeWebhook, nil + case "DISABLED_MERGE_WEBHOOK": + return EventTypeEnumDisabledMergeWebhook, nil + case "MERGE_WEBHOOK_TARGET_CHANGED": + return EventTypeEnumMergeWebhookTargetChanged, nil } var t EventTypeEnum return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -1617,9 +1478,10 @@ func (f *FieldPermissionDeserializerRequest) String() string { type File struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The file's name. Name *string `json:"name,omitempty"` @@ -2301,9 +2163,10 @@ func (f *FileStorageFolderResponse) String() string { type Folder struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The folder's name. Name *string `json:"name,omitempty"` @@ -2913,9 +2776,10 @@ func (f *FolderRequestPermissionsItem) Accept(visitor FolderRequestPermissionsIt type Group struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The group's name. Name *string `json:"name,omitempty"` @@ -3170,138 +3034,6 @@ func (l *LinkToken) String() string { return fmt.Sprintf("%#v", l) } -type LinkedAccountCondition struct { - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The common model for a specific condition. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - FieldName *string `json:"field_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountCondition) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountCondition - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountCondition(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountCondition) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountConditionRequest struct { - // The ID indicating which Linked Account Condition this is. - Id *string `json:"id,omitempty"` - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountConditionRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountConditionRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountConditionRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountConditionRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfiguration struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountCondition `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfiguration) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfiguration - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfiguration(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfiguration) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfigurationRequest struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountConditionRequest `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfigurationRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfigurationRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status"` CanMakeRequest bool `json:"can_make_request"` @@ -3621,38 +3353,6 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq } } -type OperatorSchema struct { - // The operator for which an operator schema is defined. - Operator *string `json:"operator,omitempty"` - // Whether the operator can be repeated multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - - _rawJSON json.RawMessage -} - -func (o *OperatorSchema) UnmarshalJSON(data []byte) error { - type unmarshaler OperatorSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *o = OperatorSchema(value) - o._rawJSON = json.RawMessage(data) - return nil -} - -func (o *OperatorSchema) String() string { - if len(o._rawJSON) > 0 { - if value, err := core.StringifyJSON(o._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(o); err == nil { - return value - } - return fmt.Sprintf("%#v", o) -} - type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -3715,37 +3415,6 @@ func (p *PaginatedAuditLogEventList) String() string { return fmt.Sprintf("%#v", p) } -type PaginatedConditionSchemaList struct { - Next *string `json:"next,omitempty"` - Previous *string `json:"previous,omitempty"` - Results []*ConditionSchema `json:"results,omitempty"` - - _rawJSON json.RawMessage -} - -func (p *PaginatedConditionSchemaList) UnmarshalJSON(data []byte) error { - type unmarshaler PaginatedConditionSchemaList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PaginatedConditionSchemaList(value) - p._rawJSON = json.RawMessage(data) - return nil -} - -func (p *PaginatedConditionSchemaList) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - type PaginatedDriveList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -3975,9 +3644,10 @@ func (p *PaginatedUserList) String() string { type Permission struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The user that is granted this permission. User *PermissionUser `json:"user,omitempty"` @@ -4587,11 +4257,12 @@ func (r *RemoteEndpointInfo) String() string { } type RemoteFieldApi struct { - Schema map[string]interface{} `json:"schema,omitempty"` - RemoteKeyName string `json:"remote_key_name"` - RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` - ExampleValues []interface{} `json:"example_values,omitempty"` - AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteKeyName string `json:"remote_key_name"` + RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + ExampleValues []interface{} `json:"example_values,omitempty"` + AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty"` _rawJSON json.RawMessage } @@ -4619,6 +4290,63 @@ func (r *RemoteFieldApi) String() string { return fmt.Sprintf("%#v", r) } +type RemoteFieldApiCoverage struct { + typeName string + Integer int + Double float64 +} + +func NewRemoteFieldApiCoverageFromInteger(value int) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "integer", Integer: value} +} + +func NewRemoteFieldApiCoverageFromDouble(value float64) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "double", Double: value} +} + +func (r *RemoteFieldApiCoverage) UnmarshalJSON(data []byte) error { + var valueInteger int + if err := json.Unmarshal(data, &valueInteger); err == nil { + r.typeName = "integer" + r.Integer = valueInteger + return nil + } + var valueDouble float64 + if err := json.Unmarshal(data, &valueDouble); err == nil { + r.typeName = "double" + r.Double = valueDouble + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, r) +} + +func (r RemoteFieldApiCoverage) MarshalJSON() ([]byte, error) { + switch r.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return json.Marshal(r.Integer) + case "double": + return json.Marshal(r.Double) + } +} + +type RemoteFieldApiCoverageVisitor interface { + VisitInteger(int) error + VisitDouble(float64) error +} + +func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) error { + switch r.typeName { + default: + return fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return visitor.VisitInteger(r.Integer) + case "double": + return visitor.VisitDouble(r.Double) + } +} + type RemoteFieldApiResponse struct { File []*RemoteFieldApi `json:"File,omitempty"` Folder []*RemoteFieldApi `json:"Folder,omitempty"` @@ -5007,9 +4735,10 @@ func (t TypeEnum) Ptr() *TypeEnum { type User struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The user's name. Name *string `json:"name,omitempty"` diff --git a/hris/audit_trail.go b/hris/audit_trail.go index 1302914..bbce0a8 100644 --- a/hris/audit_trail.go +++ b/hris/audit_trail.go @@ -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` + // 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` EventType *string `json:"-"` // Number of results to return per page. PageSize *int `json:"-"` diff --git a/hris/client/client.go b/hris/client/client.go index 8d0e51d..6ceb897 100644 --- a/hris/client/client.go +++ b/hris/client/client.go @@ -31,7 +31,6 @@ import ( payrollruns "github.com/merge-api/merge-go-client/hris/payrollruns" regeneratekey "github.com/merge-api/merge-go-client/hris/regeneratekey" scopes "github.com/merge-api/merge-go-client/hris/scopes" - selectivesync "github.com/merge-api/merge-go-client/hris/selectivesync" syncstatus "github.com/merge-api/merge-go-client/hris/syncstatus" teams "github.com/merge-api/merge-go-client/hris/teams" timeoff "github.com/merge-api/merge-go-client/hris/timeoff" @@ -72,7 +71,6 @@ type Client struct { PayGroups *paygroups.Client PayrollRuns *payrollruns.Client RegenerateKey *regeneratekey.Client - SelectiveSync *selectivesync.Client SyncStatus *syncstatus.Client ForceResync *forceresync.Client Teams *teams.Client @@ -117,7 +115,6 @@ func NewClient(opts ...core.ClientOption) *Client { PayGroups: paygroups.NewClient(opts...), PayrollRuns: payrollruns.NewClient(opts...), RegenerateKey: regeneratekey.NewClient(opts...), - SelectiveSync: selectivesync.NewClient(opts...), SyncStatus: syncstatus.NewClient(opts...), ForceResync: forceresync.NewClient(opts...), Teams: teams.NewClient(opts...), diff --git a/hris/groups.go b/hris/groups.go index f8e9e8d..0980d5f 100644 --- a/hris/groups.go +++ b/hris/groups.go @@ -17,6 +17,8 @@ type GroupsListRequest struct { IncludeDeletedData *bool `json:"-"` // Whether to include the original data Merge fetched from the third-party to produce these models. IncludeRemoteData *bool `json:"-"` + // If provided, specifies whether to return only Group objects which refer to a team in the third party platform. Note that this is an opinionated view based on how a team may be represented in the third party platform. + IsCommonlyUsedAsTeam *string `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. diff --git a/hris/groups/client.go b/hris/groups/client.go index d95de5b..7121a19 100644 --- a/hris/groups/client.go +++ b/hris/groups/client.go @@ -54,6 +54,9 @@ func (c *Client) List(ctx context.Context, request *hris.GroupsListRequest) (*hr if request.IncludeRemoteData != nil { queryParams.Add("include_remote_data", fmt.Sprintf("%v", *request.IncludeRemoteData)) } + if request.IsCommonlyUsedAsTeam != nil { + queryParams.Add("is_commonly_used_as_team", fmt.Sprintf("%v", *request.IsCommonlyUsedAsTeam)) + } if request.ModifiedAfter != nil { queryParams.Add("modified_after", fmt.Sprintf("%v", request.ModifiedAfter.Format(time.RFC3339))) } diff --git a/hris/link_token.go b/hris/link_token.go index 5b124d2..6375e45 100644 --- a/hris/link_token.go +++ b/hris/link_token.go @@ -23,4 +23,6 @@ type EndUserDetailsRequest struct { CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` // The language code for the language to localize Merge Link to. Language *string `json:"language,omitempty"` + // A JSON object containing integration-specific configuration options. + IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty"` } diff --git a/hris/selective_sync.go b/hris/selective_sync.go deleted file mode 100644 index 33244f5..0000000 --- a/hris/selective_sync.go +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package hris - -type LinkedAccountSelectiveSyncConfigurationListRequest struct { - // The selective syncs associated with a linked account. - SyncConfigurations []*LinkedAccountSelectiveSyncConfigurationRequest `json:"sync_configurations,omitempty"` -} - -type SelectiveSyncMetaListRequest struct { - CommonModel *string `json:"-"` - // The pagination cursor value. - Cursor *string `json:"-"` - // Number of results to return per page. - PageSize *int `json:"-"` -} diff --git a/hris/selectivesync/client.go b/hris/selectivesync/client.go deleted file mode 100644 index c7a058a..0000000 --- a/hris/selectivesync/client.go +++ /dev/null @@ -1,114 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package selectivesync - -import ( - context "context" - fmt "fmt" - core "github.com/merge-api/merge-go-client/core" - hris "github.com/merge-api/merge-go-client/hris" - http "net/http" - url "net/url" -) - -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(), - } -} - -// Get a linked account's selective syncs. -func (c *Client) ConfigurationsList(ctx context.Context) ([]*hris.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "hris/v1/selective-sync/configurations" - - var response []*hris.LinkedAccountSelectiveSyncConfiguration - 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 -} - -// Replace a linked account's selective syncs. -func (c *Client) ConfigurationsUpdate(ctx context.Context, request *hris.LinkedAccountSelectiveSyncConfigurationListRequest) ([]*hris.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "hris/v1/selective-sync/configurations" - - var response []*hris.LinkedAccountSelectiveSyncConfiguration - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// Get metadata for the conditions available to a linked account. -func (c *Client) MetaList(ctx context.Context, request *hris.SelectiveSyncMetaListRequest) (*hris.PaginatedConditionSchemaList, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "hris/v1/selective-sync/meta" - - queryParams := make(url.Values) - if request.CommonModel != nil { - queryParams.Add("common_model", fmt.Sprintf("%v", *request.CommonModel)) - } - if request.Cursor != nil { - queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) - } - if request.PageSize != nil { - queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *hris.PaginatedConditionSchemaList - 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 -} diff --git a/hris/types.go b/hris/types.go index 1add377..8496c02 100644 --- a/hris/types.go +++ b/hris/types.go @@ -378,6 +378,9 @@ type AuditLogEvent struct { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + // - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + // - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + // - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED EventType *AuditLogEventEventType `json:"event_type,omitempty"` EventDescription string `json:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty"` @@ -444,6 +447,9 @@ func (a *AuditLogEvent) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type AuditLogEventEventType struct { typeName string EventTypeEnum EventTypeEnum @@ -618,9 +624,10 @@ func (a *AvailableActions) String() string { type BankInfo struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee with this bank account. Employee *BankInfoEmployee `json:"employee,omitempty"` @@ -799,9 +806,10 @@ func (b *BankInfoEmployee) Accept(visitor BankInfoEmployeeVisitor) error { type Benefit struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee on the plan. Employee *BenefitEmployee `json:"employee,omitempty"` @@ -1105,9 +1113,10 @@ func (c *CommonModelScopesBodyRequest) String() string { type Company struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The company's legal name. LegalName *string `json:"legal_name,omitempty"` @@ -1146,164 +1155,6 @@ func (c *Company) String() string { return fmt.Sprintf("%#v", c) } -type ConditionSchema struct { - // The ID of the condition schema. This ID is used when updating selective syncs for a linked account. - Id string `json:"id"` - // The common model for which a condition schema is defined. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - FieldName *string `json:"field_name,omitempty"` - // Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - // The type of value(s) that can be set for this condition. - // - // - `BOOLEAN` - BOOLEAN - // - `DATE` - DATE - // - `DATE_TIME` - DATE_TIME - // - `INTEGER` - INTEGER - // - `FLOAT` - FLOAT - // - `STRING` - STRING - // - `LIST_OF_STRINGS` - LIST_OF_STRINGS - ConditionType *ConditionSchemaConditionType `json:"condition_type,omitempty"` - // The schemas for the operators that can be used on a condition. - Operators []*OperatorSchema `json:"operators,omitempty"` - - _rawJSON json.RawMessage -} - -func (c *ConditionSchema) UnmarshalJSON(data []byte) error { - type unmarshaler ConditionSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ConditionSchema(value) - c._rawJSON = json.RawMessage(data) - return nil -} - -func (c *ConditionSchema) String() string { - if len(c._rawJSON) > 0 { - if value, err := core.StringifyJSON(c._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -// The type of value(s) that can be set for this condition. -// -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionSchemaConditionType struct { - typeName string - ConditionTypeEnum ConditionTypeEnum - String string -} - -func NewConditionSchemaConditionTypeFromConditionTypeEnum(value ConditionTypeEnum) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "conditionTypeEnum", ConditionTypeEnum: value} -} - -func NewConditionSchemaConditionTypeFromString(value string) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "string", String: value} -} - -func (c *ConditionSchemaConditionType) UnmarshalJSON(data []byte) error { - var valueConditionTypeEnum ConditionTypeEnum - if err := json.Unmarshal(data, &valueConditionTypeEnum); err == nil { - c.typeName = "conditionTypeEnum" - c.ConditionTypeEnum = valueConditionTypeEnum - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typeName = "string" - c.String = valueString - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) -} - -func (c ConditionSchemaConditionType) MarshalJSON() ([]byte, error) { - switch c.typeName { - default: - return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return json.Marshal(c.ConditionTypeEnum) - case "string": - return json.Marshal(c.String) - } -} - -type ConditionSchemaConditionTypeVisitor interface { - VisitConditionTypeEnum(ConditionTypeEnum) error - VisitString(string) error -} - -func (c *ConditionSchemaConditionType) Accept(visitor ConditionSchemaConditionTypeVisitor) error { - switch c.typeName { - default: - return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return visitor.VisitConditionTypeEnum(c.ConditionTypeEnum) - case "string": - return visitor.VisitString(c.String) - } -} - -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionTypeEnum string - -const ( - ConditionTypeEnumBoolean ConditionTypeEnum = "BOOLEAN" - ConditionTypeEnumDate ConditionTypeEnum = "DATE" - ConditionTypeEnumDateTime ConditionTypeEnum = "DATE_TIME" - ConditionTypeEnumInteger ConditionTypeEnum = "INTEGER" - ConditionTypeEnumFloat ConditionTypeEnum = "FLOAT" - ConditionTypeEnumString ConditionTypeEnum = "STRING" - ConditionTypeEnumListOfStrings ConditionTypeEnum = "LIST_OF_STRINGS" -) - -func NewConditionTypeEnumFromString(s string) (ConditionTypeEnum, error) { - switch s { - case "BOOLEAN": - return ConditionTypeEnumBoolean, nil - case "DATE": - return ConditionTypeEnumDate, nil - case "DATE_TIME": - return ConditionTypeEnumDateTime, nil - case "INTEGER": - return ConditionTypeEnumInteger, nil - case "FLOAT": - return ConditionTypeEnumFloat, nil - case "STRING": - return ConditionTypeEnumString, nil - case "LIST_OF_STRINGS": - return ConditionTypeEnumListOfStrings, nil - } - var t ConditionTypeEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { - return &c -} - // - `AF` - Afghanistan // - `AX` - Åland Islands // - `AL` - Albania @@ -2441,9 +2292,10 @@ func (d *DebugModelLogSummary) String() string { type Deduction struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` EmployeePayrollRun *string `json:"employee_payroll_run,omitempty"` // The deduction's name. @@ -2495,9 +2347,10 @@ func (d *Deduction) String() string { type Dependent struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The dependents's first name. FirstName *string `json:"first_name,omitempty"` @@ -2700,9 +2553,10 @@ func (d *DependentRelationship) Accept(visitor DependentRelationshipVisitor) err type Earning struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` EmployeePayrollRun *string `json:"employee_payroll_run,omitempty"` // The amount earned. @@ -2852,9 +2706,10 @@ func (e EarningTypeEnum) Ptr() *EarningTypeEnum { type Employee struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee's number that appears in the third-party integration's UI. EmployeeNumber *string `json:"employee_number,omitempty"` @@ -3583,9 +3438,10 @@ func (e *EmployeePayGroup) Accept(visitor EmployeePayGroupVisitor) error { type EmployeePayrollRun struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee whose payroll is being run. Employee *EmployeePayrollRunEmployee `json:"employee,omitempty"` @@ -4747,9 +4603,10 @@ func (e *EmployeeWorkLocation) Accept(visitor EmployeeWorkLocationVisitor) error type EmployerBenefit struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The type of benefit plan. // @@ -4874,9 +4731,10 @@ func (e *EmployerBenefitBenefitPlanType) Accept(visitor EmployerBenefitBenefitPl type Employment struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee holding this position. Employee *EmploymentEmployee `json:"employee,omitempty"` @@ -6241,6 +6099,9 @@ func (e EthnicityEnum) Ptr() *EthnicityEnum { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type EventTypeEnum string const ( @@ -6278,6 +6139,9 @@ const ( EventTypeEnumForcedLinkedAccountResync EventTypeEnum = "FORCED_LINKED_ACCOUNT_RESYNC" EventTypeEnumMutedIssue EventTypeEnum = "MUTED_ISSUE" EventTypeEnumGeneratedMagicLink EventTypeEnum = "GENERATED_MAGIC_LINK" + EventTypeEnumEnabledMergeWebhook EventTypeEnum = "ENABLED_MERGE_WEBHOOK" + EventTypeEnumDisabledMergeWebhook EventTypeEnum = "DISABLED_MERGE_WEBHOOK" + EventTypeEnumMergeWebhookTargetChanged EventTypeEnum = "MERGE_WEBHOOK_TARGET_CHANGED" ) func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { @@ -6350,6 +6214,12 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumMutedIssue, nil case "GENERATED_MAGIC_LINK": return EventTypeEnumGeneratedMagicLink, nil + case "ENABLED_MERGE_WEBHOOK": + return EventTypeEnumEnabledMergeWebhook, nil + case "DISABLED_MERGE_WEBHOOK": + return EventTypeEnumDisabledMergeWebhook, nil + case "MERGE_WEBHOOK_TARGET_CHANGED": + return EventTypeEnumMergeWebhookTargetChanged, nil } var t EventTypeEnum return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -6775,9 +6645,10 @@ func (g GenderEnum) Ptr() *GenderEnum { type Group struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The parent group for this group. ParentGroup *string `json:"parent_group,omitempty"` @@ -6792,9 +6663,11 @@ type Group struct { // - `GROUP` - GROUP Type *GroupType `json:"type,omitempty"` // Indicates whether or not this object has been deleted in the third party platform. - RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty"` - FieldMappings map[string]interface{} `json:"field_mappings,omitempty"` - RemoteData []*RemoteData `json:"remote_data,omitempty"` + RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty"` + // Indicates whether the Group refers to a team in the third party platform. Note that this is an opinionated view based on how Merge observes most organizations representing teams in each third party platform. If your customer uses a platform different from most, there is a chance this will not be correct. + IsCommonlyUsedAsTeam *bool `json:"is_commonly_used_as_team,omitempty"` + FieldMappings map[string]interface{} `json:"field_mappings,omitempty"` + RemoteData []*RemoteData `json:"remote_data,omitempty"` _rawJSON json.RawMessage } @@ -7140,138 +7013,6 @@ func (l *LinkToken) String() string { return fmt.Sprintf("%#v", l) } -type LinkedAccountCondition struct { - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The common model for a specific condition. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - FieldName *string `json:"field_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountCondition) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountCondition - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountCondition(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountCondition) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountConditionRequest struct { - // The ID indicating which Linked Account Condition this is. - Id *string `json:"id,omitempty"` - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountConditionRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountConditionRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountConditionRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountConditionRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfiguration struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountCondition `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfiguration) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfiguration - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfiguration(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfiguration) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfigurationRequest struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountConditionRequest `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfigurationRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfigurationRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status"` CanMakeRequest bool `json:"can_make_request"` @@ -7314,9 +7055,10 @@ func (l *LinkedAccountStatus) String() string { type Location struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The location's name. Name *string `json:"name,omitempty"` @@ -8338,38 +8080,6 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq } } -type OperatorSchema struct { - // The operator for which an operator schema is defined. - Operator *string `json:"operator,omitempty"` - // Whether the operator can be repeated multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - - _rawJSON json.RawMessage -} - -func (o *OperatorSchema) UnmarshalJSON(data []byte) error { - type unmarshaler OperatorSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *o = OperatorSchema(value) - o._rawJSON = json.RawMessage(data) - return nil -} - -func (o *OperatorSchema) String() string { - if len(o._rawJSON) > 0 { - if value, err := core.StringifyJSON(o._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(o); err == nil { - return value - } - return fmt.Sprintf("%#v", o) -} - type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -8525,37 +8235,6 @@ func (p *PaginatedCompanyList) String() string { return fmt.Sprintf("%#v", p) } -type PaginatedConditionSchemaList struct { - Next *string `json:"next,omitempty"` - Previous *string `json:"previous,omitempty"` - Results []*ConditionSchema `json:"results,omitempty"` - - _rawJSON json.RawMessage -} - -func (p *PaginatedConditionSchemaList) UnmarshalJSON(data []byte) error { - type unmarshaler PaginatedConditionSchemaList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PaginatedConditionSchemaList(value) - p._rawJSON = json.RawMessage(data) - return nil -} - -func (p *PaginatedConditionSchemaList) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - type PaginatedDependentList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -10325,9 +10004,10 @@ func (p PayFrequencyEnum) Ptr() *PayFrequencyEnum { type PayGroup struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The pay group name. PayGroupName *string `json:"pay_group_name,omitempty"` @@ -10426,9 +10106,10 @@ func (p PayPeriodEnum) Ptr() *PayPeriodEnum { type PayrollRun struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The state of the payroll run // @@ -10769,11 +10450,12 @@ func (r *RemoteEndpointInfo) String() string { } type RemoteFieldApi struct { - Schema map[string]interface{} `json:"schema,omitempty"` - RemoteKeyName string `json:"remote_key_name"` - RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` - ExampleValues []interface{} `json:"example_values,omitempty"` - AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteKeyName string `json:"remote_key_name"` + RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + ExampleValues []interface{} `json:"example_values,omitempty"` + AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty"` _rawJSON json.RawMessage } @@ -10801,6 +10483,63 @@ func (r *RemoteFieldApi) String() string { return fmt.Sprintf("%#v", r) } +type RemoteFieldApiCoverage struct { + typeName string + Integer int + Double float64 +} + +func NewRemoteFieldApiCoverageFromInteger(value int) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "integer", Integer: value} +} + +func NewRemoteFieldApiCoverageFromDouble(value float64) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "double", Double: value} +} + +func (r *RemoteFieldApiCoverage) UnmarshalJSON(data []byte) error { + var valueInteger int + if err := json.Unmarshal(data, &valueInteger); err == nil { + r.typeName = "integer" + r.Integer = valueInteger + return nil + } + var valueDouble float64 + if err := json.Unmarshal(data, &valueDouble); err == nil { + r.typeName = "double" + r.Double = valueDouble + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, r) +} + +func (r RemoteFieldApiCoverage) MarshalJSON() ([]byte, error) { + switch r.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return json.Marshal(r.Integer) + case "double": + return json.Marshal(r.Double) + } +} + +type RemoteFieldApiCoverageVisitor interface { + VisitInteger(int) error + VisitDouble(float64) error +} + +func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) error { + switch r.typeName { + default: + return fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return visitor.VisitInteger(r.Integer) + case "double": + return visitor.VisitDouble(r.Double) + } +} + type RemoteFieldApiResponse struct { Benefit []*RemoteFieldApi `json:"Benefit,omitempty"` EmployerBenefit []*RemoteFieldApi `json:"EmployerBenefit,omitempty"` @@ -11309,9 +11048,10 @@ func (s SyncStatusStatusEnum) Ptr() *SyncStatusStatusEnum { type Tax struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` EmployeePayrollRun *string `json:"employee_payroll_run,omitempty"` // The tax's name. @@ -11363,9 +11103,10 @@ func (t *Tax) String() string { type Team struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The team's name. Name *string `json:"name,omitempty"` @@ -11472,9 +11213,10 @@ func (t *TeamParentTeam) Accept(visitor TeamParentTeamVisitor) error { type TimeOff struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee requesting time off. Employee *TimeOffEmployee `json:"employee,omitempty"` @@ -11610,9 +11352,10 @@ func (t *TimeOffApprover) Accept(visitor TimeOffApproverVisitor) error { type TimeOffBalance struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee the balance belongs to. Employee *TimeOffBalanceEmployee `json:"employee,omitempty"` @@ -12490,9 +12233,10 @@ func (t *TimeOffUnits) Accept(visitor TimeOffUnitsVisitor) error { type TimesheetEntry struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The employee the timesheet entry is for. Employee *string `json:"employee,omitempty"` diff --git a/ticketing/audit_trail.go b/ticketing/audit_trail.go index 8b681f5..2c7f109 100644 --- a/ticketing/audit_trail.go +++ b/ticketing/audit_trail.go @@ -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` + // 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` EventType *string `json:"-"` // Number of results to return per page. PageSize *int `json:"-"` diff --git a/ticketing/client/client.go b/ticketing/client/client.go index 91d6cf8..140cbb3 100644 --- a/ticketing/client/client.go +++ b/ticketing/client/client.go @@ -26,7 +26,6 @@ import ( regeneratekey "github.com/merge-api/merge-go-client/ticketing/regeneratekey" roles "github.com/merge-api/merge-go-client/ticketing/roles" scopes "github.com/merge-api/merge-go-client/ticketing/scopes" - selectivesync "github.com/merge-api/merge-go-client/ticketing/selectivesync" syncstatus "github.com/merge-api/merge-go-client/ticketing/syncstatus" tags "github.com/merge-api/merge-go-client/ticketing/tags" teams "github.com/merge-api/merge-go-client/ticketing/teams" @@ -62,7 +61,6 @@ type Client struct { Projects *projects.Client RegenerateKey *regeneratekey.Client Roles *roles.Client - SelectiveSync *selectivesync.Client SyncStatus *syncstatus.Client ForceResync *forceresync.Client Tags *tags.Client @@ -102,7 +100,6 @@ func NewClient(opts ...core.ClientOption) *Client { Projects: projects.NewClient(opts...), RegenerateKey: regeneratekey.NewClient(opts...), Roles: roles.NewClient(opts...), - SelectiveSync: selectivesync.NewClient(opts...), SyncStatus: syncstatus.NewClient(opts...), ForceResync: forceresync.NewClient(opts...), Tags: tags.NewClient(opts...), diff --git a/ticketing/contacts.go b/ticketing/contacts.go index ce21d1a..eb3c202 100644 --- a/ticketing/contacts.go +++ b/ticketing/contacts.go @@ -6,6 +6,14 @@ import ( time "time" ) +type TicketingContactEndpointRequest 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 *ContactRequest `json:"model,omitempty"` +} + type ContactsListRequest struct { // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-"` diff --git a/ticketing/contacts/client.go b/ticketing/contacts/client.go index 4b4969d..125b810 100644 --- a/ticketing/contacts/client.go +++ b/ticketing/contacts/client.go @@ -88,6 +88,41 @@ func (c *Client) List(ctx context.Context, request *ticketing.ContactsListReques return response, nil } +// Creates a `Contact` object with the given values. +func (c *Client) Create(ctx context.Context, request *ticketing.TicketingContactEndpointRequest) (*ticketing.TicketingContactResponse, error) { + baseURL := "https://api.merge.dev/api" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "ticketing/v1/contacts" + + queryParams := make(url.Values) + if request.IsDebugMode != nil { + queryParams.Add("is_debug_mode", fmt.Sprintf("%v", *request.IsDebugMode)) + } + if request.RunAsync != nil { + queryParams.Add("run_async", fmt.Sprintf("%v", *request.RunAsync)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *ticketing.TicketingContactResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + // Returns a `Contact` object with the given `id`. func (c *Client) Retrieve(ctx context.Context, id string, request *ticketing.ContactsRetrieveRequest) (*ticketing.Contact, error) { baseURL := "https://api.merge.dev/api" @@ -121,3 +156,26 @@ func (c *Client) Retrieve(ctx context.Context, id string, request *ticketing.Con } return response, nil } + +// Returns metadata for `TicketingContact` POSTs. +func (c *Client) MetaPostRetrieve(ctx context.Context) (*ticketing.MetaResponse, error) { + baseURL := "https://api.merge.dev/api" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "ticketing/v1/contacts/meta/post" + + var response *ticketing.MetaResponse + 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 +} diff --git a/ticketing/link_token.go b/ticketing/link_token.go index 606fb99..cabfb5c 100644 --- a/ticketing/link_token.go +++ b/ticketing/link_token.go @@ -23,4 +23,6 @@ type EndUserDetailsRequest struct { CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` // The language code for the language to localize Merge Link to. Language *string `json:"language,omitempty"` + // A JSON object containing integration-specific configuration options. + IntegrationSpecificConfig map[string]interface{} `json:"integration_specific_config,omitempty"` } diff --git a/ticketing/selective_sync.go b/ticketing/selective_sync.go deleted file mode 100644 index 5f8e202..0000000 --- a/ticketing/selective_sync.go +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package ticketing - -type LinkedAccountSelectiveSyncConfigurationListRequest struct { - // The selective syncs associated with a linked account. - SyncConfigurations []*LinkedAccountSelectiveSyncConfigurationRequest `json:"sync_configurations,omitempty"` -} - -type SelectiveSyncMetaListRequest struct { - CommonModel *string `json:"-"` - // The pagination cursor value. - Cursor *string `json:"-"` - // Number of results to return per page. - PageSize *int `json:"-"` -} diff --git a/ticketing/selectivesync/client.go b/ticketing/selectivesync/client.go deleted file mode 100644 index 254f4d7..0000000 --- a/ticketing/selectivesync/client.go +++ /dev/null @@ -1,114 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package selectivesync - -import ( - context "context" - fmt "fmt" - core "github.com/merge-api/merge-go-client/core" - ticketing "github.com/merge-api/merge-go-client/ticketing" - http "net/http" - url "net/url" -) - -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(), - } -} - -// Get a linked account's selective syncs. -func (c *Client) ConfigurationsList(ctx context.Context) ([]*ticketing.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "ticketing/v1/selective-sync/configurations" - - var response []*ticketing.LinkedAccountSelectiveSyncConfiguration - 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 -} - -// Replace a linked account's selective syncs. -func (c *Client) ConfigurationsUpdate(ctx context.Context, request *ticketing.LinkedAccountSelectiveSyncConfigurationListRequest) ([]*ticketing.LinkedAccountSelectiveSyncConfiguration, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "ticketing/v1/selective-sync/configurations" - - var response []*ticketing.LinkedAccountSelectiveSyncConfiguration - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// Get metadata for the conditions available to a linked account. -func (c *Client) MetaList(ctx context.Context, request *ticketing.SelectiveSyncMetaListRequest) (*ticketing.PaginatedConditionSchemaList, error) { - baseURL := "https://api.merge.dev/api" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "ticketing/v1/selective-sync/meta" - - queryParams := make(url.Values) - if request.CommonModel != nil { - queryParams.Add("common_model", fmt.Sprintf("%v", *request.CommonModel)) - } - if request.Cursor != nil { - queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) - } - if request.PageSize != nil { - queryParams.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *ticketing.PaginatedConditionSchemaList - 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 -} diff --git a/ticketing/types.go b/ticketing/types.go index c2a871f..c2e6956 100644 --- a/ticketing/types.go +++ b/ticketing/types.go @@ -51,9 +51,10 @@ func (a AccessLevelEnum) Ptr() *AccessLevelEnum { type Account struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The account's name. Name *string `json:"name,omitempty"` @@ -395,9 +396,10 @@ func (a *AsyncPassthroughReciept) String() string { type Attachment struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The attachment's name. It is required to include the file extension in the attachment's name. FileName *string `json:"file_name,omitempty"` @@ -658,6 +660,9 @@ type AuditLogEvent struct { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + // - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + // - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + // - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED EventType *AuditLogEventEventType `json:"event_type,omitempty"` EventDescription string `json:"event_description"` CreatedAt *time.Time `json:"created_at,omitempty"` @@ -724,6 +729,9 @@ func (a *AuditLogEvent) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type AuditLogEventEventType struct { typeName string EventTypeEnum EventTypeEnum @@ -987,9 +995,10 @@ func (c CategoryEnum) Ptr() *CategoryEnum { type Collection struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The collection's name. Name *string `json:"name,omitempty"` @@ -1256,9 +1265,10 @@ func (c CollectionTypeEnum) Ptr() *CollectionTypeEnum { type Comment struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The author of the Comment, if the author is a User. User *CommentUser `json:"user,omitempty"` @@ -1796,43 +1806,53 @@ func (c *CommonModelScopesBodyRequest) String() string { return fmt.Sprintf("%#v", c) } -type ConditionSchema struct { - // The ID of the condition schema. This ID is used when updating selective syncs for a linked account. - Id string `json:"id"` - // The common model for which a condition schema is defined. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - FieldName *string `json:"field_name,omitempty"` - // Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - // The type of value(s) that can be set for this condition. - // - // - `BOOLEAN` - BOOLEAN - // - `DATE` - DATE - // - `DATE_TIME` - DATE_TIME - // - `INTEGER` - INTEGER - // - `FLOAT` - FLOAT - // - `STRING` - STRING - // - `LIST_OF_STRINGS` - LIST_OF_STRINGS - ConditionType *ConditionSchemaConditionType `json:"condition_type,omitempty"` - // The schemas for the operators that can be used on a condition. - Operators []*OperatorSchema `json:"operators,omitempty"` +// # The Contact Object +// +// ### Description +// +// The `Contact` object is used to represent the customer, lead, or external user that a ticket is associated with. +// +// ### Usage Example +// +// TODO +type Contact struct { + Id *string `json:"id,omitempty"` + // The third-party API ID of the matching object. + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. + CreatedAt *time.Time `json:"created_at,omitempty"` + // The datetime that this object was modified by Merge. + ModifiedAt *time.Time `json:"modified_at,omitempty"` + // The contact's name. + Name *string `json:"name,omitempty"` + // The contact's email address. + EmailAddress *string `json:"email_address,omitempty"` + // The contact's phone number. + PhoneNumber *string `json:"phone_number,omitempty"` + // The contact's details. + Details *string `json:"details,omitempty"` + // The contact's account. + Account *ContactAccount `json:"account,omitempty"` + // Indicates whether or not this object has been deleted in the third party platform. + RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty"` + FieldMappings map[string]interface{} `json:"field_mappings,omitempty"` + RemoteData []*RemoteData `json:"remote_data,omitempty"` _rawJSON json.RawMessage } -func (c *ConditionSchema) UnmarshalJSON(data []byte) error { - type unmarshaler ConditionSchema +func (c *Contact) UnmarshalJSON(data []byte) error { + type unmarshaler Contact var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ConditionSchema(value) + *c = Contact(value) c._rawJSON = json.RawMessage(data) return nil } -func (c *ConditionSchema) String() string { +func (c *Contact) String() string { if len(c._rawJSON) > 0 { if value, err := core.StringifyJSON(c._rawJSON); err == nil { return value @@ -1844,116 +1864,64 @@ func (c *ConditionSchema) String() string { return fmt.Sprintf("%#v", c) } -// The type of value(s) that can be set for this condition. -// -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionSchemaConditionType struct { - typeName string - ConditionTypeEnum ConditionTypeEnum - String string +// The contact's account. +type ContactAccount struct { + typeName string + String string + Account *Account } -func NewConditionSchemaConditionTypeFromConditionTypeEnum(value ConditionTypeEnum) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "conditionTypeEnum", ConditionTypeEnum: value} +func NewContactAccountFromString(value string) *ContactAccount { + return &ContactAccount{typeName: "string", String: value} } -func NewConditionSchemaConditionTypeFromString(value string) *ConditionSchemaConditionType { - return &ConditionSchemaConditionType{typeName: "string", String: value} +func NewContactAccountFromAccount(value *Account) *ContactAccount { + return &ContactAccount{typeName: "account", Account: value} } -func (c *ConditionSchemaConditionType) UnmarshalJSON(data []byte) error { - var valueConditionTypeEnum ConditionTypeEnum - if err := json.Unmarshal(data, &valueConditionTypeEnum); err == nil { - c.typeName = "conditionTypeEnum" - c.ConditionTypeEnum = valueConditionTypeEnum - return nil - } +func (c *ContactAccount) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { c.typeName = "string" c.String = valueString return nil } + valueAccount := new(Account) + if err := json.Unmarshal(data, &valueAccount); err == nil { + c.typeName = "account" + c.Account = valueAccount + return nil + } return fmt.Errorf("%s cannot be deserialized as a %T", data, c) } -func (c ConditionSchemaConditionType) MarshalJSON() ([]byte, error) { +func (c ContactAccount) MarshalJSON() ([]byte, error) { switch c.typeName { default: return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return json.Marshal(c.ConditionTypeEnum) case "string": return json.Marshal(c.String) + case "account": + return json.Marshal(c.Account) } } -type ConditionSchemaConditionTypeVisitor interface { - VisitConditionTypeEnum(ConditionTypeEnum) error +type ContactAccountVisitor interface { VisitString(string) error + VisitAccount(*Account) error } -func (c *ConditionSchemaConditionType) Accept(visitor ConditionSchemaConditionTypeVisitor) error { +func (c *ContactAccount) Accept(visitor ContactAccountVisitor) error { switch c.typeName { default: return fmt.Errorf("invalid type %s in %T", c.typeName, c) - case "conditionTypeEnum": - return visitor.VisitConditionTypeEnum(c.ConditionTypeEnum) case "string": return visitor.VisitString(c.String) + case "account": + return visitor.VisitAccount(c.Account) } } -// - `BOOLEAN` - BOOLEAN -// - `DATE` - DATE -// - `DATE_TIME` - DATE_TIME -// - `INTEGER` - INTEGER -// - `FLOAT` - FLOAT -// - `STRING` - STRING -// - `LIST_OF_STRINGS` - LIST_OF_STRINGS -type ConditionTypeEnum string - -const ( - ConditionTypeEnumBoolean ConditionTypeEnum = "BOOLEAN" - ConditionTypeEnumDate ConditionTypeEnum = "DATE" - ConditionTypeEnumDateTime ConditionTypeEnum = "DATE_TIME" - ConditionTypeEnumInteger ConditionTypeEnum = "INTEGER" - ConditionTypeEnumFloat ConditionTypeEnum = "FLOAT" - ConditionTypeEnumString ConditionTypeEnum = "STRING" - ConditionTypeEnumListOfStrings ConditionTypeEnum = "LIST_OF_STRINGS" -) - -func NewConditionTypeEnumFromString(s string) (ConditionTypeEnum, error) { - switch s { - case "BOOLEAN": - return ConditionTypeEnumBoolean, nil - case "DATE": - return ConditionTypeEnumDate, nil - case "DATE_TIME": - return ConditionTypeEnumDateTime, nil - case "INTEGER": - return ConditionTypeEnumInteger, nil - case "FLOAT": - return ConditionTypeEnumFloat, nil - case "STRING": - return ConditionTypeEnumString, nil - case "LIST_OF_STRINGS": - return ConditionTypeEnumListOfStrings, nil - } - var t ConditionTypeEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { - return &c -} - // # The Contact Object // // ### Description @@ -1963,13 +1931,7 @@ func (c ConditionTypeEnum) Ptr() *ConditionTypeEnum { // ### Usage Example // // TODO -type Contact struct { - Id *string `json:"id,omitempty"` - // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge - ModifiedAt *time.Time `json:"modified_at,omitempty"` +type ContactRequest struct { // The contact's name. Name *string `json:"name,omitempty"` // The contact's email address. @@ -1979,27 +1941,25 @@ type Contact struct { // The contact's details. Details *string `json:"details,omitempty"` // The contact's account. - Account *ContactAccount `json:"account,omitempty"` - // Indicates whether or not this object has been deleted in the third party platform. - RemoteWasDeleted *bool `json:"remote_was_deleted,omitempty"` - FieldMappings map[string]interface{} `json:"field_mappings,omitempty"` - RemoteData []*RemoteData `json:"remote_data,omitempty"` + Account *ContactRequestAccount `json:"account,omitempty"` + IntegrationParams map[string]interface{} `json:"integration_params,omitempty"` + LinkedAccountParams map[string]interface{} `json:"linked_account_params,omitempty"` _rawJSON json.RawMessage } -func (c *Contact) UnmarshalJSON(data []byte) error { - type unmarshaler Contact +func (c *ContactRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ContactRequest var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = Contact(value) + *c = ContactRequest(value) c._rawJSON = json.RawMessage(data) return nil } -func (c *Contact) String() string { +func (c *ContactRequest) String() string { if len(c._rawJSON) > 0 { if value, err := core.StringifyJSON(c._rawJSON); err == nil { return value @@ -2012,21 +1972,21 @@ func (c *Contact) String() string { } // The contact's account. -type ContactAccount struct { +type ContactRequestAccount struct { typeName string String string Account *Account } -func NewContactAccountFromString(value string) *ContactAccount { - return &ContactAccount{typeName: "string", String: value} +func NewContactRequestAccountFromString(value string) *ContactRequestAccount { + return &ContactRequestAccount{typeName: "string", String: value} } -func NewContactAccountFromAccount(value *Account) *ContactAccount { - return &ContactAccount{typeName: "account", Account: value} +func NewContactRequestAccountFromAccount(value *Account) *ContactRequestAccount { + return &ContactRequestAccount{typeName: "account", Account: value} } -func (c *ContactAccount) UnmarshalJSON(data []byte) error { +func (c *ContactRequestAccount) UnmarshalJSON(data []byte) error { var valueString string if err := json.Unmarshal(data, &valueString); err == nil { c.typeName = "string" @@ -2042,7 +2002,7 @@ func (c *ContactAccount) UnmarshalJSON(data []byte) error { return fmt.Errorf("%s cannot be deserialized as a %T", data, c) } -func (c ContactAccount) MarshalJSON() ([]byte, error) { +func (c ContactRequestAccount) MarshalJSON() ([]byte, error) { switch c.typeName { default: return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c) @@ -2053,12 +2013,12 @@ func (c ContactAccount) MarshalJSON() ([]byte, error) { } } -type ContactAccountVisitor interface { +type ContactRequestAccountVisitor interface { VisitString(string) error VisitAccount(*Account) error } -func (c *ContactAccount) Accept(visitor ContactAccountVisitor) error { +func (c *ContactRequestAccount) Accept(visitor ContactRequestAccountVisitor) error { switch c.typeName { default: return fmt.Errorf("invalid type %s in %T", c.typeName, c) @@ -2300,6 +2260,9 @@ func (e *ErrorValidationProblem) String() string { // - `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC // - `MUTED_ISSUE` - MUTED_ISSUE // - `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK +// - `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK +// - `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK +// - `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED type EventTypeEnum string const ( @@ -2337,6 +2300,9 @@ const ( EventTypeEnumForcedLinkedAccountResync EventTypeEnum = "FORCED_LINKED_ACCOUNT_RESYNC" EventTypeEnumMutedIssue EventTypeEnum = "MUTED_ISSUE" EventTypeEnumGeneratedMagicLink EventTypeEnum = "GENERATED_MAGIC_LINK" + EventTypeEnumEnabledMergeWebhook EventTypeEnum = "ENABLED_MERGE_WEBHOOK" + EventTypeEnumDisabledMergeWebhook EventTypeEnum = "DISABLED_MERGE_WEBHOOK" + EventTypeEnumMergeWebhookTargetChanged EventTypeEnum = "MERGE_WEBHOOK_TARGET_CHANGED" ) func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { @@ -2409,6 +2375,12 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumMutedIssue, nil case "GENERATED_MAGIC_LINK": return EventTypeEnumGeneratedMagicLink, nil + case "ENABLED_MERGE_WEBHOOK": + return EventTypeEnumEnabledMergeWebhook, nil + case "DISABLED_MERGE_WEBHOOK": + return EventTypeEnumDisabledMergeWebhook, nil + case "MERGE_WEBHOOK_TARGET_CHANGED": + return EventTypeEnumMergeWebhookTargetChanged, nil } var t EventTypeEnum return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -3153,138 +3125,6 @@ func (l *LinkToken) String() string { return fmt.Sprintf("%#v", l) } -type LinkedAccountCondition struct { - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The common model for a specific condition. - CommonModel *string `json:"common_model,omitempty"` - NativeName *string `json:"native_name,omitempty"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - FieldName *string `json:"field_name,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountCondition) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountCondition - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountCondition(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountCondition) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountConditionRequest struct { - // The ID indicating which Linked Account Condition this is. - Id *string `json:"id,omitempty"` - // The ID indicating which condition schema to use for a specific condition. - ConditionSchemaId string `json:"condition_schema_id"` - // The operator for a specific condition. - Operator string `json:"operator"` - Value interface{} `json:"value,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountConditionRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountConditionRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountConditionRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountConditionRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfiguration struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountCondition `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfiguration) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfiguration - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfiguration(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfiguration) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LinkedAccountSelectiveSyncConfigurationRequest struct { - // The conditions belonging to a selective sync. - LinkedAccountConditions []*LinkedAccountConditionRequest `json:"linked_account_conditions,omitempty"` - - _rawJSON json.RawMessage -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) UnmarshalJSON(data []byte) error { - type unmarshaler LinkedAccountSelectiveSyncConfigurationRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LinkedAccountSelectiveSyncConfigurationRequest(value) - l._rawJSON = json.RawMessage(data) - return nil -} - -func (l *LinkedAccountSelectiveSyncConfigurationRequest) String() string { - if len(l._rawJSON) > 0 { - if value, err := core.StringifyJSON(l._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - type LinkedAccountStatus struct { LinkedAccountStatus string `json:"linked_account_status"` CanMakeRequest bool `json:"can_make_request"` @@ -3604,38 +3444,6 @@ func (m *MultipartFormFieldRequestEncoding) Accept(visitor MultipartFormFieldReq } } -type OperatorSchema struct { - // The operator for which an operator schema is defined. - Operator *string `json:"operator,omitempty"` - // Whether the operator can be repeated multiple times. - IsUnique *bool `json:"is_unique,omitempty"` - - _rawJSON json.RawMessage -} - -func (o *OperatorSchema) UnmarshalJSON(data []byte) error { - type unmarshaler OperatorSchema - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *o = OperatorSchema(value) - o._rawJSON = json.RawMessage(data) - return nil -} - -func (o *OperatorSchema) String() string { - if len(o._rawJSON) > 0 { - if value, err := core.StringifyJSON(o._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(o); err == nil { - return value - } - return fmt.Sprintf("%#v", o) -} - type PaginatedAccountDetailsAndActionsList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -3822,37 +3630,6 @@ func (p *PaginatedCommentList) String() string { return fmt.Sprintf("%#v", p) } -type PaginatedConditionSchemaList struct { - Next *string `json:"next,omitempty"` - Previous *string `json:"previous,omitempty"` - Results []*ConditionSchema `json:"results,omitempty"` - - _rawJSON json.RawMessage -} - -func (p *PaginatedConditionSchemaList) UnmarshalJSON(data []byte) error { - type unmarshaler PaginatedConditionSchemaList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PaginatedConditionSchemaList(value) - p._rawJSON = json.RawMessage(data) - return nil -} - -func (p *PaginatedConditionSchemaList) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - type PaginatedContactList struct { Next *string `json:"next,omitempty"` Previous *string `json:"previous,omitempty"` @@ -4410,9 +4187,10 @@ func (p PriorityEnum) Ptr() *PriorityEnum { type Project struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The project's name. Name *string `json:"name,omitempty"` @@ -4541,11 +4319,12 @@ func (r *RemoteField) String() string { } type RemoteFieldApi struct { - Schema map[string]interface{} `json:"schema,omitempty"` - RemoteKeyName string `json:"remote_key_name"` - RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` - ExampleValues []interface{} `json:"example_values,omitempty"` - AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteKeyName string `json:"remote_key_name"` + RemoteEndpointInfo *RemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + ExampleValues []interface{} `json:"example_values,omitempty"` + AdvancedMetadata *AdvancedMetadata `json:"advanced_metadata,omitempty"` + Coverage *RemoteFieldApiCoverage `json:"coverage,omitempty"` _rawJSON json.RawMessage } @@ -4573,6 +4352,63 @@ func (r *RemoteFieldApi) String() string { return fmt.Sprintf("%#v", r) } +type RemoteFieldApiCoverage struct { + typeName string + Integer int + Double float64 +} + +func NewRemoteFieldApiCoverageFromInteger(value int) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "integer", Integer: value} +} + +func NewRemoteFieldApiCoverageFromDouble(value float64) *RemoteFieldApiCoverage { + return &RemoteFieldApiCoverage{typeName: "double", Double: value} +} + +func (r *RemoteFieldApiCoverage) UnmarshalJSON(data []byte) error { + var valueInteger int + if err := json.Unmarshal(data, &valueInteger); err == nil { + r.typeName = "integer" + r.Integer = valueInteger + return nil + } + var valueDouble float64 + if err := json.Unmarshal(data, &valueDouble); err == nil { + r.typeName = "double" + r.Double = valueDouble + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, r) +} + +func (r RemoteFieldApiCoverage) MarshalJSON() ([]byte, error) { + switch r.typeName { + default: + return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return json.Marshal(r.Integer) + case "double": + return json.Marshal(r.Double) + } +} + +type RemoteFieldApiCoverageVisitor interface { + VisitInteger(int) error + VisitDouble(float64) error +} + +func (r *RemoteFieldApiCoverage) Accept(visitor RemoteFieldApiCoverageVisitor) error { + switch r.typeName { + default: + return fmt.Errorf("invalid type %s in %T", r.typeName, r) + case "integer": + return visitor.VisitInteger(r.Integer) + case "double": + return visitor.VisitDouble(r.Double) + } +} + type RemoteFieldApiResponse struct { Ticket []*RemoteFieldApi `json:"Ticket,omitempty"` Comment []*RemoteFieldApi `json:"Comment,omitempty"` @@ -5085,9 +4921,10 @@ func (r ResponseTypeEnum) Ptr() *ResponseTypeEnum { type Role struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The name of the Role. Name *string `json:"name,omitempty"` @@ -5408,9 +5245,10 @@ func (s SyncStatusStatusEnum) Ptr() *SyncStatusStatusEnum { // TODO type Tag struct { // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The tag's name. Name *string `json:"name,omitempty"` @@ -5457,9 +5295,10 @@ func (t *Tag) String() string { type Team struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The team's name. Name *string `json:"name,omitempty"` @@ -5508,9 +5347,10 @@ func (t *Team) String() string { type Ticket struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The ticket's name. Name *string `json:"name,omitempty"` @@ -6885,6 +6725,38 @@ func (t *TicketingAttachmentResponse) String() string { return fmt.Sprintf("%#v", t) } +type TicketingContactResponse struct { + Model *Contact `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (t *TicketingContactResponse) UnmarshalJSON(data []byte) error { + type unmarshaler TicketingContactResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *t = TicketingContactResponse(value) + t._rawJSON = json.RawMessage(data) + return nil +} + +func (t *TicketingContactResponse) String() string { + if len(t._rawJSON) > 0 { + if value, err := core.StringifyJSON(t._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(t); err == nil { + return value + } + return fmt.Sprintf("%#v", t) +} + // # The User Object // // ### Description @@ -6897,9 +6769,10 @@ func (t *TicketingAttachmentResponse) String() string { type User struct { Id *string `json:"id,omitempty"` // The third-party API ID of the matching object. - RemoteId *string `json:"remote_id,omitempty"` + RemoteId *string `json:"remote_id,omitempty"` + // The datetime that this object was created by Merge. CreatedAt *time.Time `json:"created_at,omitempty"` - // This is the datetime that this object was last updated by Merge + // The datetime that this object was modified by Merge. ModifiedAt *time.Time `json:"modified_at,omitempty"` // The user's name. Name *string `json:"name,omitempty"`