diff --git a/accounting/audit_trail.go b/accounting/audit_trail.go index 8d3adf0..0a48197 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_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` + // 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` 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 a1ee4a1..986b4fb 100644 --- a/accounting/client/client.go +++ b/accounting/client/client.go @@ -19,6 +19,7 @@ import ( creditnotes "github.com/merge-api/merge-go-client/accounting/creditnotes" deleteaccount "github.com/merge-api/merge-go-client/accounting/deleteaccount" expenses "github.com/merge-api/merge-go-client/accounting/expenses" + fieldmapping "github.com/merge-api/merge-go-client/accounting/fieldmapping" forceresync "github.com/merge-api/merge-go-client/accounting/forceresync" generatekey "github.com/merge-api/merge-go-client/accounting/generatekey" incomestatements "github.com/merge-api/merge-go-client/accounting/incomestatements" @@ -33,6 +34,7 @@ import ( phonenumbers "github.com/merge-api/merge-go-client/accounting/phonenumbers" 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" @@ -63,8 +65,10 @@ type Client struct { CompanyInfo *companyinfo.Client Contacts *contacts.Client CreditNotes *creditnotes.Client + Scopes *scopes.Client DeleteAccount *deleteaccount.Client Expenses *expenses.Client + FieldMapping *fieldmapping.Client GenerateKey *generatekey.Client IncomeStatements *incomestatements.Client Invoices *invoices.Client @@ -111,8 +115,10 @@ func NewClient(opts ...core.ClientOption) *Client { CompanyInfo: companyinfo.NewClient(opts...), Contacts: contacts.NewClient(opts...), CreditNotes: creditnotes.NewClient(opts...), + Scopes: scopes.NewClient(opts...), DeleteAccount: deleteaccount.NewClient(opts...), Expenses: expenses.NewClient(opts...), + FieldMapping: fieldmapping.NewClient(opts...), GenerateKey: generatekey.NewClient(opts...), IncomeStatements: incomestatements.NewClient(opts...), Invoices: invoices.NewClient(opts...), diff --git a/accounting/field_mapping.go b/accounting/field_mapping.go new file mode 100644 index 0000000..7108c44 --- /dev/null +++ b/accounting/field_mapping.go @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +package accounting + +type CreateFieldMappingRequest struct { + // The name of the target field you want this remote field to map to. + TargetFieldName string `json:"target_field_name"` + // The description of the target field you want this remote field to map to. + TargetFieldDescription string `json:"target_field_description"` + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod string `json:"remote_method"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath string `json:"remote_url_path"` + // The name of the Common Model that the remote field corresponds to in a given category. + CommonModelName string `json:"common_model_name"` +} + +type PatchedEditFieldMappingRequest struct { + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod *string `json:"remote_method,omitempty"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath *string `json:"remote_url_path,omitempty"` +} + +type RemoteFieldsRetrieveRequest struct { + // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + CommonModels *string `json:"-"` + // If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + IncludeExampleValues *string `json:"-"` +} diff --git a/accounting/fieldmapping/client.go b/accounting/fieldmapping/client.go new file mode 100644 index 0000000..deabeca --- /dev/null +++ b/accounting/fieldmapping/client.go @@ -0,0 +1,181 @@ +// This file was auto-generated by Fern from our API Definition. + +package fieldmapping + +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 all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) FieldMappingsRetrieve(ctx context.Context) (*accounting.FieldMappingApiInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/field-mappings" + + var response *accounting.FieldMappingApiInstanceResponse + 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 +} + +// Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsCreate(ctx context.Context, request *accounting.CreateFieldMappingRequest) (*accounting.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/field-mappings" + + var response *accounting.FieldMappingInstanceResponse + 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 +} + +// Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsDestroy(ctx context.Context, fieldMappingId string) (*accounting.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/accounting/v1/field-mappings/%v", fieldMappingId) + + var response *accounting.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsPartialUpdate(ctx context.Context, fieldMappingId string, request *accounting.PatchedEditFieldMappingRequest) (*accounting.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/accounting/v1/field-mappings/%v", fieldMappingId) + + var response *accounting.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) RemoteFieldsRetrieve(ctx context.Context, request *accounting.RemoteFieldsRetrieveRequest) (*accounting.RemoteFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/remote-fields" + + queryParams := make(url.Values) + if request.CommonModels != nil { + queryParams.Add("common_models", fmt.Sprintf("%v", *request.CommonModels)) + } + if request.IncludeExampleValues != nil { + queryParams.Add("include_example_values", fmt.Sprintf("%v", *request.IncludeExampleValues)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *accounting.RemoteFieldApiResponse + 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 +} + +// Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +func (c *Client) TargetFieldsRetrieve(ctx context.Context) (*accounting.ExternalTargetFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/target-fields" + + var response *accounting.ExternalTargetFieldApiResponse + 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/forceresync/client.go b/accounting/forceresync/client.go index f710240..d2a6652 100644 --- a/accounting/forceresync/client.go +++ b/accounting/forceresync/client.go @@ -27,7 +27,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Launch, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. func (c *Client) SyncStatusResyncCreate(ctx context.Context) ([]*accounting.SyncStatus, error) { baseURL := "https://api.merge.dev" if c.baseURL != "" { diff --git a/accounting/issues.go b/accounting/issues.go index 06b957a..fc9eceb 100644 --- a/accounting/issues.go +++ b/accounting/issues.go @@ -18,7 +18,7 @@ type IssuesListRequest struct { FirstIncidentTimeAfter *time.Time `json:"-"` // If provided, will only return issues whose first incident time was before this datetime. FirstIncidentTimeBefore *time.Time `json:"-"` - // If True, will include muted issues + // If true, will include muted issues IncludeMuted *string `json:"-"` IntegrationName *string `json:"-"` // If provided, will only return issues whose last incident time was after this datetime. diff --git a/accounting/link_token.go b/accounting/link_token.go index a953c34..9302aa0 100644 --- a/accounting/link_token.go +++ b/accounting/link_token.go @@ -19,4 +19,6 @@ type EndUserDetailsRequest struct { ShouldCreateMagicLinkUrl *bool `json:"should_create_magic_link_url,omitempty"` // An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. CommonModels []*CommonModelScopesBodyRequest `json:"common_models,omitempty"` + // When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` } diff --git a/accounting/scopes.go b/accounting/scopes.go new file mode 100644 index 0000000..f26c3a0 --- /dev/null +++ b/accounting/scopes.go @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +package accounting + +type LinkedAccountCommonModelScopeDeserializerRequest struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty"` +} diff --git a/accounting/scopes/client.go b/accounting/scopes/client.go new file mode 100644 index 0000000..76ecfbf --- /dev/null +++ b/accounting/scopes/client.go @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +package scopes + +import ( + context "context" + accounting "github.com/merge-api/merge-go-client/accounting" + core "github.com/merge-api/merge-go-client/core" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +// Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) DefaultScopesRetrieve(ctx context.Context) (*accounting.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/default-scopes" + + var response *accounting.CommonModelScopeApi + 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 +} + +// Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) LinkedAccountScopesRetrieve(ctx context.Context) (*accounting.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/linked-account-scopes" + + var response *accounting.CommonModelScopeApi + 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 +} + +// Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes) +func (c *Client) LinkedAccountScopesCreate(ctx context.Context, request *accounting.LinkedAccountCommonModelScopeDeserializerRequest) (*accounting.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/accounting/v1/linked-account-scopes" + + var response *accounting.CommonModelScopeApi + 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 +} diff --git a/accounting/types.go b/accounting/types.go index 98993b1..c4caa35 100644 --- a/accounting/types.go +++ b/accounting/types.go @@ -995,12 +995,12 @@ type AccountIntegration struct { // The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. Color *string `json:"color,omitempty"` Slug *string `json:"slug,omitempty"` - // If checked, this integration will not appear in the linking flow, and will appear elsewhere with a Beta tag. - IsInBeta *bool `json:"is_in_beta,omitempty"` // Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} ApiEndpointsToDocumentationUrls map[string]interface{} `json:"api_endpoints_to_documentation_urls,omitempty"` // Setup guide URL for third party webhook creation. Exposed in Merge Docs. WebhookSetupGuideUrl *string `json:"webhook_setup_guide_url,omitempty"` + // Category or categories this integration is in beta status for. + CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty"` _rawJSON json.RawMessage } @@ -3777,6 +3777,40 @@ func (a AddressTypeEnum) Ptr() *AddressTypeEnum { return &a } +type AdvancedMetadata struct { + Id string `json:"id"` + DisplayName *string `json:"display_name,omitempty"` + Description *string `json:"description,omitempty"` + IsRequired *bool `json:"is_required,omitempty"` + IsCustom *bool `json:"is_custom,omitempty"` + FieldChoices []interface{} `json:"field_choices,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AdvancedMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AdvancedMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AdvancedMetadata) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id"` @@ -3835,6 +3869,7 @@ type AuditLogEvent struct { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION + // - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -3897,6 +3932,7 @@ func (a *AuditLogEvent) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -5814,6 +5850,36 @@ func (c ClassificationEnum) Ptr() *ClassificationEnum { return &c } +type CommonModelScopeApi struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { + type unmarshaler CommonModelScopeApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CommonModelScopeApi(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CommonModelScopeApi) 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) +} + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions,omitempty"` @@ -10969,6 +11035,7 @@ func (e *ErrorValidationProblem) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -11002,6 +11069,7 @@ const ( EventTypeEnumDeletedLinkedAccount EventTypeEnum = "DELETED_LINKED_ACCOUNT" EventTypeEnumCreatedDestination EventTypeEnum = "CREATED_DESTINATION" EventTypeEnumDeletedDestination EventTypeEnum = "DELETED_DESTINATION" + EventTypeEnumChangedDestination EventTypeEnum = "CHANGED_DESTINATION" EventTypeEnumChangedScopes EventTypeEnum = "CHANGED_SCOPES" EventTypeEnumChangedPersonalInformation EventTypeEnum = "CHANGED_PERSONAL_INFORMATION" EventTypeEnumChangedOrganizationSettings EventTypeEnum = "CHANGED_ORGANIZATION_SETTINGS" @@ -11047,6 +11115,8 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumCreatedDestination, nil case "DELETED_DESTINATION": return EventTypeEnumDeletedDestination, nil + case "CHANGED_DESTINATION": + return EventTypeEnumChangedDestination, nil case "CHANGED_SCOPES": return EventTypeEnumChangedScopes, nil case "CHANGED_PERSONAL_INFORMATION": @@ -15230,6 +15300,348 @@ func (e *ExpenseTrackingCategoriesItem) Accept(visitor ExpenseTrackingCategories } } +type ExternalTargetFieldApi struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + IsMapped *string `json:"is_mapped,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApi(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApi) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type ExternalTargetFieldApiResponse struct { + Account []*ExternalTargetFieldApi `json:"Account,omitempty"` + AccountingAttachment []*ExternalTargetFieldApi `json:"AccountingAttachment,omitempty"` + BalanceSheet []*ExternalTargetFieldApi `json:"BalanceSheet,omitempty"` + CashFlowStatement []*ExternalTargetFieldApi `json:"CashFlowStatement,omitempty"` + CompanyInfo []*ExternalTargetFieldApi `json:"CompanyInfo,omitempty"` + Contact []*ExternalTargetFieldApi `json:"Contact,omitempty"` + IncomeStatement []*ExternalTargetFieldApi `json:"IncomeStatement,omitempty"` + CreditNote []*ExternalTargetFieldApi `json:"CreditNote,omitempty"` + Item []*ExternalTargetFieldApi `json:"Item,omitempty"` + PurchaseOrder []*ExternalTargetFieldApi `json:"PurchaseOrder,omitempty"` + TrackingCategory []*ExternalTargetFieldApi `json:"TrackingCategory,omitempty"` + JournalEntry []*ExternalTargetFieldApi `json:"JournalEntry,omitempty"` + TaxRate []*ExternalTargetFieldApi `json:"TaxRate,omitempty"` + Invoice []*ExternalTargetFieldApi `json:"Invoice,omitempty"` + Payment []*ExternalTargetFieldApi `json:"Payment,omitempty"` + Expense []*ExternalTargetFieldApi `json:"Expense,omitempty"` + VendorCredit []*ExternalTargetFieldApi `json:"VendorCredit,omitempty"` + Transaction []*ExternalTargetFieldApi `json:"Transaction,omitempty"` + GeneralLedgerTransaction []*ExternalTargetFieldApi `json:"GeneralLedgerTransaction,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApiResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApiResponse) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type FieldMappingApiInstance struct { + Id *string `json:"id,omitempty"` + IsIntegrationWide *bool `json:"is_integration_wide,omitempty"` + TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty"` + RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstance(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstance) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteField struct { + RemoteKeyName string `json:"remote_key_name"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { + Method *string `json:"method,omitempty"` + UrlPath *string `json:"url_path,omitempty"` + FieldTraversalPath []string `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceResponse struct { + Account []*FieldMappingApiInstance `json:"Account,omitempty"` + AccountingAttachment []*FieldMappingApiInstance `json:"AccountingAttachment,omitempty"` + BalanceSheet []*FieldMappingApiInstance `json:"BalanceSheet,omitempty"` + CashFlowStatement []*FieldMappingApiInstance `json:"CashFlowStatement,omitempty"` + CompanyInfo []*FieldMappingApiInstance `json:"CompanyInfo,omitempty"` + Contact []*FieldMappingApiInstance `json:"Contact,omitempty"` + IncomeStatement []*FieldMappingApiInstance `json:"IncomeStatement,omitempty"` + CreditNote []*FieldMappingApiInstance `json:"CreditNote,omitempty"` + Item []*FieldMappingApiInstance `json:"Item,omitempty"` + PurchaseOrder []*FieldMappingApiInstance `json:"PurchaseOrder,omitempty"` + TrackingCategory []*FieldMappingApiInstance `json:"TrackingCategory,omitempty"` + JournalEntry []*FieldMappingApiInstance `json:"JournalEntry,omitempty"` + TaxRate []*FieldMappingApiInstance `json:"TaxRate,omitempty"` + Invoice []*FieldMappingApiInstance `json:"Invoice,omitempty"` + Payment []*FieldMappingApiInstance `json:"Payment,omitempty"` + Expense []*FieldMappingApiInstance `json:"Expense,omitempty"` + VendorCredit []*FieldMappingApiInstance `json:"VendorCredit,omitempty"` + Transaction []*FieldMappingApiInstance `json:"Transaction,omitempty"` + GeneralLedgerTransaction []*FieldMappingApiInstance `json:"GeneralLedgerTransaction,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceTargetField struct { + Name string `json:"name"` + Description string `json:"description"` + IsOrganizationWide bool `json:"is_organization_wide"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceTargetField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceTargetField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceTargetField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingInstanceResponse struct { + Model *FieldMappingApiInstance `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializer struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializer(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializer) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializerRequest struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializerRequest(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializerRequest) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + // # The IncomeStatement Object // // ### Description @@ -16027,6 +16439,68 @@ func (i *IncomeStatementCurrency) Accept(visitor IncomeStatementCurrencyVisitor) } } +type IndividualCommonModelScopeDeserializer struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializer(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializer) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + +type IndividualCommonModelScopeDeserializerRequest struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializerRequest(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializerRequest) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + // # The Invoice Object // // ### Description @@ -16038,7 +16512,7 @@ func (i *IncomeStatementCurrency) Accept(visitor IncomeStatementCurrencyVisitor) // Fetch from the `LIST Invoices` endpoint and view a company's invoices. type Invoice struct { Id *string `json:"id,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. + // 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. // // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE @@ -19076,7 +19550,7 @@ func (i *InvoicePurchaseOrdersItem) Accept(visitor InvoicePurchaseOrdersItemVisi // ### Usage Example // Fetch from the `LIST Invoices` endpoint and view a company's invoices. type InvoiceRequest struct { - // 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. + // 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. // // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE @@ -20176,7 +20650,7 @@ func (i *InvoiceRequestTrackingCategoriesItem) Accept(visitor InvoiceRequestTrac } } -// 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. +// 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. // // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE @@ -20431,7 +20905,7 @@ func (i *InvoiceTrackingCategoriesItem) Accept(visitor InvoiceTrackingCategories } } -// 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. +// 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. // // - `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE // - `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE @@ -25149,6 +25623,64 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +type ModelPermissionDeserializer struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializer(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializer) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + +type ModelPermissionDeserializerRequest struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializerRequest(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializerRequest) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + // # The MultipartFormField Object // // ### Description @@ -32192,6 +32724,117 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +type RemoteEndpointInfo struct { + Method string `json:"method"` + UrlPath string `json:"url_path"` + FieldTraversalPath []interface{} `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteEndpointInfo(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteEndpointInfo) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +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"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApi(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApi) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type RemoteFieldApiResponse struct { + Account []*RemoteFieldApi `json:"Account,omitempty"` + AccountingAttachment []*RemoteFieldApi `json:"AccountingAttachment,omitempty"` + BalanceSheet []*RemoteFieldApi `json:"BalanceSheet,omitempty"` + CashFlowStatement []*RemoteFieldApi `json:"CashFlowStatement,omitempty"` + CompanyInfo []*RemoteFieldApi `json:"CompanyInfo,omitempty"` + Contact []*RemoteFieldApi `json:"Contact,omitempty"` + IncomeStatement []*RemoteFieldApi `json:"IncomeStatement,omitempty"` + CreditNote []*RemoteFieldApi `json:"CreditNote,omitempty"` + Item []*RemoteFieldApi `json:"Item,omitempty"` + PurchaseOrder []*RemoteFieldApi `json:"PurchaseOrder,omitempty"` + TrackingCategory []*RemoteFieldApi `json:"TrackingCategory,omitempty"` + JournalEntry []*RemoteFieldApi `json:"JournalEntry,omitempty"` + TaxRate []*RemoteFieldApi `json:"TaxRate,omitempty"` + Invoice []*RemoteFieldApi `json:"Invoice,omitempty"` + Payment []*RemoteFieldApi `json:"Payment,omitempty"` + Expense []*RemoteFieldApi `json:"Expense,omitempty"` + VendorCredit []*RemoteFieldApi `json:"VendorCredit,omitempty"` + Transaction []*RemoteFieldApi `json:"Transaction,omitempty"` + GeneralLedgerTransaction []*RemoteFieldApi `json:"GeneralLedgerTransaction,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApiResponse(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApiResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + // # The RemoteKey Object // // ### Description diff --git a/ats/audit_trail.go b/ats/audit_trail.go index 333bced..3881ab0 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_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` + // 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` 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 8a791ab..85ddb8e 100644 --- a/ats/client/client.go +++ b/ats/client/client.go @@ -15,6 +15,7 @@ import ( deleteaccount "github.com/merge-api/merge-go-client/ats/deleteaccount" departments "github.com/merge-api/merge-go-client/ats/departments" eeocs "github.com/merge-api/merge-go-client/ats/eeocs" + fieldmapping "github.com/merge-api/merge-go-client/ats/fieldmapping" forceresync "github.com/merge-api/merge-go-client/ats/forceresync" generatekey "github.com/merge-api/merge-go-client/ats/generatekey" interviews "github.com/merge-api/merge-go-client/ats/interviews" @@ -28,6 +29,7 @@ import ( passthrough "github.com/merge-api/merge-go-client/ats/passthrough" regeneratekey "github.com/merge-api/merge-go-client/ats/regeneratekey" 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" @@ -52,9 +54,11 @@ type Client struct { AuditTrail *audittrail.Client AvailableActions *availableactions.Client Candidates *candidates.Client + Scopes *scopes.Client DeleteAccount *deleteaccount.Client Departments *departments.Client Eeocs *eeocs.Client + FieldMapping *fieldmapping.Client GenerateKey *generatekey.Client Interviews *interviews.Client Issues *issues.Client @@ -94,9 +98,11 @@ func NewClient(opts ...core.ClientOption) *Client { AuditTrail: audittrail.NewClient(opts...), AvailableActions: availableactions.NewClient(opts...), Candidates: candidates.NewClient(opts...), + Scopes: scopes.NewClient(opts...), DeleteAccount: deleteaccount.NewClient(opts...), Departments: departments.NewClient(opts...), Eeocs: eeocs.NewClient(opts...), + FieldMapping: fieldmapping.NewClient(opts...), GenerateKey: generatekey.NewClient(opts...), Interviews: interviews.NewClient(opts...), Issues: issues.NewClient(opts...), diff --git a/ats/field_mapping.go b/ats/field_mapping.go new file mode 100644 index 0000000..81c5c9b --- /dev/null +++ b/ats/field_mapping.go @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +package ats + +type CreateFieldMappingRequest struct { + // The name of the target field you want this remote field to map to. + TargetFieldName string `json:"target_field_name"` + // The description of the target field you want this remote field to map to. + TargetFieldDescription string `json:"target_field_description"` + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod string `json:"remote_method"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath string `json:"remote_url_path"` + // The name of the Common Model that the remote field corresponds to in a given category. + CommonModelName string `json:"common_model_name"` +} + +type PatchedEditFieldMappingRequest struct { + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod *string `json:"remote_method,omitempty"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath *string `json:"remote_url_path,omitempty"` +} + +type RemoteFieldsRetrieveRequest struct { + // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + CommonModels *string `json:"-"` + // If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + IncludeExampleValues *string `json:"-"` +} diff --git a/ats/fieldmapping/client.go b/ats/fieldmapping/client.go new file mode 100644 index 0000000..77587b4 --- /dev/null +++ b/ats/fieldmapping/client.go @@ -0,0 +1,181 @@ +// This file was auto-generated by Fern from our API Definition. + +package fieldmapping + +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 all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) FieldMappingsRetrieve(ctx context.Context) (*ats.FieldMappingApiInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/field-mappings" + + var response *ats.FieldMappingApiInstanceResponse + 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 +} + +// Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsCreate(ctx context.Context, request *ats.CreateFieldMappingRequest) (*ats.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/field-mappings" + + var response *ats.FieldMappingInstanceResponse + 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 +} + +// Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsDestroy(ctx context.Context, fieldMappingId string) (*ats.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/ats/v1/field-mappings/%v", fieldMappingId) + + var response *ats.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsPartialUpdate(ctx context.Context, fieldMappingId string, request *ats.PatchedEditFieldMappingRequest) (*ats.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/ats/v1/field-mappings/%v", fieldMappingId) + + var response *ats.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) RemoteFieldsRetrieve(ctx context.Context, request *ats.RemoteFieldsRetrieveRequest) (*ats.RemoteFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/remote-fields" + + queryParams := make(url.Values) + if request.CommonModels != nil { + queryParams.Add("common_models", fmt.Sprintf("%v", *request.CommonModels)) + } + if request.IncludeExampleValues != nil { + queryParams.Add("include_example_values", fmt.Sprintf("%v", *request.IncludeExampleValues)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *ats.RemoteFieldApiResponse + 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 +} + +// Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +func (c *Client) TargetFieldsRetrieve(ctx context.Context) (*ats.ExternalTargetFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/target-fields" + + var response *ats.ExternalTargetFieldApiResponse + 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/forceresync/client.go b/ats/forceresync/client.go index 3f737c1..22fa6b0 100644 --- a/ats/forceresync/client.go +++ b/ats/forceresync/client.go @@ -27,7 +27,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Launch, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. func (c *Client) SyncStatusResyncCreate(ctx context.Context) ([]*ats.SyncStatus, error) { baseURL := "https://api.merge.dev" if c.baseURL != "" { diff --git a/ats/issues.go b/ats/issues.go index 4a99a31..1f86926 100644 --- a/ats/issues.go +++ b/ats/issues.go @@ -18,7 +18,7 @@ type IssuesListRequest struct { FirstIncidentTimeAfter *time.Time `json:"-"` // If provided, will only return issues whose first incident time was before this datetime. FirstIncidentTimeBefore *time.Time `json:"-"` - // If True, will include muted issues + // If true, will include muted issues IncludeMuted *string `json:"-"` IntegrationName *string `json:"-"` // If provided, will only return issues whose last incident time was after this datetime. diff --git a/ats/link_token.go b/ats/link_token.go index a8719c0..bd32c4c 100644 --- a/ats/link_token.go +++ b/ats/link_token.go @@ -19,4 +19,6 @@ type EndUserDetailsRequest struct { ShouldCreateMagicLinkUrl *bool `json:"should_create_magic_link_url,omitempty"` // An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. CommonModels []*CommonModelScopesBodyRequest `json:"common_models,omitempty"` + // When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` } diff --git a/ats/scopes.go b/ats/scopes.go new file mode 100644 index 0000000..1d672a5 --- /dev/null +++ b/ats/scopes.go @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +package ats + +type LinkedAccountCommonModelScopeDeserializerRequest struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty"` +} diff --git a/ats/scopes/client.go b/ats/scopes/client.go new file mode 100644 index 0000000..916cbc9 --- /dev/null +++ b/ats/scopes/client.go @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +package scopes + +import ( + context "context" + ats "github.com/merge-api/merge-go-client/ats" + core "github.com/merge-api/merge-go-client/core" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +// Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) DefaultScopesRetrieve(ctx context.Context) (*ats.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/default-scopes" + + var response *ats.CommonModelScopeApi + 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 +} + +// Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) LinkedAccountScopesRetrieve(ctx context.Context) (*ats.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/linked-account-scopes" + + var response *ats.CommonModelScopeApi + 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 +} + +// Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes) +func (c *Client) LinkedAccountScopesCreate(ctx context.Context, request *ats.LinkedAccountCommonModelScopeDeserializerRequest) (*ats.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ats/v1/linked-account-scopes" + + var response *ats.CommonModelScopeApi + 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 +} diff --git a/ats/types.go b/ats/types.go index da27170..1d13bd0 100644 --- a/ats/types.go +++ b/ats/types.go @@ -210,12 +210,12 @@ type AccountIntegration struct { // The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. Color *string `json:"color,omitempty"` Slug *string `json:"slug,omitempty"` - // If checked, this integration will not appear in the linking flow, and will appear elsewhere with a Beta tag. - IsInBeta *bool `json:"is_in_beta,omitempty"` // Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} ApiEndpointsToDocumentationUrls map[string]interface{} `json:"api_endpoints_to_documentation_urls,omitempty"` // Setup guide URL for third party webhook creation. Exposed in Merge Docs. WebhookSetupGuideUrl *string `json:"webhook_setup_guide_url,omitempty"` + // Category or categories this integration is in beta status for. + CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty"` _rawJSON json.RawMessage } @@ -825,6 +825,40 @@ func (a *ActivityVisibility) Accept(visitor ActivityVisibilityVisitor) error { } } +type AdvancedMetadata struct { + Id string `json:"id"` + DisplayName *string `json:"display_name,omitempty"` + Description *string `json:"description,omitempty"` + IsRequired *bool `json:"is_required,omitempty"` + IsCustom *bool `json:"is_custom,omitempty"` + FieldChoices []interface{} `json:"field_choices,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AdvancedMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AdvancedMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AdvancedMetadata) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + // # The Application Object // // ### Description @@ -1912,6 +1946,7 @@ type AuditLogEvent struct { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION + // - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -1974,6 +2009,7 @@ func (a *AuditLogEvent) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -2643,6 +2679,36 @@ func (c CategoryEnum) Ptr() *CategoryEnum { return &c } +type CommonModelScopeApi struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { + type unmarshaler CommonModelScopeApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CommonModelScopeApi(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CommonModelScopeApi) 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) +} + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions,omitempty"` @@ -3758,6 +3824,7 @@ func (e *ErrorValidationProblem) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -3791,6 +3858,7 @@ const ( EventTypeEnumDeletedLinkedAccount EventTypeEnum = "DELETED_LINKED_ACCOUNT" EventTypeEnumCreatedDestination EventTypeEnum = "CREATED_DESTINATION" EventTypeEnumDeletedDestination EventTypeEnum = "DELETED_DESTINATION" + EventTypeEnumChangedDestination EventTypeEnum = "CHANGED_DESTINATION" EventTypeEnumChangedScopes EventTypeEnum = "CHANGED_SCOPES" EventTypeEnumChangedPersonalInformation EventTypeEnum = "CHANGED_PERSONAL_INFORMATION" EventTypeEnumChangedOrganizationSettings EventTypeEnum = "CHANGED_ORGANIZATION_SETTINGS" @@ -3836,6 +3904,8 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumCreatedDestination, nil case "DELETED_DESTINATION": return EventTypeEnumDeletedDestination, nil + case "CHANGED_DESTINATION": + return EventTypeEnumChangedDestination, nil case "CHANGED_SCOPES": return EventTypeEnumChangedScopes, nil case "CHANGED_PERSONAL_INFORMATION": @@ -3883,6 +3953,340 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +type ExternalTargetFieldApi struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + IsMapped *string `json:"is_mapped,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApi(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApi) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type ExternalTargetFieldApiResponse struct { + Activity []*ExternalTargetFieldApi `json:"Activity,omitempty"` + Application []*ExternalTargetFieldApi `json:"Application,omitempty"` + Attachment []*ExternalTargetFieldApi `json:"Attachment,omitempty"` + Candidate []*ExternalTargetFieldApi `json:"Candidate,omitempty"` + Department []*ExternalTargetFieldApi `json:"Department,omitempty"` + Eeoc []*ExternalTargetFieldApi `json:"EEOC,omitempty"` + ScheduledInterview []*ExternalTargetFieldApi `json:"ScheduledInterview,omitempty"` + Job []*ExternalTargetFieldApi `json:"Job,omitempty"` + JobInterviewStage []*ExternalTargetFieldApi `json:"JobInterviewStage,omitempty"` + Offer []*ExternalTargetFieldApi `json:"Offer,omitempty"` + Office []*ExternalTargetFieldApi `json:"Office,omitempty"` + RejectReason []*ExternalTargetFieldApi `json:"RejectReason,omitempty"` + Scorecard []*ExternalTargetFieldApi `json:"Scorecard,omitempty"` + Tag []*ExternalTargetFieldApi `json:"Tag,omitempty"` + RemoteUser []*ExternalTargetFieldApi `json:"RemoteUser,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApiResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApiResponse) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type FieldMappingApiInstance struct { + Id *string `json:"id,omitempty"` + IsIntegrationWide *bool `json:"is_integration_wide,omitempty"` + TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty"` + RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstance(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstance) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteField struct { + RemoteKeyName string `json:"remote_key_name"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { + Method *string `json:"method,omitempty"` + UrlPath *string `json:"url_path,omitempty"` + FieldTraversalPath []string `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceResponse struct { + Activity []*FieldMappingApiInstance `json:"Activity,omitempty"` + Application []*FieldMappingApiInstance `json:"Application,omitempty"` + Attachment []*FieldMappingApiInstance `json:"Attachment,omitempty"` + Candidate []*FieldMappingApiInstance `json:"Candidate,omitempty"` + Department []*FieldMappingApiInstance `json:"Department,omitempty"` + Eeoc []*FieldMappingApiInstance `json:"EEOC,omitempty"` + ScheduledInterview []*FieldMappingApiInstance `json:"ScheduledInterview,omitempty"` + Job []*FieldMappingApiInstance `json:"Job,omitempty"` + JobInterviewStage []*FieldMappingApiInstance `json:"JobInterviewStage,omitempty"` + Offer []*FieldMappingApiInstance `json:"Offer,omitempty"` + Office []*FieldMappingApiInstance `json:"Office,omitempty"` + RejectReason []*FieldMappingApiInstance `json:"RejectReason,omitempty"` + Scorecard []*FieldMappingApiInstance `json:"Scorecard,omitempty"` + Tag []*FieldMappingApiInstance `json:"Tag,omitempty"` + RemoteUser []*FieldMappingApiInstance `json:"RemoteUser,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceTargetField struct { + Name string `json:"name"` + Description string `json:"description"` + IsOrganizationWide bool `json:"is_organization_wide"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceTargetField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceTargetField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceTargetField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingInstanceResponse struct { + Model *FieldMappingApiInstance `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializer struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializer(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializer) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializerRequest struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializerRequest(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializerRequest) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + // - `MALE` - MALE // - `FEMALE` - FEMALE // - `NON-BINARY` - NON-BINARY @@ -3919,6 +4323,68 @@ func (g GenderEnum) Ptr() *GenderEnum { return &g } +type IndividualCommonModelScopeDeserializer struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializer(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializer) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + +type IndividualCommonModelScopeDeserializerRequest struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializerRequest(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializerRequest) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + type Issue struct { Id *string `json:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -4870,6 +5336,64 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +type ModelPermissionDeserializer struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializer(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializer) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + +type ModelPermissionDeserializerRequest struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializerRequest(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializerRequest) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + // # The MultipartFormField Object // // ### Description @@ -6543,6 +7067,113 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +type RemoteEndpointInfo struct { + Method string `json:"method"` + UrlPath string `json:"url_path"` + FieldTraversalPath []interface{} `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteEndpointInfo(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteEndpointInfo) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +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"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApi(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApi) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type RemoteFieldApiResponse struct { + Activity []*RemoteFieldApi `json:"Activity,omitempty"` + Application []*RemoteFieldApi `json:"Application,omitempty"` + Attachment []*RemoteFieldApi `json:"Attachment,omitempty"` + Candidate []*RemoteFieldApi `json:"Candidate,omitempty"` + Department []*RemoteFieldApi `json:"Department,omitempty"` + Eeoc []*RemoteFieldApi `json:"EEOC,omitempty"` + ScheduledInterview []*RemoteFieldApi `json:"ScheduledInterview,omitempty"` + Job []*RemoteFieldApi `json:"Job,omitempty"` + JobInterviewStage []*RemoteFieldApi `json:"JobInterviewStage,omitempty"` + Offer []*RemoteFieldApi `json:"Offer,omitempty"` + Office []*RemoteFieldApi `json:"Office,omitempty"` + RejectReason []*RemoteFieldApi `json:"RejectReason,omitempty"` + Scorecard []*RemoteFieldApi `json:"Scorecard,omitempty"` + Tag []*RemoteFieldApi `json:"Tag,omitempty"` + RemoteUser []*RemoteFieldApi `json:"RemoteUser,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApiResponse(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApiResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + // # The RemoteKey Object // // ### Description diff --git a/core/client_option.go b/core/client_option.go index 5eab3c5..540c196 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.5") + headers.Set("X-Fern-SDK-Version", "v1.0.6") return headers } diff --git a/crm/audit_trail.go b/crm/audit_trail.go index 241b305..8129c2e 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_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` + // 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` 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 71cdc02..16780c1 100644 --- a/crm/client/client.go +++ b/crm/client/client.go @@ -18,6 +18,7 @@ import ( deleteaccount "github.com/merge-api/merge-go-client/crm/deleteaccount" engagements "github.com/merge-api/merge-go-client/crm/engagements" engagementtypes "github.com/merge-api/merge-go-client/crm/engagementtypes" + fieldmapping "github.com/merge-api/merge-go-client/crm/fieldmapping" forceresync "github.com/merge-api/merge-go-client/crm/forceresync" generatekey "github.com/merge-api/merge-go-client/crm/generatekey" issues "github.com/merge-api/merge-go-client/crm/issues" @@ -28,6 +29,7 @@ import ( opportunities "github.com/merge-api/merge-go-client/crm/opportunities" 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" @@ -53,9 +55,11 @@ type Client struct { AssociationTypes *associationtypes.Client CustomObjects *customobjects.Client Associations *associations.Client + Scopes *scopes.Client DeleteAccount *deleteaccount.Client EngagementTypes *engagementtypes.Client Engagements *engagements.Client + FieldMapping *fieldmapping.Client GenerateKey *generatekey.Client Issues *issues.Client Leads *leads.Client @@ -94,9 +98,11 @@ func NewClient(opts ...core.ClientOption) *Client { AssociationTypes: associationtypes.NewClient(opts...), CustomObjects: customobjects.NewClient(opts...), Associations: associations.NewClient(opts...), + Scopes: scopes.NewClient(opts...), DeleteAccount: deleteaccount.NewClient(opts...), EngagementTypes: engagementtypes.NewClient(opts...), Engagements: engagements.NewClient(opts...), + FieldMapping: fieldmapping.NewClient(opts...), GenerateKey: generatekey.NewClient(opts...), Issues: issues.NewClient(opts...), Leads: leads.NewClient(opts...), diff --git a/crm/field_mapping.go b/crm/field_mapping.go new file mode 100644 index 0000000..d9a8120 --- /dev/null +++ b/crm/field_mapping.go @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +package crm + +type CreateFieldMappingRequest struct { + // The name of the target field you want this remote field to map to. + TargetFieldName string `json:"target_field_name"` + // The description of the target field you want this remote field to map to. + TargetFieldDescription string `json:"target_field_description"` + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod string `json:"remote_method"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath string `json:"remote_url_path"` + // The name of the Common Model that the remote field corresponds to in a given category. + CommonModelName string `json:"common_model_name"` +} + +type PatchedEditFieldMappingRequest struct { + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod *string `json:"remote_method,omitempty"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath *string `json:"remote_url_path,omitempty"` +} + +type RemoteFieldsRetrieveRequest struct { + // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + CommonModels *string `json:"-"` + // If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + IncludeExampleValues *string `json:"-"` +} diff --git a/crm/fieldmapping/client.go b/crm/fieldmapping/client.go new file mode 100644 index 0000000..6dba1b1 --- /dev/null +++ b/crm/fieldmapping/client.go @@ -0,0 +1,181 @@ +// This file was auto-generated by Fern from our API Definition. + +package fieldmapping + +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 all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) FieldMappingsRetrieve(ctx context.Context) (*crm.FieldMappingApiInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/field-mappings" + + var response *crm.FieldMappingApiInstanceResponse + 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 +} + +// Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsCreate(ctx context.Context, request *crm.CreateFieldMappingRequest) (*crm.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/field-mappings" + + var response *crm.FieldMappingInstanceResponse + 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 +} + +// Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsDestroy(ctx context.Context, fieldMappingId string) (*crm.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/crm/v1/field-mappings/%v", fieldMappingId) + + var response *crm.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsPartialUpdate(ctx context.Context, fieldMappingId string, request *crm.PatchedEditFieldMappingRequest) (*crm.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/crm/v1/field-mappings/%v", fieldMappingId) + + var response *crm.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) RemoteFieldsRetrieve(ctx context.Context, request *crm.RemoteFieldsRetrieveRequest) (*crm.RemoteFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/remote-fields" + + queryParams := make(url.Values) + if request.CommonModels != nil { + queryParams.Add("common_models", fmt.Sprintf("%v", *request.CommonModels)) + } + if request.IncludeExampleValues != nil { + queryParams.Add("include_example_values", fmt.Sprintf("%v", *request.IncludeExampleValues)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *crm.RemoteFieldApiResponse + 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 +} + +// Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +func (c *Client) TargetFieldsRetrieve(ctx context.Context) (*crm.ExternalTargetFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/target-fields" + + var response *crm.ExternalTargetFieldApiResponse + 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/forceresync/client.go b/crm/forceresync/client.go index 3daadc1..c9cd58b 100644 --- a/crm/forceresync/client.go +++ b/crm/forceresync/client.go @@ -27,7 +27,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Launch, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. func (c *Client) SyncStatusResyncCreate(ctx context.Context) ([]*crm.SyncStatus, error) { baseURL := "https://api.merge.dev" if c.baseURL != "" { diff --git a/crm/issues.go b/crm/issues.go index 9c6d737..91cca86 100644 --- a/crm/issues.go +++ b/crm/issues.go @@ -18,7 +18,7 @@ type IssuesListRequest struct { FirstIncidentTimeAfter *time.Time `json:"-"` // If provided, will only return issues whose first incident time was before this datetime. FirstIncidentTimeBefore *time.Time `json:"-"` - // If True, will include muted issues + // If true, will include muted issues IncludeMuted *string `json:"-"` IntegrationName *string `json:"-"` // If provided, will only return issues whose last incident time was after this datetime. diff --git a/crm/link_token.go b/crm/link_token.go index defee19..3d43409 100644 --- a/crm/link_token.go +++ b/crm/link_token.go @@ -19,4 +19,6 @@ type EndUserDetailsRequest struct { ShouldCreateMagicLinkUrl *bool `json:"should_create_magic_link_url,omitempty"` // An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. CommonModels []*CommonModelScopesBodyRequest `json:"common_models,omitempty"` + // When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` } diff --git a/crm/scopes.go b/crm/scopes.go new file mode 100644 index 0000000..79f6cdd --- /dev/null +++ b/crm/scopes.go @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +package crm + +type LinkedAccountCommonModelScopeDeserializerRequest struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty"` +} diff --git a/crm/scopes/client.go b/crm/scopes/client.go new file mode 100644 index 0000000..2a748a2 --- /dev/null +++ b/crm/scopes/client.go @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/core" + crm "github.com/merge-api/merge-go-client/crm" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +// Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) DefaultScopesRetrieve(ctx context.Context) (*crm.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/default-scopes" + + var response *crm.CommonModelScopeApi + 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 +} + +// Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) LinkedAccountScopesRetrieve(ctx context.Context) (*crm.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/linked-account-scopes" + + var response *crm.CommonModelScopeApi + 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 +} + +// Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes) +func (c *Client) LinkedAccountScopesCreate(ctx context.Context, request *crm.LinkedAccountCommonModelScopeDeserializerRequest) (*crm.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/crm/v1/linked-account-scopes" + + var response *crm.CommonModelScopeApi + 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 +} diff --git a/crm/types.go b/crm/types.go index 08df223..ee27bba 100644 --- a/crm/types.go +++ b/crm/types.go @@ -241,12 +241,12 @@ type AccountIntegration struct { // The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. Color *string `json:"color,omitempty"` Slug *string `json:"slug,omitempty"` - // If checked, this integration will not appear in the linking flow, and will appear elsewhere with a Beta tag. - IsInBeta *bool `json:"is_in_beta,omitempty"` // Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} ApiEndpointsToDocumentationUrls map[string]interface{} `json:"api_endpoints_to_documentation_urls,omitempty"` // Setup guide URL for third party webhook creation. Exposed in Merge Docs. WebhookSetupGuideUrl *string `json:"webhook_setup_guide_url,omitempty"` + // Category or categories this integration is in beta status for. + CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty"` _rawJSON json.RawMessage } @@ -1877,6 +1877,40 @@ func (a AddressTypeEnum) Ptr() *AddressTypeEnum { return &a } +type AdvancedMetadata struct { + Id string `json:"id"` + DisplayName *string `json:"display_name,omitempty"` + Description *string `json:"description,omitempty"` + IsRequired *bool `json:"is_required,omitempty"` + IsCustom *bool `json:"is_custom,omitempty"` + FieldChoices []interface{} `json:"field_choices,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AdvancedMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AdvancedMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AdvancedMetadata) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + // # The Association Object // // ### Description @@ -2208,6 +2242,7 @@ type AuditLogEvent struct { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION + // - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -2270,6 +2305,7 @@ func (a *AuditLogEvent) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -2571,6 +2607,36 @@ func (c CategoryEnum) Ptr() *CategoryEnum { return &c } +type CommonModelScopeApi struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { + type unmarshaler CommonModelScopeApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CommonModelScopeApi(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CommonModelScopeApi) 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) +} + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions,omitempty"` @@ -5545,6 +5611,7 @@ func (e *ErrorValidationProblem) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -5578,6 +5645,7 @@ const ( EventTypeEnumDeletedLinkedAccount EventTypeEnum = "DELETED_LINKED_ACCOUNT" EventTypeEnumCreatedDestination EventTypeEnum = "CREATED_DESTINATION" EventTypeEnumDeletedDestination EventTypeEnum = "DELETED_DESTINATION" + EventTypeEnumChangedDestination EventTypeEnum = "CHANGED_DESTINATION" EventTypeEnumChangedScopes EventTypeEnum = "CHANGED_SCOPES" EventTypeEnumChangedPersonalInformation EventTypeEnum = "CHANGED_PERSONAL_INFORMATION" EventTypeEnumChangedOrganizationSettings EventTypeEnum = "CHANGED_ORGANIZATION_SETTINGS" @@ -5623,6 +5691,8 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumCreatedDestination, nil case "DELETED_DESTINATION": return EventTypeEnumDeletedDestination, nil + case "CHANGED_DESTINATION": + return EventTypeEnumChangedDestination, nil case "CHANGED_SCOPES": return EventTypeEnumChangedScopes, nil case "CHANGED_PERSONAL_INFORMATION": @@ -5670,6 +5740,74 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +type ExternalTargetFieldApi struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + IsMapped *string `json:"is_mapped,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApi(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApi) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type ExternalTargetFieldApiResponse struct { + Account []*ExternalTargetFieldApi `json:"Account,omitempty"` + Contact []*ExternalTargetFieldApi `json:"Contact,omitempty"` + Lead []*ExternalTargetFieldApi `json:"Lead,omitempty"` + Note []*ExternalTargetFieldApi `json:"Note,omitempty"` + Opportunity []*ExternalTargetFieldApi `json:"Opportunity,omitempty"` + Stage []*ExternalTargetFieldApi `json:"Stage,omitempty"` + User []*ExternalTargetFieldApi `json:"User,omitempty"` + Task []*ExternalTargetFieldApi `json:"Task,omitempty"` + Engagement []*ExternalTargetFieldApi `json:"Engagement,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApiResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApiResponse) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + // - `string` - string // - `number` - number // - `date` - date @@ -5710,6 +5848,260 @@ func (f FieldFormatEnum) Ptr() *FieldFormatEnum { return &f } +type FieldMappingApiInstance struct { + Id *string `json:"id,omitempty"` + IsIntegrationWide *bool `json:"is_integration_wide,omitempty"` + TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty"` + RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstance(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstance) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteField struct { + RemoteKeyName string `json:"remote_key_name"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { + Method *string `json:"method,omitempty"` + UrlPath *string `json:"url_path,omitempty"` + FieldTraversalPath []string `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceResponse struct { + Account []*FieldMappingApiInstance `json:"Account,omitempty"` + Contact []*FieldMappingApiInstance `json:"Contact,omitempty"` + Lead []*FieldMappingApiInstance `json:"Lead,omitempty"` + Note []*FieldMappingApiInstance `json:"Note,omitempty"` + Opportunity []*FieldMappingApiInstance `json:"Opportunity,omitempty"` + Stage []*FieldMappingApiInstance `json:"Stage,omitempty"` + User []*FieldMappingApiInstance `json:"User,omitempty"` + Task []*FieldMappingApiInstance `json:"Task,omitempty"` + Engagement []*FieldMappingApiInstance `json:"Engagement,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceTargetField struct { + Name string `json:"name"` + Description string `json:"description"` + IsOrganizationWide bool `json:"is_organization_wide"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceTargetField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceTargetField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceTargetField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingInstanceResponse struct { + Model *FieldMappingApiInstance `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializer struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializer(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializer) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializerRequest struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializerRequest(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializerRequest) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + // - `string` - string // - `number` - number // - `date` - date @@ -5780,6 +6172,68 @@ func (i *IgnoreCommonModelRequest) String() string { return fmt.Sprintf("%#v", i) } +type IndividualCommonModelScopeDeserializer struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializer(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializer) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + +type IndividualCommonModelScopeDeserializerRequest struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializerRequest(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializerRequest) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + type Issue struct { Id *string `json:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -6840,6 +7294,64 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +type ModelPermissionDeserializer struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializer(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializer) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + +type ModelPermissionDeserializerRequest struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializerRequest(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializerRequest) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + // # The MultipartFormField Object // // ### Description @@ -9610,9 +10122,40 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +type RemoteEndpointInfo struct { + Method string `json:"method"` + UrlPath string `json:"url_path"` + FieldTraversalPath []interface{} `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteEndpointInfo(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteEndpointInfo) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + type RemoteField struct { RemoteFieldClass *RemoteFieldRemoteFieldClass `json:"remote_field_class,omitempty"` - Value interface{} `json:"value,omitempty"` + Value map[string]interface{} `json:"value,omitempty"` _rawJSON json.RawMessage } @@ -9640,6 +10183,76 @@ func (r *RemoteField) String() string { return fmt.Sprintf("%#v", r) } +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"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApi(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApi) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type RemoteFieldApiResponse struct { + Account []*RemoteFieldApi `json:"Account,omitempty"` + Contact []*RemoteFieldApi `json:"Contact,omitempty"` + Lead []*RemoteFieldApi `json:"Lead,omitempty"` + Note []*RemoteFieldApi `json:"Note,omitempty"` + Opportunity []*RemoteFieldApi `json:"Opportunity,omitempty"` + Stage []*RemoteFieldApi `json:"Stage,omitempty"` + User []*RemoteFieldApi `json:"User,omitempty"` + Task []*RemoteFieldApi `json:"Task,omitempty"` + Engagement []*RemoteFieldApi `json:"Engagement,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApiResponse(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApiResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + type RemoteFieldClass struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` diff --git a/filestorage/audit_trail.go b/filestorage/audit_trail.go index 7f56647..24e726c 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_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` + // 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` 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 bf0acde..19b389e 100644 --- a/filestorage/client/client.go +++ b/filestorage/client/client.go @@ -11,6 +11,7 @@ import ( availableactions "github.com/merge-api/merge-go-client/filestorage/availableactions" deleteaccount "github.com/merge-api/merge-go-client/filestorage/deleteaccount" drives "github.com/merge-api/merge-go-client/filestorage/drives" + fieldmapping "github.com/merge-api/merge-go-client/filestorage/fieldmapping" files "github.com/merge-api/merge-go-client/filestorage/files" folders "github.com/merge-api/merge-go-client/filestorage/folders" forceresync "github.com/merge-api/merge-go-client/filestorage/forceresync" @@ -21,6 +22,7 @@ import ( linktoken "github.com/merge-api/merge-go-client/filestorage/linktoken" 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" @@ -38,8 +40,10 @@ type Client struct { AsyncPassthrough *asyncpassthrough.Client AuditTrail *audittrail.Client AvailableActions *availableactions.Client + Scopes *scopes.Client DeleteAccount *deleteaccount.Client Drives *drives.Client + FieldMapping *fieldmapping.Client Files *files.Client Folders *folders.Client GenerateKey *generatekey.Client @@ -70,8 +74,10 @@ func NewClient(opts ...core.ClientOption) *Client { AsyncPassthrough: asyncpassthrough.NewClient(opts...), AuditTrail: audittrail.NewClient(opts...), AvailableActions: availableactions.NewClient(opts...), + Scopes: scopes.NewClient(opts...), DeleteAccount: deleteaccount.NewClient(opts...), Drives: drives.NewClient(opts...), + FieldMapping: fieldmapping.NewClient(opts...), Files: files.NewClient(opts...), Folders: folders.NewClient(opts...), GenerateKey: generatekey.NewClient(opts...), diff --git a/filestorage/field_mapping.go b/filestorage/field_mapping.go new file mode 100644 index 0000000..a3e101b --- /dev/null +++ b/filestorage/field_mapping.go @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +package filestorage + +type CreateFieldMappingRequest struct { + // The name of the target field you want this remote field to map to. + TargetFieldName string `json:"target_field_name"` + // The description of the target field you want this remote field to map to. + TargetFieldDescription string `json:"target_field_description"` + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod string `json:"remote_method"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath string `json:"remote_url_path"` + // The name of the Common Model that the remote field corresponds to in a given category. + CommonModelName string `json:"common_model_name"` +} + +type PatchedEditFieldMappingRequest struct { + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod *string `json:"remote_method,omitempty"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath *string `json:"remote_url_path,omitempty"` +} + +type RemoteFieldsRetrieveRequest struct { + // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + CommonModels *string `json:"-"` + // If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + IncludeExampleValues *string `json:"-"` +} diff --git a/filestorage/fieldmapping/client.go b/filestorage/fieldmapping/client.go new file mode 100644 index 0000000..8f570a3 --- /dev/null +++ b/filestorage/fieldmapping/client.go @@ -0,0 +1,181 @@ +// This file was auto-generated by Fern from our API Definition. + +package fieldmapping + +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 all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) FieldMappingsRetrieve(ctx context.Context) (*filestorage.FieldMappingApiInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/field-mappings" + + var response *filestorage.FieldMappingApiInstanceResponse + 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 +} + +// Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsCreate(ctx context.Context, request *filestorage.CreateFieldMappingRequest) (*filestorage.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/field-mappings" + + var response *filestorage.FieldMappingInstanceResponse + 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 +} + +// Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsDestroy(ctx context.Context, fieldMappingId string) (*filestorage.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/filestorage/v1/field-mappings/%v", fieldMappingId) + + var response *filestorage.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsPartialUpdate(ctx context.Context, fieldMappingId string, request *filestorage.PatchedEditFieldMappingRequest) (*filestorage.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/filestorage/v1/field-mappings/%v", fieldMappingId) + + var response *filestorage.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) RemoteFieldsRetrieve(ctx context.Context, request *filestorage.RemoteFieldsRetrieveRequest) (*filestorage.RemoteFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/remote-fields" + + queryParams := make(url.Values) + if request.CommonModels != nil { + queryParams.Add("common_models", fmt.Sprintf("%v", *request.CommonModels)) + } + if request.IncludeExampleValues != nil { + queryParams.Add("include_example_values", fmt.Sprintf("%v", *request.IncludeExampleValues)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *filestorage.RemoteFieldApiResponse + 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 +} + +// Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +func (c *Client) TargetFieldsRetrieve(ctx context.Context) (*filestorage.ExternalTargetFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/target-fields" + + var response *filestorage.ExternalTargetFieldApiResponse + 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/forceresync/client.go b/filestorage/forceresync/client.go index 7a4d813..26dfe5c 100644 --- a/filestorage/forceresync/client.go +++ b/filestorage/forceresync/client.go @@ -27,7 +27,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Launch, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. func (c *Client) SyncStatusResyncCreate(ctx context.Context) ([]*filestorage.SyncStatus, error) { baseURL := "https://api.merge.dev" if c.baseURL != "" { diff --git a/filestorage/issues.go b/filestorage/issues.go index 86d4677..31e6cdb 100644 --- a/filestorage/issues.go +++ b/filestorage/issues.go @@ -18,7 +18,7 @@ type IssuesListRequest struct { FirstIncidentTimeAfter *time.Time `json:"-"` // If provided, will only return issues whose first incident time was before this datetime. FirstIncidentTimeBefore *time.Time `json:"-"` - // If True, will include muted issues + // If true, will include muted issues IncludeMuted *string `json:"-"` IntegrationName *string `json:"-"` // If provided, will only return issues whose last incident time was after this datetime. diff --git a/filestorage/link_token.go b/filestorage/link_token.go index 37ea9ce..bdce27e 100644 --- a/filestorage/link_token.go +++ b/filestorage/link_token.go @@ -19,4 +19,6 @@ type EndUserDetailsRequest struct { ShouldCreateMagicLinkUrl *bool `json:"should_create_magic_link_url,omitempty"` // An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. CommonModels []*CommonModelScopesBodyRequest `json:"common_models,omitempty"` + // When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` } diff --git a/filestorage/scopes.go b/filestorage/scopes.go new file mode 100644 index 0000000..120cb91 --- /dev/null +++ b/filestorage/scopes.go @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +package filestorage + +type LinkedAccountCommonModelScopeDeserializerRequest struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty"` +} diff --git a/filestorage/scopes/client.go b/filestorage/scopes/client.go new file mode 100644 index 0000000..2eff4fb --- /dev/null +++ b/filestorage/scopes/client.go @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/core" + filestorage "github.com/merge-api/merge-go-client/filestorage" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +// Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) DefaultScopesRetrieve(ctx context.Context) (*filestorage.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/default-scopes" + + var response *filestorage.CommonModelScopeApi + 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 +} + +// Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) LinkedAccountScopesRetrieve(ctx context.Context) (*filestorage.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/linked-account-scopes" + + var response *filestorage.CommonModelScopeApi + 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 +} + +// Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes) +func (c *Client) LinkedAccountScopesCreate(ctx context.Context, request *filestorage.LinkedAccountCommonModelScopeDeserializerRequest) (*filestorage.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/filestorage/v1/linked-account-scopes" + + var response *filestorage.CommonModelScopeApi + 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 +} diff --git a/filestorage/types.go b/filestorage/types.go index 7ccf71d..b89812a 100644 --- a/filestorage/types.go +++ b/filestorage/types.go @@ -174,12 +174,12 @@ type AccountIntegration struct { // The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. Color *string `json:"color,omitempty"` Slug *string `json:"slug,omitempty"` - // If checked, this integration will not appear in the linking flow, and will appear elsewhere with a Beta tag. - IsInBeta *bool `json:"is_in_beta,omitempty"` // Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} ApiEndpointsToDocumentationUrls map[string]interface{} `json:"api_endpoints_to_documentation_urls,omitempty"` // Setup guide URL for third party webhook creation. Exposed in Merge Docs. WebhookSetupGuideUrl *string `json:"webhook_setup_guide_url,omitempty"` + // Category or categories this integration is in beta status for. + CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty"` _rawJSON json.RawMessage } @@ -237,6 +237,40 @@ func (a *AccountToken) String() string { return fmt.Sprintf("%#v", a) } +type AdvancedMetadata struct { + Id string `json:"id"` + DisplayName *string `json:"display_name,omitempty"` + Description *string `json:"description,omitempty"` + IsRequired *bool `json:"is_required,omitempty"` + IsCustom *bool `json:"is_custom,omitempty"` + FieldChoices []interface{} `json:"field_choices,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AdvancedMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AdvancedMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AdvancedMetadata) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id"` @@ -295,6 +329,7 @@ type AuditLogEvent struct { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION + // - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -357,6 +392,7 @@ func (a *AuditLogEvent) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -626,6 +662,36 @@ func (c CategoryEnum) Ptr() *CategoryEnum { return &c } +type CommonModelScopeApi struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { + type unmarshaler CommonModelScopeApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CommonModelScopeApi(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CommonModelScopeApi) 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) +} + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions,omitempty"` @@ -1075,6 +1141,7 @@ func (e *ErrorValidationProblem) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -1108,6 +1175,7 @@ const ( EventTypeEnumDeletedLinkedAccount EventTypeEnum = "DELETED_LINKED_ACCOUNT" EventTypeEnumCreatedDestination EventTypeEnum = "CREATED_DESTINATION" EventTypeEnumDeletedDestination EventTypeEnum = "DELETED_DESTINATION" + EventTypeEnumChangedDestination EventTypeEnum = "CHANGED_DESTINATION" EventTypeEnumChangedScopes EventTypeEnum = "CHANGED_SCOPES" EventTypeEnumChangedPersonalInformation EventTypeEnum = "CHANGED_PERSONAL_INFORMATION" EventTypeEnumChangedOrganizationSettings EventTypeEnum = "CHANGED_ORGANIZATION_SETTINGS" @@ -1153,6 +1221,8 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumCreatedDestination, nil case "DELETED_DESTINATION": return EventTypeEnumDeletedDestination, nil + case "CHANGED_DESTINATION": + return EventTypeEnumChangedDestination, nil case "CHANGED_SCOPES": return EventTypeEnumChangedScopes, nil case "CHANGED_PERSONAL_INFORMATION": @@ -1200,6 +1270,320 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +type ExternalTargetFieldApi struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + IsMapped *string `json:"is_mapped,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApi(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApi) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type ExternalTargetFieldApiResponse struct { + File []*ExternalTargetFieldApi `json:"File,omitempty"` + Folder []*ExternalTargetFieldApi `json:"Folder,omitempty"` + Drive []*ExternalTargetFieldApi `json:"Drive,omitempty"` + Group []*ExternalTargetFieldApi `json:"Group,omitempty"` + User []*ExternalTargetFieldApi `json:"User,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApiResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApiResponse) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type FieldMappingApiInstance struct { + Id *string `json:"id,omitempty"` + IsIntegrationWide *bool `json:"is_integration_wide,omitempty"` + TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty"` + RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstance(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstance) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteField struct { + RemoteKeyName string `json:"remote_key_name"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { + Method *string `json:"method,omitempty"` + UrlPath *string `json:"url_path,omitempty"` + FieldTraversalPath []string `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceResponse struct { + File []*FieldMappingApiInstance `json:"File,omitempty"` + Folder []*FieldMappingApiInstance `json:"Folder,omitempty"` + Drive []*FieldMappingApiInstance `json:"Drive,omitempty"` + Group []*FieldMappingApiInstance `json:"Group,omitempty"` + User []*FieldMappingApiInstance `json:"User,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceTargetField struct { + Name string `json:"name"` + Description string `json:"description"` + IsOrganizationWide bool `json:"is_organization_wide"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceTargetField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceTargetField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceTargetField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingInstanceResponse struct { + Model *FieldMappingApiInstance `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializer struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializer(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializer) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializerRequest struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializerRequest(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializerRequest) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + // # The File Object // // ### Description @@ -1389,7 +1773,7 @@ func (f *FileFolder) Accept(visitor FileFolderVisitor) error { type FilePermissions struct { typeName string String string - Unknown interface{} + PermissionRequest *PermissionRequest FilePermissionsItemList []*FilePermissionsItem } @@ -1397,8 +1781,8 @@ func NewFilePermissionsFromString(value string) *FilePermissions { return &FilePermissions{typeName: "string", String: value} } -func NewFilePermissionsFromUnknown(value interface{}) *FilePermissions { - return &FilePermissions{typeName: "unknown", Unknown: value} +func NewFilePermissionsFromPermissionRequest(value *PermissionRequest) *FilePermissions { + return &FilePermissions{typeName: "permissionRequest", PermissionRequest: value} } func NewFilePermissionsFromFilePermissionsItemList(value []*FilePermissionsItem) *FilePermissions { @@ -1412,10 +1796,10 @@ func (f *FilePermissions) UnmarshalJSON(data []byte) error { f.String = valueString return nil } - var valueUnknown interface{} - if err := json.Unmarshal(data, &valueUnknown); err == nil { - f.typeName = "unknown" - f.Unknown = valueUnknown + valuePermissionRequest := new(PermissionRequest) + if err := json.Unmarshal(data, &valuePermissionRequest); err == nil { + f.typeName = "permissionRequest" + f.PermissionRequest = valuePermissionRequest return nil } var valueFilePermissionsItemList []*FilePermissionsItem @@ -1433,8 +1817,8 @@ func (f FilePermissions) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return json.Marshal(f.String) - case "unknown": - return json.Marshal(f.Unknown) + case "permissionRequest": + return json.Marshal(f.PermissionRequest) case "filePermissionsItemList": return json.Marshal(f.FilePermissionsItemList) } @@ -1442,7 +1826,7 @@ func (f FilePermissions) MarshalJSON() ([]byte, error) { type FilePermissionsVisitor interface { VisitString(string) error - VisitUnknown(interface{}) error + VisitPermissionRequest(*PermissionRequest) error VisitFilePermissionsItemList([]*FilePermissionsItem) error } @@ -1452,8 +1836,8 @@ func (f *FilePermissions) Accept(visitor FilePermissionsVisitor) error { return fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return visitor.VisitString(f.String) - case "unknown": - return visitor.VisitUnknown(f.Unknown) + case "permissionRequest": + return visitor.VisitPermissionRequest(f.PermissionRequest) case "filePermissionsItemList": return visitor.VisitFilePermissionsItemList(f.FilePermissionsItemList) } @@ -1693,7 +2077,7 @@ func (f *FileRequestFolder) Accept(visitor FileRequestFolderVisitor) error { type FileRequestPermissions struct { typeName string String string - Unknown interface{} + PermissionRequest *PermissionRequest FileRequestPermissionsItemList []*FileRequestPermissionsItem } @@ -1701,8 +2085,8 @@ func NewFileRequestPermissionsFromString(value string) *FileRequestPermissions { return &FileRequestPermissions{typeName: "string", String: value} } -func NewFileRequestPermissionsFromUnknown(value interface{}) *FileRequestPermissions { - return &FileRequestPermissions{typeName: "unknown", Unknown: value} +func NewFileRequestPermissionsFromPermissionRequest(value *PermissionRequest) *FileRequestPermissions { + return &FileRequestPermissions{typeName: "permissionRequest", PermissionRequest: value} } func NewFileRequestPermissionsFromFileRequestPermissionsItemList(value []*FileRequestPermissionsItem) *FileRequestPermissions { @@ -1716,10 +2100,10 @@ func (f *FileRequestPermissions) UnmarshalJSON(data []byte) error { f.String = valueString return nil } - var valueUnknown interface{} - if err := json.Unmarshal(data, &valueUnknown); err == nil { - f.typeName = "unknown" - f.Unknown = valueUnknown + valuePermissionRequest := new(PermissionRequest) + if err := json.Unmarshal(data, &valuePermissionRequest); err == nil { + f.typeName = "permissionRequest" + f.PermissionRequest = valuePermissionRequest return nil } var valueFileRequestPermissionsItemList []*FileRequestPermissionsItem @@ -1737,8 +2121,8 @@ func (f FileRequestPermissions) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return json.Marshal(f.String) - case "unknown": - return json.Marshal(f.Unknown) + case "permissionRequest": + return json.Marshal(f.PermissionRequest) case "fileRequestPermissionsItemList": return json.Marshal(f.FileRequestPermissionsItemList) } @@ -1746,7 +2130,7 @@ func (f FileRequestPermissions) MarshalJSON() ([]byte, error) { type FileRequestPermissionsVisitor interface { VisitString(string) error - VisitUnknown(interface{}) error + VisitPermissionRequest(*PermissionRequest) error VisitFileRequestPermissionsItemList([]*FileRequestPermissionsItem) error } @@ -1756,8 +2140,8 @@ func (f *FileRequestPermissions) Accept(visitor FileRequestPermissionsVisitor) e return fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return visitor.VisitString(f.String) - case "unknown": - return visitor.VisitUnknown(f.Unknown) + case "permissionRequest": + return visitor.VisitPermissionRequest(f.PermissionRequest) case "fileRequestPermissionsItemList": return visitor.VisitFileRequestPermissionsItemList(f.FileRequestPermissionsItemList) } @@ -2069,7 +2453,7 @@ func (f *FolderParentFolder) Accept(visitor FolderParentFolderVisitor) error { type FolderPermissions struct { typeName string String string - Unknown interface{} + PermissionRequest *PermissionRequest FolderPermissionsItemList []*FolderPermissionsItem } @@ -2077,8 +2461,8 @@ func NewFolderPermissionsFromString(value string) *FolderPermissions { return &FolderPermissions{typeName: "string", String: value} } -func NewFolderPermissionsFromUnknown(value interface{}) *FolderPermissions { - return &FolderPermissions{typeName: "unknown", Unknown: value} +func NewFolderPermissionsFromPermissionRequest(value *PermissionRequest) *FolderPermissions { + return &FolderPermissions{typeName: "permissionRequest", PermissionRequest: value} } func NewFolderPermissionsFromFolderPermissionsItemList(value []*FolderPermissionsItem) *FolderPermissions { @@ -2092,10 +2476,10 @@ func (f *FolderPermissions) UnmarshalJSON(data []byte) error { f.String = valueString return nil } - var valueUnknown interface{} - if err := json.Unmarshal(data, &valueUnknown); err == nil { - f.typeName = "unknown" - f.Unknown = valueUnknown + valuePermissionRequest := new(PermissionRequest) + if err := json.Unmarshal(data, &valuePermissionRequest); err == nil { + f.typeName = "permissionRequest" + f.PermissionRequest = valuePermissionRequest return nil } var valueFolderPermissionsItemList []*FolderPermissionsItem @@ -2113,8 +2497,8 @@ func (f FolderPermissions) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return json.Marshal(f.String) - case "unknown": - return json.Marshal(f.Unknown) + case "permissionRequest": + return json.Marshal(f.PermissionRequest) case "folderPermissionsItemList": return json.Marshal(f.FolderPermissionsItemList) } @@ -2122,7 +2506,7 @@ func (f FolderPermissions) MarshalJSON() ([]byte, error) { type FolderPermissionsVisitor interface { VisitString(string) error - VisitUnknown(interface{}) error + VisitPermissionRequest(*PermissionRequest) error VisitFolderPermissionsItemList([]*FolderPermissionsItem) error } @@ -2132,8 +2516,8 @@ func (f *FolderPermissions) Accept(visitor FolderPermissionsVisitor) error { return fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return visitor.VisitString(f.String) - case "unknown": - return visitor.VisitUnknown(f.Unknown) + case "permissionRequest": + return visitor.VisitPermissionRequest(f.PermissionRequest) case "folderPermissionsItemList": return visitor.VisitFolderPermissionsItemList(f.FolderPermissionsItemList) } @@ -2369,7 +2753,7 @@ func (f *FolderRequestParentFolder) Accept(visitor FolderRequestParentFolderVisi type FolderRequestPermissions struct { typeName string String string - Unknown interface{} + PermissionRequest *PermissionRequest FolderRequestPermissionsItemList []*FolderRequestPermissionsItem } @@ -2377,8 +2761,8 @@ func NewFolderRequestPermissionsFromString(value string) *FolderRequestPermissio return &FolderRequestPermissions{typeName: "string", String: value} } -func NewFolderRequestPermissionsFromUnknown(value interface{}) *FolderRequestPermissions { - return &FolderRequestPermissions{typeName: "unknown", Unknown: value} +func NewFolderRequestPermissionsFromPermissionRequest(value *PermissionRequest) *FolderRequestPermissions { + return &FolderRequestPermissions{typeName: "permissionRequest", PermissionRequest: value} } func NewFolderRequestPermissionsFromFolderRequestPermissionsItemList(value []*FolderRequestPermissionsItem) *FolderRequestPermissions { @@ -2392,10 +2776,10 @@ func (f *FolderRequestPermissions) UnmarshalJSON(data []byte) error { f.String = valueString return nil } - var valueUnknown interface{} - if err := json.Unmarshal(data, &valueUnknown); err == nil { - f.typeName = "unknown" - f.Unknown = valueUnknown + valuePermissionRequest := new(PermissionRequest) + if err := json.Unmarshal(data, &valuePermissionRequest); err == nil { + f.typeName = "permissionRequest" + f.PermissionRequest = valuePermissionRequest return nil } var valueFolderRequestPermissionsItemList []*FolderRequestPermissionsItem @@ -2413,8 +2797,8 @@ func (f FolderRequestPermissions) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return json.Marshal(f.String) - case "unknown": - return json.Marshal(f.Unknown) + case "permissionRequest": + return json.Marshal(f.PermissionRequest) case "folderRequestPermissionsItemList": return json.Marshal(f.FolderRequestPermissionsItemList) } @@ -2422,7 +2806,7 @@ func (f FolderRequestPermissions) MarshalJSON() ([]byte, error) { type FolderRequestPermissionsVisitor interface { VisitString(string) error - VisitUnknown(interface{}) error + VisitPermissionRequest(*PermissionRequest) error VisitFolderRequestPermissionsItemList([]*FolderRequestPermissionsItem) error } @@ -2432,8 +2816,8 @@ func (f *FolderRequestPermissions) Accept(visitor FolderRequestPermissionsVisito return fmt.Errorf("invalid type %s in %T", f.typeName, f) case "string": return visitor.VisitString(f.String) - case "unknown": - return visitor.VisitUnknown(f.Unknown) + case "permissionRequest": + return visitor.VisitPermissionRequest(f.PermissionRequest) case "folderRequestPermissionsItemList": return visitor.VisitFolderRequestPermissionsItemList(f.FolderRequestPermissionsItemList) } @@ -2547,6 +2931,68 @@ func (g *Group) String() string { return fmt.Sprintf("%#v", g) } +type IndividualCommonModelScopeDeserializer struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializer(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializer) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + +type IndividualCommonModelScopeDeserializerRequest struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializerRequest(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializerRequest) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + type Issue struct { Id *string `json:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -2983,6 +3429,64 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +type ModelPermissionDeserializer struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializer(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializer) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + +type ModelPermissionDeserializerRequest struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializerRequest(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializerRequest) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + // # The MultipartFormField Object // // ### Description @@ -4030,6 +4534,103 @@ func (p *PermissionUser) Accept(visitor PermissionUserVisitor) error { } } +type RemoteEndpointInfo struct { + Method string `json:"method"` + UrlPath string `json:"url_path"` + FieldTraversalPath []interface{} `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteEndpointInfo(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteEndpointInfo) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +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"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApi(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApi) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type RemoteFieldApiResponse struct { + File []*RemoteFieldApi `json:"File,omitempty"` + Folder []*RemoteFieldApi `json:"Folder,omitempty"` + Drive []*RemoteFieldApi `json:"Drive,omitempty"` + Group []*RemoteFieldApi `json:"Group,omitempty"` + User []*RemoteFieldApi `json:"User,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApiResponse(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApiResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + // # The RemoteKey Object // // ### Description diff --git a/hris/audit_trail.go b/hris/audit_trail.go index c0f7572..01d9cf8 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_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` + // 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` 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 b3cb460..8d0e51d 100644 --- a/hris/client/client.go +++ b/hris/client/client.go @@ -18,6 +18,7 @@ import ( employees "github.com/merge-api/merge-go-client/hris/employees" employerbenefits "github.com/merge-api/merge-go-client/hris/employerbenefits" employments "github.com/merge-api/merge-go-client/hris/employments" + fieldmapping "github.com/merge-api/merge-go-client/hris/fieldmapping" forceresync "github.com/merge-api/merge-go-client/hris/forceresync" generatekey "github.com/merge-api/merge-go-client/hris/generatekey" groups "github.com/merge-api/merge-go-client/hris/groups" @@ -29,6 +30,7 @@ import ( paygroups "github.com/merge-api/merge-go-client/hris/paygroups" 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" @@ -52,12 +54,14 @@ type Client struct { BankInfo *bankinfo.Client Benefits *benefits.Client Companies *companies.Client + Scopes *scopes.Client DeleteAccount *deleteaccount.Client Dependents *dependents.Client EmployeePayrollRuns *employeepayrollruns.Client Employees *employees.Client EmployerBenefits *employerbenefits.Client Employments *employments.Client + FieldMapping *fieldmapping.Client GenerateKey *generatekey.Client Groups *groups.Client Issues *issues.Client @@ -95,12 +99,14 @@ func NewClient(opts ...core.ClientOption) *Client { BankInfo: bankinfo.NewClient(opts...), Benefits: benefits.NewClient(opts...), Companies: companies.NewClient(opts...), + Scopes: scopes.NewClient(opts...), DeleteAccount: deleteaccount.NewClient(opts...), Dependents: dependents.NewClient(opts...), EmployeePayrollRuns: employeepayrollruns.NewClient(opts...), Employees: employees.NewClient(opts...), EmployerBenefits: employerbenefits.NewClient(opts...), Employments: employments.NewClient(opts...), + FieldMapping: fieldmapping.NewClient(opts...), GenerateKey: generatekey.NewClient(opts...), Groups: groups.NewClient(opts...), Issues: issues.NewClient(opts...), diff --git a/hris/field_mapping.go b/hris/field_mapping.go new file mode 100644 index 0000000..438589d --- /dev/null +++ b/hris/field_mapping.go @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +package hris + +type CreateFieldMappingRequest struct { + // The name of the target field you want this remote field to map to. + TargetFieldName string `json:"target_field_name"` + // The description of the target field you want this remote field to map to. + TargetFieldDescription string `json:"target_field_description"` + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod string `json:"remote_method"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath string `json:"remote_url_path"` + // The name of the Common Model that the remote field corresponds to in a given category. + CommonModelName string `json:"common_model_name"` +} + +type PatchedEditFieldMappingRequest struct { + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod *string `json:"remote_method,omitempty"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath *string `json:"remote_url_path,omitempty"` +} + +type RemoteFieldsRetrieveRequest struct { + // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + CommonModels *string `json:"-"` + // If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + IncludeExampleValues *string `json:"-"` +} diff --git a/hris/fieldmapping/client.go b/hris/fieldmapping/client.go new file mode 100644 index 0000000..14d7f05 --- /dev/null +++ b/hris/fieldmapping/client.go @@ -0,0 +1,181 @@ +// This file was auto-generated by Fern from our API Definition. + +package fieldmapping + +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 all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) FieldMappingsRetrieve(ctx context.Context) (*hris.FieldMappingApiInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/field-mappings" + + var response *hris.FieldMappingApiInstanceResponse + 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 +} + +// Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsCreate(ctx context.Context, request *hris.CreateFieldMappingRequest) (*hris.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/field-mappings" + + var response *hris.FieldMappingInstanceResponse + 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 +} + +// Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsDestroy(ctx context.Context, fieldMappingId string) (*hris.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/hris/v1/field-mappings/%v", fieldMappingId) + + var response *hris.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsPartialUpdate(ctx context.Context, fieldMappingId string, request *hris.PatchedEditFieldMappingRequest) (*hris.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/hris/v1/field-mappings/%v", fieldMappingId) + + var response *hris.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) RemoteFieldsRetrieve(ctx context.Context, request *hris.RemoteFieldsRetrieveRequest) (*hris.RemoteFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/remote-fields" + + queryParams := make(url.Values) + if request.CommonModels != nil { + queryParams.Add("common_models", fmt.Sprintf("%v", *request.CommonModels)) + } + if request.IncludeExampleValues != nil { + queryParams.Add("include_example_values", fmt.Sprintf("%v", *request.IncludeExampleValues)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *hris.RemoteFieldApiResponse + 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 +} + +// Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +func (c *Client) TargetFieldsRetrieve(ctx context.Context) (*hris.ExternalTargetFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/target-fields" + + var response *hris.ExternalTargetFieldApiResponse + 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/forceresync/client.go b/hris/forceresync/client.go index 176332b..c76849e 100644 --- a/hris/forceresync/client.go +++ b/hris/forceresync/client.go @@ -27,7 +27,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Launch, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. func (c *Client) SyncStatusResyncCreate(ctx context.Context) ([]*hris.SyncStatus, error) { baseURL := "https://api.merge.dev" if c.baseURL != "" { diff --git a/hris/issues.go b/hris/issues.go index 82c048d..3724b79 100644 --- a/hris/issues.go +++ b/hris/issues.go @@ -18,7 +18,7 @@ type IssuesListRequest struct { FirstIncidentTimeAfter *time.Time `json:"-"` // If provided, will only return issues whose first incident time was before this datetime. FirstIncidentTimeBefore *time.Time `json:"-"` - // If True, will include muted issues + // If true, will include muted issues IncludeMuted *string `json:"-"` IntegrationName *string `json:"-"` // If provided, will only return issues whose last incident time was after this datetime. diff --git a/hris/link_token.go b/hris/link_token.go index 072b8ce..62b0f52 100644 --- a/hris/link_token.go +++ b/hris/link_token.go @@ -19,4 +19,6 @@ type EndUserDetailsRequest struct { ShouldCreateMagicLinkUrl *bool `json:"should_create_magic_link_url,omitempty"` // An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. CommonModels []*CommonModelScopesBodyRequest `json:"common_models,omitempty"` + // When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` } diff --git a/hris/scopes.go b/hris/scopes.go new file mode 100644 index 0000000..4d95d77 --- /dev/null +++ b/hris/scopes.go @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +package hris + +type LinkedAccountCommonModelScopeDeserializerRequest struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty"` +} diff --git a/hris/scopes/client.go b/hris/scopes/client.go new file mode 100644 index 0000000..8dd7756 --- /dev/null +++ b/hris/scopes/client.go @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/core" + hris "github.com/merge-api/merge-go-client/hris" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +// Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) DefaultScopesRetrieve(ctx context.Context) (*hris.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/default-scopes" + + var response *hris.CommonModelScopeApi + 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 +} + +// Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) LinkedAccountScopesRetrieve(ctx context.Context) (*hris.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/linked-account-scopes" + + var response *hris.CommonModelScopeApi + 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 +} + +// Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes) +func (c *Client) LinkedAccountScopesCreate(ctx context.Context, request *hris.LinkedAccountCommonModelScopeDeserializerRequest) (*hris.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/hris/v1/linked-account-scopes" + + var response *hris.CommonModelScopeApi + 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 +} diff --git a/hris/time_off.go b/hris/time_off.go index 52606b8..a258d64 100644 --- a/hris/time_off.go +++ b/hris/time_off.go @@ -26,6 +26,10 @@ type TimeOffListRequest struct { Cursor *string `json:"-"` // If provided, will only return time off for this employee. EmployeeId *string `json:"-"` + // If provided, will only return employees that ended after this datetime. + EndedAfter *time.Time `json:"-"` + // If provided, will only return time-offs that ended before this datetime. + EndedBefore *time.Time `json:"-"` // Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. Expand *TimeOffListRequestExpand `json:"-"` // Whether to include data that was marked as deleted by third party webhooks. @@ -53,6 +57,10 @@ type TimeOffListRequest struct { RequestType *TimeOffListRequestRequestType `json:"-"` // Which fields should be returned in non-normalized form. ShowEnumOrigins *TimeOffListRequestShowEnumOrigins `json:"-"` + // If provided, will only return time-offs that started after this datetime. + StartedAfter *time.Time `json:"-"` + // If provided, will only return time-offs that started before this datetime. + StartedBefore *time.Time `json:"-"` // If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') // // - `REQUESTED` - REQUESTED diff --git a/hris/timeoff/client.go b/hris/timeoff/client.go index 802d72c..46c608a 100644 --- a/hris/timeoff/client.go +++ b/hris/timeoff/client.go @@ -54,6 +54,12 @@ func (c *Client) List(ctx context.Context, request *hris.TimeOffListRequest) (*h if request.EmployeeId != nil { queryParams.Add("employee_id", fmt.Sprintf("%v", *request.EmployeeId)) } + if request.EndedAfter != nil { + queryParams.Add("ended_after", fmt.Sprintf("%v", request.EndedAfter.Format(time.RFC3339))) + } + if request.EndedBefore != nil { + queryParams.Add("ended_before", fmt.Sprintf("%v", request.EndedBefore.Format(time.RFC3339))) + } if request.Expand != nil { queryParams.Add("expand", fmt.Sprintf("%v", *request.Expand)) } @@ -84,6 +90,12 @@ func (c *Client) List(ctx context.Context, request *hris.TimeOffListRequest) (*h if request.ShowEnumOrigins != nil { queryParams.Add("show_enum_origins", fmt.Sprintf("%v", *request.ShowEnumOrigins)) } + if request.StartedAfter != nil { + queryParams.Add("started_after", fmt.Sprintf("%v", request.StartedAfter.Format(time.RFC3339))) + } + if request.StartedBefore != nil { + queryParams.Add("started_before", fmt.Sprintf("%v", request.StartedBefore.Format(time.RFC3339))) + } if request.Status != nil { queryParams.Add("status", fmt.Sprintf("%v", *request.Status)) } diff --git a/hris/types.go b/hris/types.go index 0c53a7a..879c5e7 100644 --- a/hris/types.go +++ b/hris/types.go @@ -174,12 +174,12 @@ type AccountIntegration struct { // The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. Color *string `json:"color,omitempty"` Slug *string `json:"slug,omitempty"` - // If checked, this integration will not appear in the linking flow, and will appear elsewhere with a Beta tag. - IsInBeta *bool `json:"is_in_beta,omitempty"` // Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} ApiEndpointsToDocumentationUrls map[string]interface{} `json:"api_endpoints_to_documentation_urls,omitempty"` // Setup guide URL for third party webhook creation. Exposed in Merge Docs. WebhookSetupGuideUrl *string `json:"webhook_setup_guide_url,omitempty"` + // Category or categories this integration is in beta status for. + CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty"` _rawJSON json.RawMessage } @@ -261,6 +261,40 @@ func (a AccountTypeEnum) Ptr() *AccountTypeEnum { return &a } +type AdvancedMetadata struct { + Id string `json:"id"` + DisplayName *string `json:"display_name,omitempty"` + Description *string `json:"description,omitempty"` + IsRequired *bool `json:"is_required,omitempty"` + IsCustom *bool `json:"is_custom,omitempty"` + FieldChoices []interface{} `json:"field_choices,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AdvancedMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AdvancedMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AdvancedMetadata) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id"` @@ -319,6 +353,7 @@ type AuditLogEvent struct { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION + // - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -381,6 +416,7 @@ func (a *AuditLogEvent) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -988,6 +1024,36 @@ func (c CategoryEnum) Ptr() *CategoryEnum { return &c } +type CommonModelScopeApi struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { + type unmarshaler CommonModelScopeApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CommonModelScopeApi(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CommonModelScopeApi) 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) +} + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions,omitempty"` @@ -6143,6 +6209,7 @@ func (e EthnicityEnum) Ptr() *EthnicityEnum { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -6176,6 +6243,7 @@ const ( EventTypeEnumDeletedLinkedAccount EventTypeEnum = "DELETED_LINKED_ACCOUNT" EventTypeEnumCreatedDestination EventTypeEnum = "CREATED_DESTINATION" EventTypeEnumDeletedDestination EventTypeEnum = "DELETED_DESTINATION" + EventTypeEnumChangedDestination EventTypeEnum = "CHANGED_DESTINATION" EventTypeEnumChangedScopes EventTypeEnum = "CHANGED_SCOPES" EventTypeEnumChangedPersonalInformation EventTypeEnum = "CHANGED_PERSONAL_INFORMATION" EventTypeEnumChangedOrganizationSettings EventTypeEnum = "CHANGED_ORGANIZATION_SETTINGS" @@ -6221,6 +6289,8 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumCreatedDestination, nil case "DELETED_DESTINATION": return EventTypeEnumDeletedDestination, nil + case "CHANGED_DESTINATION": + return EventTypeEnumChangedDestination, nil case "CHANGED_SCOPES": return EventTypeEnumChangedScopes, nil case "CHANGED_PERSONAL_INFORMATION": @@ -6268,6 +6338,340 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +type ExternalTargetFieldApi struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + IsMapped *string `json:"is_mapped,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApi(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApi) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type ExternalTargetFieldApiResponse struct { + Benefit []*ExternalTargetFieldApi `json:"Benefit,omitempty"` + EmployerBenefit []*ExternalTargetFieldApi `json:"EmployerBenefit,omitempty"` + Company []*ExternalTargetFieldApi `json:"Company,omitempty"` + EmployeePayrollRun []*ExternalTargetFieldApi `json:"EmployeePayrollRun,omitempty"` + Employee []*ExternalTargetFieldApi `json:"Employee,omitempty"` + Employment []*ExternalTargetFieldApi `json:"Employment,omitempty"` + Location []*ExternalTargetFieldApi `json:"Location,omitempty"` + PayrollRun []*ExternalTargetFieldApi `json:"PayrollRun,omitempty"` + Team []*ExternalTargetFieldApi `json:"Team,omitempty"` + TimeOff []*ExternalTargetFieldApi `json:"TimeOff,omitempty"` + TimeOffBalance []*ExternalTargetFieldApi `json:"TimeOffBalance,omitempty"` + BankInfo []*ExternalTargetFieldApi `json:"BankInfo,omitempty"` + PayGroup []*ExternalTargetFieldApi `json:"PayGroup,omitempty"` + Group []*ExternalTargetFieldApi `json:"Group,omitempty"` + Dependent []*ExternalTargetFieldApi `json:"Dependent,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApiResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApiResponse) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type FieldMappingApiInstance struct { + Id *string `json:"id,omitempty"` + IsIntegrationWide *bool `json:"is_integration_wide,omitempty"` + TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty"` + RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstance(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstance) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteField struct { + RemoteKeyName string `json:"remote_key_name"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { + Method *string `json:"method,omitempty"` + UrlPath *string `json:"url_path,omitempty"` + FieldTraversalPath []string `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceResponse struct { + Benefit []*FieldMappingApiInstance `json:"Benefit,omitempty"` + EmployerBenefit []*FieldMappingApiInstance `json:"EmployerBenefit,omitempty"` + Company []*FieldMappingApiInstance `json:"Company,omitempty"` + EmployeePayrollRun []*FieldMappingApiInstance `json:"EmployeePayrollRun,omitempty"` + Employee []*FieldMappingApiInstance `json:"Employee,omitempty"` + Employment []*FieldMappingApiInstance `json:"Employment,omitempty"` + Location []*FieldMappingApiInstance `json:"Location,omitempty"` + PayrollRun []*FieldMappingApiInstance `json:"PayrollRun,omitempty"` + Team []*FieldMappingApiInstance `json:"Team,omitempty"` + TimeOff []*FieldMappingApiInstance `json:"TimeOff,omitempty"` + TimeOffBalance []*FieldMappingApiInstance `json:"TimeOffBalance,omitempty"` + BankInfo []*FieldMappingApiInstance `json:"BankInfo,omitempty"` + PayGroup []*FieldMappingApiInstance `json:"PayGroup,omitempty"` + Group []*FieldMappingApiInstance `json:"Group,omitempty"` + Dependent []*FieldMappingApiInstance `json:"Dependent,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceTargetField struct { + Name string `json:"name"` + Description string `json:"description"` + IsOrganizationWide bool `json:"is_organization_wide"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceTargetField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceTargetField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceTargetField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingInstanceResponse struct { + Model *FieldMappingApiInstance `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializer struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializer(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializer) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializerRequest struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializerRequest(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializerRequest) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + // - `EXEMPT` - EXEMPT // - `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT // - `NONEXEMPT` - NONEXEMPT @@ -6340,7 +6744,7 @@ func (g GenderEnum) Ptr() *GenderEnum { // // ### Description // -// The `Group` object is used to represent any subset of employees, such as `PayGroup` or `Team`. Employees can be in multiple Groups. +// The `Group` object is used to represent any subset of employees across, for example, `DEPARTMENT` or `TEAM`. Employees can be in multiple Groups. // // ### Usage Example // @@ -6495,6 +6899,68 @@ func (g GroupTypeEnum) Ptr() *GroupTypeEnum { return &g } +type IndividualCommonModelScopeDeserializer struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializer(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializer) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + +type IndividualCommonModelScopeDeserializerRequest struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializerRequest(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializerRequest) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + type Issue struct { Id *string `json:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -7678,6 +8144,64 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +type ModelPermissionDeserializer struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializer(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializer) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + +type ModelPermissionDeserializerRequest struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializerRequest(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializerRequest) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + // # The MultipartFormField Object // // ### Description @@ -10190,6 +10714,113 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +type RemoteEndpointInfo struct { + Method string `json:"method"` + UrlPath string `json:"url_path"` + FieldTraversalPath []interface{} `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteEndpointInfo(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteEndpointInfo) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +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"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApi(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApi) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type RemoteFieldApiResponse struct { + Benefit []*RemoteFieldApi `json:"Benefit,omitempty"` + EmployerBenefit []*RemoteFieldApi `json:"EmployerBenefit,omitempty"` + Company []*RemoteFieldApi `json:"Company,omitempty"` + EmployeePayrollRun []*RemoteFieldApi `json:"EmployeePayrollRun,omitempty"` + Employee []*RemoteFieldApi `json:"Employee,omitempty"` + Employment []*RemoteFieldApi `json:"Employment,omitempty"` + Location []*RemoteFieldApi `json:"Location,omitempty"` + PayrollRun []*RemoteFieldApi `json:"PayrollRun,omitempty"` + Team []*RemoteFieldApi `json:"Team,omitempty"` + TimeOff []*RemoteFieldApi `json:"TimeOff,omitempty"` + TimeOffBalance []*RemoteFieldApi `json:"TimeOffBalance,omitempty"` + BankInfo []*RemoteFieldApi `json:"BankInfo,omitempty"` + PayGroup []*RemoteFieldApi `json:"PayGroup,omitempty"` + Group []*RemoteFieldApi `json:"Group,omitempty"` + Dependent []*RemoteFieldApi `json:"Dependent,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApiResponse(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApiResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + // # The RemoteKey Object // // ### Description diff --git a/ticketing/audit_trail.go b/ticketing/audit_trail.go index f141e32..22d26b7 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_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` + // 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` 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 5cb1a05..91d6cf8 100644 --- a/ticketing/client/client.go +++ b/ticketing/client/client.go @@ -15,6 +15,7 @@ import ( comments "github.com/merge-api/merge-go-client/ticketing/comments" contacts "github.com/merge-api/merge-go-client/ticketing/contacts" deleteaccount "github.com/merge-api/merge-go-client/ticketing/deleteaccount" + fieldmapping "github.com/merge-api/merge-go-client/ticketing/fieldmapping" forceresync "github.com/merge-api/merge-go-client/ticketing/forceresync" generatekey "github.com/merge-api/merge-go-client/ticketing/generatekey" issues "github.com/merge-api/merge-go-client/ticketing/issues" @@ -24,6 +25,7 @@ import ( projects "github.com/merge-api/merge-go-client/ticketing/projects" 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" @@ -49,7 +51,9 @@ type Client struct { Collections *collections.Client Comments *comments.Client Contacts *contacts.Client + Scopes *scopes.Client DeleteAccount *deleteaccount.Client + FieldMapping *fieldmapping.Client GenerateKey *generatekey.Client Issues *issues.Client LinkToken *linktoken.Client @@ -87,7 +91,9 @@ func NewClient(opts ...core.ClientOption) *Client { Collections: collections.NewClient(opts...), Comments: comments.NewClient(opts...), Contacts: contacts.NewClient(opts...), + Scopes: scopes.NewClient(opts...), DeleteAccount: deleteaccount.NewClient(opts...), + FieldMapping: fieldmapping.NewClient(opts...), GenerateKey: generatekey.NewClient(opts...), Issues: issues.NewClient(opts...), LinkToken: linktoken.NewClient(opts...), diff --git a/ticketing/collections.go b/ticketing/collections.go index 92ddc71..009ae84 100644 --- a/ticketing/collections.go +++ b/ticketing/collections.go @@ -9,10 +9,7 @@ import ( type CollectionsListRequest struct { // If provided, will only return collections of the given type. - // - // - `LIST` - LIST - // - `PROJECT` - PROJECT - CollectionType *CollectionsListRequestCollectionType `json:"-"` + CollectionType *string `json:"-"` // If provided, will only return objects created after this datetime. CreatedAfter *time.Time `json:"-"` // If provided, will only return objects created before this datetime. @@ -52,28 +49,6 @@ type CollectionsRetrieveRequest struct { ShowEnumOrigins *string `json:"-"` } -type CollectionsListRequestCollectionType string - -const ( - CollectionsListRequestCollectionTypeList CollectionsListRequestCollectionType = "LIST" - CollectionsListRequestCollectionTypeProject CollectionsListRequestCollectionType = "PROJECT" -) - -func NewCollectionsListRequestCollectionTypeFromString(s string) (CollectionsListRequestCollectionType, error) { - switch s { - case "LIST": - return CollectionsListRequestCollectionTypeList, nil - case "PROJECT": - return CollectionsListRequestCollectionTypeProject, nil - } - var t CollectionsListRequestCollectionType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CollectionsListRequestCollectionType) Ptr() *CollectionsListRequestCollectionType { - return &c -} - type CollectionsUsersListRequestExpand string const ( diff --git a/ticketing/field_mapping.go b/ticketing/field_mapping.go new file mode 100644 index 0000000..0444ce3 --- /dev/null +++ b/ticketing/field_mapping.go @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +package ticketing + +type CreateFieldMappingRequest struct { + // The name of the target field you want this remote field to map to. + TargetFieldName string `json:"target_field_name"` + // The description of the target field you want this remote field to map to. + TargetFieldDescription string `json:"target_field_description"` + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod string `json:"remote_method"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath string `json:"remote_url_path"` + // The name of the Common Model that the remote field corresponds to in a given category. + CommonModelName string `json:"common_model_name"` +} + +type PatchedEditFieldMappingRequest struct { + // The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + RemoteFieldTraversalPath []interface{} `json:"remote_field_traversal_path,omitempty"` + // The method of the remote endpoint where the remote field is coming from. + RemoteMethod *string `json:"remote_method,omitempty"` + // The path of the remote endpoint where the remote field is coming from. + RemoteUrlPath *string `json:"remote_url_path,omitempty"` +} + +type RemoteFieldsRetrieveRequest struct { + // A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + CommonModels *string `json:"-"` + // If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + IncludeExampleValues *string `json:"-"` +} diff --git a/ticketing/fieldmapping/client.go b/ticketing/fieldmapping/client.go new file mode 100644 index 0000000..ba51806 --- /dev/null +++ b/ticketing/fieldmapping/client.go @@ -0,0 +1,181 @@ +// This file was auto-generated by Fern from our API Definition. + +package fieldmapping + +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 all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) FieldMappingsRetrieve(ctx context.Context) (*ticketing.FieldMappingApiInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/field-mappings" + + var response *ticketing.FieldMappingApiInstanceResponse + 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 +} + +// Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsCreate(ctx context.Context, request *ticketing.CreateFieldMappingRequest) (*ticketing.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/field-mappings" + + var response *ticketing.FieldMappingInstanceResponse + 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 +} + +// Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsDestroy(ctx context.Context, fieldMappingId string) (*ticketing.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/ticketing/v1/field-mappings/%v", fieldMappingId) + + var response *ticketing.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +func (c *Client) FieldMappingsPartialUpdate(ctx context.Context, fieldMappingId string, request *ticketing.PatchedEditFieldMappingRequest) (*ticketing.FieldMappingInstanceResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"api/ticketing/v1/field-mappings/%v", fieldMappingId) + + var response *ticketing.FieldMappingInstanceResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +// Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +func (c *Client) RemoteFieldsRetrieve(ctx context.Context, request *ticketing.RemoteFieldsRetrieveRequest) (*ticketing.RemoteFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/remote-fields" + + queryParams := make(url.Values) + if request.CommonModels != nil { + queryParams.Add("common_models", fmt.Sprintf("%v", *request.CommonModels)) + } + if request.IncludeExampleValues != nil { + queryParams.Add("include_example_values", fmt.Sprintf("%v", *request.IncludeExampleValues)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *ticketing.RemoteFieldApiResponse + 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 +} + +// Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +func (c *Client) TargetFieldsRetrieve(ctx context.Context) (*ticketing.ExternalTargetFieldApiResponse, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/target-fields" + + var response *ticketing.ExternalTargetFieldApiResponse + 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/forceresync/client.go b/ticketing/forceresync/client.go index 4e955ba..6c502ff 100644 --- a/ticketing/forceresync/client.go +++ b/ticketing/forceresync/client.go @@ -27,7 +27,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +// Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Launch, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. func (c *Client) SyncStatusResyncCreate(ctx context.Context) ([]*ticketing.SyncStatus, error) { baseURL := "https://api.merge.dev" if c.baseURL != "" { diff --git a/ticketing/issues.go b/ticketing/issues.go index 2c48fbf..98b6fe5 100644 --- a/ticketing/issues.go +++ b/ticketing/issues.go @@ -18,7 +18,7 @@ type IssuesListRequest struct { FirstIncidentTimeAfter *time.Time `json:"-"` // If provided, will only return issues whose first incident time was before this datetime. FirstIncidentTimeBefore *time.Time `json:"-"` - // If True, will include muted issues + // If true, will include muted issues IncludeMuted *string `json:"-"` IntegrationName *string `json:"-"` // If provided, will only return issues whose last incident time was after this datetime. diff --git a/ticketing/link_token.go b/ticketing/link_token.go index 821da92..1a6f5db 100644 --- a/ticketing/link_token.go +++ b/ticketing/link_token.go @@ -19,4 +19,6 @@ type EndUserDetailsRequest struct { ShouldCreateMagicLinkUrl *bool `json:"should_create_magic_link_url,omitempty"` // An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. CommonModels []*CommonModelScopesBodyRequest `json:"common_models,omitempty"` + // When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + CategoryCommonModelScopes map[string][]*IndividualCommonModelScopeDeserializerRequest `json:"category_common_model_scopes,omitempty"` } diff --git a/ticketing/scopes.go b/ticketing/scopes.go new file mode 100644 index 0000000..5ce051a --- /dev/null +++ b/ticketing/scopes.go @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +package ticketing + +type LinkedAccountCommonModelScopeDeserializerRequest struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializerRequest `json:"common_models,omitempty"` +} diff --git a/ticketing/scopes/client.go b/ticketing/scopes/client.go new file mode 100644 index 0000000..2bf9e06 --- /dev/null +++ b/ticketing/scopes/client.go @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +package scopes + +import ( + context "context" + core "github.com/merge-api/merge-go-client/core" + ticketing "github.com/merge-api/merge-go-client/ticketing" + http "net/http" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +// Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) DefaultScopesRetrieve(ctx context.Context) (*ticketing.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/default-scopes" + + var response *ticketing.CommonModelScopeApi + 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 +} + +// Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes). +func (c *Client) LinkedAccountScopesRetrieve(ctx context.Context) (*ticketing.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/linked-account-scopes" + + var response *ticketing.CommonModelScopeApi + 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 +} + +// Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn More](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes) +func (c *Client) LinkedAccountScopesCreate(ctx context.Context, request *ticketing.LinkedAccountCommonModelScopeDeserializerRequest) (*ticketing.CommonModelScopeApi, error) { + baseURL := "https://api.merge.dev" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := baseURL + "/" + "api/ticketing/v1/linked-account-scopes" + + var response *ticketing.CommonModelScopeApi + 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 +} diff --git a/ticketing/types.go b/ticketing/types.go index a065151..1952307 100644 --- a/ticketing/types.go +++ b/ticketing/types.go @@ -255,12 +255,12 @@ type AccountIntegration struct { // The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. Color *string `json:"color,omitempty"` Slug *string `json:"slug,omitempty"` - // If checked, this integration will not appear in the linking flow, and will appear elsewhere with a Beta tag. - IsInBeta *bool `json:"is_in_beta,omitempty"` // Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} ApiEndpointsToDocumentationUrls map[string]interface{} `json:"api_endpoints_to_documentation_urls,omitempty"` // Setup guide URL for third party webhook creation. Exposed in Merge Docs. WebhookSetupGuideUrl *string `json:"webhook_setup_guide_url,omitempty"` + // Category or categories this integration is in beta status for. + CategoryBetaStatus map[string]interface{} `json:"category_beta_status,omitempty"` _rawJSON json.RawMessage } @@ -318,6 +318,40 @@ func (a *AccountToken) String() string { return fmt.Sprintf("%#v", a) } +type AdvancedMetadata struct { + Id string `json:"id"` + DisplayName *string `json:"display_name,omitempty"` + Description *string `json:"description,omitempty"` + IsRequired *bool `json:"is_required,omitempty"` + IsCustom *bool `json:"is_custom,omitempty"` + FieldChoices []interface{} `json:"field_choices,omitempty"` + + _rawJSON json.RawMessage +} + +func (a *AdvancedMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler AdvancedMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *a = AdvancedMetadata(value) + a._rawJSON = json.RawMessage(data) + return nil +} + +func (a *AdvancedMetadata) String() string { + if len(a._rawJSON) > 0 { + if value, err := core.StringifyJSON(a._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + type AsyncPassthroughReciept struct { AsyncPassthroughReceiptId string `json:"async_passthrough_receipt_id"` @@ -599,6 +633,7 @@ type AuditLogEvent struct { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION + // - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -661,6 +696,7 @@ func (a *AuditLogEvent) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -1691,6 +1727,36 @@ func (c *CommentUser) Accept(visitor CommentUserVisitor) error { } } +type CommonModelScopeApi struct { + // The common models you want to update the scopes for + CommonModels []*IndividualCommonModelScopeDeserializer `json:"common_models,omitempty"` + + _rawJSON json.RawMessage +} + +func (c *CommonModelScopeApi) UnmarshalJSON(data []byte) error { + type unmarshaler CommonModelScopeApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CommonModelScopeApi(value) + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *CommonModelScopeApi) 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) +} + type CommonModelScopesBodyRequest struct { ModelId string `json:"model_id"` EnabledActions []EnabledActionsEnum `json:"enabled_actions,omitempty"` @@ -2202,6 +2268,7 @@ func (e *ErrorValidationProblem) String() string { // - `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT // - `CREATED_DESTINATION` - CREATED_DESTINATION // - `DELETED_DESTINATION` - DELETED_DESTINATION +// - `CHANGED_DESTINATION` - CHANGED_DESTINATION // - `CHANGED_SCOPES` - CHANGED_SCOPES // - `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION // - `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS @@ -2235,6 +2302,7 @@ const ( EventTypeEnumDeletedLinkedAccount EventTypeEnum = "DELETED_LINKED_ACCOUNT" EventTypeEnumCreatedDestination EventTypeEnum = "CREATED_DESTINATION" EventTypeEnumDeletedDestination EventTypeEnum = "DELETED_DESTINATION" + EventTypeEnumChangedDestination EventTypeEnum = "CHANGED_DESTINATION" EventTypeEnumChangedScopes EventTypeEnum = "CHANGED_SCOPES" EventTypeEnumChangedPersonalInformation EventTypeEnum = "CHANGED_PERSONAL_INFORMATION" EventTypeEnumChangedOrganizationSettings EventTypeEnum = "CHANGED_ORGANIZATION_SETTINGS" @@ -2280,6 +2348,8 @@ func NewEventTypeEnumFromString(s string) (EventTypeEnum, error) { return EventTypeEnumCreatedDestination, nil case "DELETED_DESTINATION": return EventTypeEnumDeletedDestination, nil + case "CHANGED_DESTINATION": + return EventTypeEnumChangedDestination, nil case "CHANGED_SCOPES": return EventTypeEnumChangedScopes, nil case "CHANGED_PERSONAL_INFORMATION": @@ -2327,6 +2397,76 @@ func (e EventTypeEnum) Ptr() *EventTypeEnum { return &e } +type ExternalTargetFieldApi struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + IsMapped *string `json:"is_mapped,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApi(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApi) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + +type ExternalTargetFieldApiResponse struct { + Ticket []*ExternalTargetFieldApi `json:"Ticket,omitempty"` + Comment []*ExternalTargetFieldApi `json:"Comment,omitempty"` + Project []*ExternalTargetFieldApi `json:"Project,omitempty"` + Collection []*ExternalTargetFieldApi `json:"Collection,omitempty"` + User []*ExternalTargetFieldApi `json:"User,omitempty"` + Role []*ExternalTargetFieldApi `json:"Role,omitempty"` + Account []*ExternalTargetFieldApi `json:"Account,omitempty"` + Team []*ExternalTargetFieldApi `json:"Team,omitempty"` + Attachment []*ExternalTargetFieldApi `json:"Attachment,omitempty"` + Tag []*ExternalTargetFieldApi `json:"Tag,omitempty"` + Contact []*ExternalTargetFieldApi `json:"Contact,omitempty"` + + _rawJSON json.RawMessage +} + +func (e *ExternalTargetFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ExternalTargetFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *e = ExternalTargetFieldApiResponse(value) + e._rawJSON = json.RawMessage(data) + return nil +} + +func (e *ExternalTargetFieldApiResponse) String() string { + if len(e._rawJSON) > 0 { + if value, err := core.StringifyJSON(e._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(e); err == nil { + return value + } + return fmt.Sprintf("%#v", e) +} + // - `string` - string // - `number` - number // - `date` - date @@ -2367,6 +2507,262 @@ func (f FieldFormatEnum) Ptr() *FieldFormatEnum { return &f } +type FieldMappingApiInstance struct { + Id *string `json:"id,omitempty"` + IsIntegrationWide *bool `json:"is_integration_wide,omitempty"` + TargetField *FieldMappingApiInstanceTargetField `json:"target_field,omitempty"` + RemoteField *FieldMappingApiInstanceRemoteField `json:"remote_field,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstance) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstance + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstance(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstance) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteField struct { + RemoteKeyName string `json:"remote_key_name"` + Schema map[string]interface{} `json:"schema,omitempty"` + RemoteEndpointInfo *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo `json:"remote_endpoint_info,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo struct { + Method *string `json:"method,omitempty"` + UrlPath *string `json:"url_path,omitempty"` + FieldTraversalPath []string `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceResponse struct { + Ticket []*FieldMappingApiInstance `json:"Ticket,omitempty"` + Comment []*FieldMappingApiInstance `json:"Comment,omitempty"` + Project []*FieldMappingApiInstance `json:"Project,omitempty"` + Collection []*FieldMappingApiInstance `json:"Collection,omitempty"` + User []*FieldMappingApiInstance `json:"User,omitempty"` + Role []*FieldMappingApiInstance `json:"Role,omitempty"` + Account []*FieldMappingApiInstance `json:"Account,omitempty"` + Team []*FieldMappingApiInstance `json:"Team,omitempty"` + Attachment []*FieldMappingApiInstance `json:"Attachment,omitempty"` + Tag []*FieldMappingApiInstance `json:"Tag,omitempty"` + Contact []*FieldMappingApiInstance `json:"Contact,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingApiInstanceTargetField struct { + Name string `json:"name"` + Description string `json:"description"` + IsOrganizationWide bool `json:"is_organization_wide"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingApiInstanceTargetField) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingApiInstanceTargetField + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingApiInstanceTargetField(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingApiInstanceTargetField) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldMappingInstanceResponse struct { + Model *FieldMappingApiInstance `json:"model,omitempty"` + Warnings []*WarningValidationProblem `json:"warnings,omitempty"` + Errors []*ErrorValidationProblem `json:"errors,omitempty"` + Logs []*DebugModeLog `json:"logs,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldMappingInstanceResponse) UnmarshalJSON(data []byte) error { + type unmarshaler FieldMappingInstanceResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldMappingInstanceResponse(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldMappingInstanceResponse) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializer struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializer(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializer) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + +type FieldPermissionDeserializerRequest struct { + Enabled []interface{} `json:"enabled,omitempty"` + Disabled []interface{} `json:"disabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (f *FieldPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler FieldPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *f = FieldPermissionDeserializerRequest(value) + f._rawJSON = json.RawMessage(data) + return nil +} + +func (f *FieldPermissionDeserializerRequest) String() string { + if len(f._rawJSON) > 0 { + if value, err := core.StringifyJSON(f._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(f); err == nil { + return value + } + return fmt.Sprintf("%#v", f) +} + // - `string` - string // - `number` - number // - `date` - date @@ -2407,6 +2803,68 @@ func (f FieldTypeEnum) Ptr() *FieldTypeEnum { return &f } +type IndividualCommonModelScopeDeserializer struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializer `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializer `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializer(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializer) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + +type IndividualCommonModelScopeDeserializerRequest struct { + ModelName string `json:"model_name"` + ModelPermissions map[string]*ModelPermissionDeserializerRequest `json:"model_permissions,omitempty"` + FieldPermissions *FieldPermissionDeserializerRequest `json:"field_permissions,omitempty"` + + _rawJSON json.RawMessage +} + +func (i *IndividualCommonModelScopeDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualCommonModelScopeDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *i = IndividualCommonModelScopeDeserializerRequest(value) + i._rawJSON = json.RawMessage(data) + return nil +} + +func (i *IndividualCommonModelScopeDeserializerRequest) String() string { + if len(i._rawJSON) > 0 { + if value, err := core.StringifyJSON(i._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(i); err == nil { + return value + } + return fmt.Sprintf("%#v", i) +} + type Issue struct { Id *string `json:"id,omitempty"` // Status of the issue. Options: ('ONGOING', 'RESOLVED') @@ -2954,6 +3412,64 @@ func (m *ModelOperation) String() string { return fmt.Sprintf("%#v", m) } +type ModelPermissionDeserializer struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializer) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializer + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializer(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializer) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + +type ModelPermissionDeserializerRequest struct { + IsEnabled *bool `json:"is_enabled,omitempty"` + + _rawJSON json.RawMessage +} + +func (m *ModelPermissionDeserializerRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ModelPermissionDeserializerRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = ModelPermissionDeserializerRequest(value) + m._rawJSON = json.RawMessage(data) + return nil +} + +func (m *ModelPermissionDeserializerRequest) String() string { + if len(m._rawJSON) > 0 { + if value, err := core.StringifyJSON(m._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + // # The MultipartFormField Object // // ### Description @@ -3942,6 +4458,37 @@ func (r *RemoteData) String() string { return fmt.Sprintf("%#v", r) } +type RemoteEndpointInfo struct { + Method string `json:"method"` + UrlPath string `json:"url_path"` + FieldTraversalPath []interface{} `json:"field_traversal_path,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteEndpointInfo) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteEndpointInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteEndpointInfo(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteEndpointInfo) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + type RemoteField struct { RemoteFieldClass *RemoteFieldRemoteFieldClass `json:"remote_field_class,omitempty"` Value interface{} `json:"value,omitempty"` @@ -3972,6 +4519,78 @@ func (r *RemoteField) String() string { return fmt.Sprintf("%#v", r) } +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"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApi) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApi + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApi(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApi) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type RemoteFieldApiResponse struct { + Ticket []*RemoteFieldApi `json:"Ticket,omitempty"` + Comment []*RemoteFieldApi `json:"Comment,omitempty"` + Project []*RemoteFieldApi `json:"Project,omitempty"` + Collection []*RemoteFieldApi `json:"Collection,omitempty"` + User []*RemoteFieldApi `json:"User,omitempty"` + Role []*RemoteFieldApi `json:"Role,omitempty"` + Account []*RemoteFieldApi `json:"Account,omitempty"` + Team []*RemoteFieldApi `json:"Team,omitempty"` + Attachment []*RemoteFieldApi `json:"Attachment,omitempty"` + Tag []*RemoteFieldApi `json:"Tag,omitempty"` + Contact []*RemoteFieldApi `json:"Contact,omitempty"` + + _rawJSON json.RawMessage +} + +func (r *RemoteFieldApiResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RemoteFieldApiResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RemoteFieldApiResponse(value) + r._rawJSON = json.RawMessage(data) + return nil +} + +func (r *RemoteFieldApiResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + type RemoteFieldClass struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"`