@@ -33,91 +33,91 @@ class Query {
33
33
/// [value] can be a single value or a list. If a list is used
34
34
/// the query will return resources where [attribute] is equal
35
35
/// to any of the values in the list.
36
- static string equal(String attribute, dynamic value) =>
36
+ static String equal(String attribute, dynamic value) =>
37
37
Query._('equal', attribute, value).toJson();
38
38
39
39
/// Filter resources where [attribute] is not equal to [value].
40
- static string notEqual(String attribute, dynamic value) =>
40
+ static String notEqual(String attribute, dynamic value) =>
41
41
Query._('notEqual', attribute, [value]).toJson();
42
42
43
43
/// Filter resources where [attribute] is less than [value].
44
- static string lessThan(String attribute, dynamic value) =>
44
+ static String lessThan(String attribute, dynamic value) =>
45
45
Query._('lessThan', attribute, value).toJson();
46
46
47
47
/// Filter resources where [attribute] is less than or equal to [value].
48
- static string lessThanEqual(String attribute, dynamic value) =>
48
+ static String lessThanEqual(String attribute, dynamic value) =>
49
49
Query._('lessThanEqual', attribute, value).toJson();
50
50
51
51
/// Filter resources where [attribute] is greater than [value].
52
- static string greaterThan(String attribute, dynamic value) =>
52
+ static String greaterThan(String attribute, dynamic value) =>
53
53
Query._('greaterThan', attribute, value).toJson();
54
54
55
55
/// Filter resources where [attribute] is greater than or equal to [value].
56
- static string greaterThanEqual(String attribute, dynamic value) =>
56
+ static String greaterThanEqual(String attribute, dynamic value) =>
57
57
Query._('greaterThanEqual', attribute, value).toJson();
58
58
59
59
/// Filter resources where by searching [attribute] for [value].
60
- static string search(String attribute, String value) =>
60
+ static String search(String attribute, String value) =>
61
61
Query._('search', attribute, value).toJson();
62
62
63
63
/// Filter resources where [attribute] is null.
64
- static string isNull(String attribute) => Query._('isNull', attribute).toJson();
64
+ static String isNull(String attribute) => Query._('isNull', attribute).toJson();
65
65
66
66
/// Filter resources where [attribute] is not null.
67
- static string isNotNull(String attribute) => Query._('isNotNull', attribute).toJson();
67
+ static String isNotNull(String attribute) => Query._('isNotNull', attribute).toJson();
68
68
69
69
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
70
- static string between(String attribute, dynamic start, dynamic end) =>
70
+ static String between(String attribute, dynamic start, dynamic end) =>
71
71
Query._('between', attribute, [start, end]).toJson();
72
72
73
73
/// Filter resources where [attribute] starts with [value].
74
- static string startsWith(String attribute, String value) =>
74
+ static String startsWith(String attribute, String value) =>
75
75
Query._('startsWith', attribute, value).toJson();
76
76
77
77
/// Filter resources where [attribute] ends with [value].
78
- static string endsWith(String attribute, String value) =>
78
+ static String endsWith(String attribute, String value) =>
79
79
Query._('endsWith', attribute, value).toJson();
80
80
81
81
/// Filter resources where [attribute] contains [value]
82
82
/// [value] can be a single value or a list.
83
- static string contains(String attribute, dynamic value) =>
83
+ static String contains(String attribute, dynamic value) =>
84
84
Query._('contains', attribute, value).toJson();
85
85
86
- static string or(List<string > queries) =>
86
+ static String or(List<String > queries) =>
87
87
Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toJson();
88
88
89
- static string and(List<string > queries) =>
89
+ static String and(List<String > queries) =>
90
90
Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toJson();
91
91
92
92
/// Specify which attributes should be returned by the API call.
93
- static string select(List<String > attributes) =>
93
+ static String select(List<String > attributes) =>
94
94
Query._('select', null, attributes).toJson();
95
95
96
96
/// Sort results by [attribute] ascending.
97
- static string orderAsc(String attribute) => Query._('orderAsc', attribute).toJson();
97
+ static String orderAsc(String attribute) => Query._('orderAsc', attribute).toJson();
98
98
99
99
/// Sort results by [attribute] descending.
100
- static string orderDesc(String attribute) => Query._('orderDesc', attribute).toJson();
100
+ static String orderDesc(String attribute) => Query._('orderDesc', attribute).toJson();
101
101
102
102
/// Return results before [id].
103
103
///
104
104
/// Refer to the [Cursor Based Pagination]({{sdk .url }}/docs/pagination#cursor-pagination)
105
105
/// docs for more information.
106
- static string cursorBefore(String id) => Query._('cursorBefore', null, id).toJson();
106
+ static String cursorBefore(String id) => Query._('cursorBefore', null, id).toJson();
107
107
108
108
/// Return results after [id].
109
109
///
110
110
/// Refer to the [Cursor Based Pagination]({{sdk .url }}/docs/pagination#cursor-pagination)
111
111
/// docs for more information.
112
- static string cursorAfter(String id) => Query._('cursorAfter', null, id).toJson();
112
+ static String cursorAfter(String id) => Query._('cursorAfter', null, id).toJson();
113
113
114
114
/// Return only [limit] results.
115
- static string limit(int limit) => Query._('limit', null, limit).toJson();
115
+ static String limit(int limit) => Query._('limit', null, limit).toJson();
116
116
117
117
/// Return results from [offset].
118
118
///
119
119
/// Refer to the [Offset Pagination]({{sdk .url }}/docs/pagination#offset-pagination)
120
120
/// docs for more information.
121
- static string offset(int offset) => Query._('offset', null, offset).toJson();
121
+ static String offset(int offset) => Query._('offset', null, offset).toJson();
122
122
123
123
}
0 commit comments