Skip to content

Commit

Permalink
feat: add query to filter custom objects record
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Romolini <paolo.romolini@enterprisedb.com>
  • Loading branch information
paoloromolini committed Aug 29, 2024
1 parent 0cad477 commit 3daab08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions zendesk/custom_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type CustomObjectAPI interface {
customObjectKey string,
) ([]CustomObjectField, error)
FilterCustomObjectRecords(
ctx context.Context, customObjectKey string, filterBody interface{}, opts *CursorPagination,
ctx context.Context, customObjectKey string, filterBody interface{}, opts *SearchCustomObjectRecordsOptions,
) ([]CustomObjectRecord, CursorPaginationMeta, int64, error)
}

Expand Down Expand Up @@ -328,7 +328,7 @@ func (z *Client) ListCustomObjectFields(
// https://developer.zendesk.com/api-reference/custom-data/custom-objects/
// custom_object_records/#filtered-search-of-custom-object-records
func (z *Client) FilterCustomObjectRecords(
ctx context.Context, customObjectKey string, filterBody interface{}, opts *CursorPagination,
ctx context.Context, customObjectKey string, filterBody interface{}, opts *SearchCustomObjectRecordsOptions,
) ([]CustomObjectRecord, CursorPaginationMeta, int64, error) {
var data struct {
FilterBody interface{} `json:"filter"`
Expand All @@ -341,7 +341,7 @@ func (z *Client) FilterCustomObjectRecords(
}
tmp := opts
if tmp == nil {
tmp = &CursorPagination{}
tmp = &SearchCustomObjectRecordsOptions{}
}
url := fmt.Sprintf("/custom_objects/%s/records/search", customObjectKey)
urlWithOptions, err := addOptions(url, tmp)
Expand Down
18 changes: 17 additions & 1 deletion zendesk/mock/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3daab08

Please sign in to comment.