Skip to content

Commit

Permalink
Add SearchFilter type and add to SearchRequest (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmenden authored Feb 5, 2023
1 parent ad0b55e commit 7e78b10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ type PropertyFilter struct {

func (f PropertyFilter) filter() {}

type SearchFilter struct {
Value string `json:"value"`
Property string `json:"property"`
}

type TextFilterCondition struct {
Equals string `json:"equals,omitempty"`
DoesNotEqual string `json:"does_not_equal,omitempty"`
Expand Down
10 changes: 5 additions & 5 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func (sc *SearchClient) Do(ctx context.Context, request *SearchRequest) (*Search
}

type SearchRequest struct {
Query string `json:"query,omitempty"`
Sort *SortObject `json:"sort,omitempty"`
Filter interface{} `json:"filter,omitempty"`
StartCursor Cursor `json:"start_cursor,omitempty"`
PageSize int `json:"page_size,omitempty"`
Query string `json:"query,omitempty"`
Sort *SortObject `json:"sort,omitempty"`
Filter SearchFilter `json:"filter,omitempty"`
StartCursor Cursor `json:"start_cursor,omitempty"`
PageSize int `json:"page_size,omitempty"`
}

type SearchResponse struct {
Expand Down

0 comments on commit 7e78b10

Please sign in to comment.