Skip to content

Commit 2cf9e59

Browse files
Sync with latest futures helpers (#542)
1 parent 7e3adc9 commit 2cf9e59

1 file changed

Lines changed: 180 additions & 0 deletions

File tree

rest/models/futures.go

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,46 @@ type ListFuturesContractsParams struct {
7373
Sort *string `query:"sort"`
7474
}
7575

76+
func (p ListFuturesContractsParams) WithProductCode(q string) *ListFuturesContractsParams {
77+
p.ProductCode = &q
78+
return &p
79+
}
80+
81+
func (p ListFuturesContractsParams) WithFirstTradeDate(q Date) *ListFuturesContractsParams {
82+
p.FirstTradeDate = &q
83+
return &p
84+
}
85+
86+
func (p ListFuturesContractsParams) WithLastTradeDate(q Date) *ListFuturesContractsParams {
87+
p.LastTradeDate = &q
88+
return &p
89+
}
90+
91+
func (p ListFuturesContractsParams) WithAsOf(q Date) *ListFuturesContractsParams {
92+
p.AsOf = &q
93+
return &p
94+
}
95+
96+
func (p ListFuturesContractsParams) WithActive(q string) *ListFuturesContractsParams {
97+
p.Active = &q
98+
return &p
99+
}
100+
101+
func (p ListFuturesContractsParams) WithType(q string) *ListFuturesContractsParams {
102+
p.Type = &q
103+
return &p
104+
}
105+
106+
func (p ListFuturesContractsParams) WithLimit(q int) *ListFuturesContractsParams {
107+
p.Limit = &q
108+
return &p
109+
}
110+
111+
func (p ListFuturesContractsParams) WithSort(q string) *ListFuturesContractsParams {
112+
p.Sort = &q
113+
return &p
114+
}
115+
76116
// ListFuturesContractsResponse defines the response for the ListFuturesContracts endpoint.
77117
type ListFuturesContractsResponse struct {
78118
BaseResponse
@@ -106,6 +146,11 @@ type GetFuturesContractParams struct {
106146
AsOf *Date `query:"as_of"`
107147
}
108148

149+
func (p GetFuturesContractParams) WithAsOf(q Date) *GetFuturesContractParams {
150+
p.AsOf = &q
151+
return &p
152+
}
153+
109154
// GetFuturesContractResponse defines the response for the GetFuturesContract endpoint.
110155
type GetFuturesContractResponse struct {
111156
BaseResponse
@@ -120,6 +165,26 @@ type ListFuturesMarketStatusesParams struct {
120165
Sort *string `query:"sort"`
121166
}
122167

168+
func (p ListFuturesMarketStatusesParams) WithProductCodeAnyOf(q string) *ListFuturesMarketStatusesParams {
169+
p.ProductCodeAnyOf = &q
170+
return &p
171+
}
172+
173+
func (p ListFuturesMarketStatusesParams) WithProductCode(q string) *ListFuturesMarketStatusesParams {
174+
p.ProductCode = &q
175+
return &p
176+
}
177+
178+
func (p ListFuturesMarketStatusesParams) WithLimit(q int) *ListFuturesMarketStatusesParams {
179+
p.Limit = &q
180+
return &p
181+
}
182+
183+
func (p ListFuturesMarketStatusesParams) WithSort(q string) *ListFuturesMarketStatusesParams {
184+
p.Sort = &q
185+
return &p
186+
}
187+
123188
// ListFuturesMarketStatusesResponse defines the response for the ListFuturesMarketStatuses endpoint.
124189
type ListFuturesMarketStatusesResponse struct {
125190
BaseResponse
@@ -149,6 +214,61 @@ type ListFuturesProductsParams struct {
149214
Sort *string `query:"sort"`
150215
}
151216

217+
func (p ListFuturesProductsParams) WithName(q string) *ListFuturesProductsParams {
218+
p.Name = &q
219+
return &p
220+
}
221+
222+
func (p ListFuturesProductsParams) WithAsOf(q Date) *ListFuturesProductsParams {
223+
p.AsOf = &q
224+
return &p
225+
}
226+
227+
func (p ListFuturesProductsParams) WithTradingVenue(q string) *ListFuturesProductsParams {
228+
p.TradingVenue = &q
229+
return &p
230+
}
231+
232+
func (p ListFuturesProductsParams) WithSector(q string) *ListFuturesProductsParams {
233+
p.Sector = &q
234+
return &p
235+
}
236+
237+
func (p ListFuturesProductsParams) WithSubSector(q string) *ListFuturesProductsParams {
238+
p.SubSector = &q
239+
return &p
240+
}
241+
242+
func (p ListFuturesProductsParams) WithAssetClass(q string) *ListFuturesProductsParams {
243+
p.AssetClass = &q
244+
return &p
245+
}
246+
247+
func (p ListFuturesProductsParams) WithAssetSubClass(q string) *ListFuturesProductsParams {
248+
p.AssetSubClass = &q
249+
return &p
250+
}
251+
252+
func (p ListFuturesProductsParams) WithType(q string) *ListFuturesProductsParams {
253+
p.Type = &q
254+
return &p
255+
}
256+
257+
func (p ListFuturesProductsParams) WithLimit(q int) *ListFuturesProductsParams {
258+
p.Limit = &q
259+
return &p
260+
}
261+
262+
func (p ListFuturesProductsParams) WithNameSearch(q string) *ListFuturesProductsParams {
263+
p.NameSearch = &q
264+
return &p
265+
}
266+
267+
func (p ListFuturesProductsParams) WithSort(q string) *ListFuturesProductsParams {
268+
p.Sort = &q
269+
return &p
270+
}
271+
152272
// ListFuturesProductsResponse defines the response for the ListFuturesProducts endpoint.
153273
type ListFuturesProductsResponse struct {
154274
BaseResponse
@@ -184,6 +304,16 @@ type GetFuturesProductParams struct {
184304
AsOf *Date `query:"as_of"`
185305
}
186306

307+
func (p GetFuturesProductParams) WithType(q string) *GetFuturesProductParams {
308+
p.Type = &q
309+
return &p
310+
}
311+
312+
func (p GetFuturesProductParams) WithAsOf(q Date) *GetFuturesProductParams {
313+
p.AsOf = &q
314+
return &p
315+
}
316+
187317
// GetFuturesProductResponse defines the response for the GetFuturesProduct endpoint.
188318
type GetFuturesProductResponse struct {
189319
BaseResponse
@@ -218,6 +348,16 @@ func (p ListFuturesProductSchedulesParams) WithSessionEndDate(c Comparator, q Da
218348
return &p
219349
}
220350

351+
func (p ListFuturesProductSchedulesParams) WithLimit(q int) *ListFuturesProductSchedulesParams {
352+
p.Limit = &q
353+
return &p
354+
}
355+
356+
func (p ListFuturesProductSchedulesParams) WithSort(q string) *ListFuturesProductSchedulesParams {
357+
p.Sort = &q
358+
return &p
359+
}
360+
221361
// ListFuturesProductSchedulesResponse defines the response for the ListFuturesProductSchedules endpoint.
222362
type ListFuturesProductSchedulesResponse struct {
223363
BaseResponse
@@ -287,6 +427,16 @@ func (p ListFuturesQuotesParams) WithSessionEndDate(c Comparator, q string) *Lis
287427
return &p
288428
}
289429

430+
func (p ListFuturesQuotesParams) WithLimit(q int) *ListFuturesQuotesParams {
431+
p.Limit = &q
432+
return &p
433+
}
434+
435+
func (p ListFuturesQuotesParams) WithSort(q string) *ListFuturesQuotesParams {
436+
p.Sort = &q
437+
return &p
438+
}
439+
290440
// ListFuturesQuotesResponse defines the response for the ListFuturesQuotes endpoint.
291441
type ListFuturesQuotesResponse struct {
292442
BaseResponse
@@ -314,6 +464,26 @@ type ListFuturesSchedulesParams struct {
314464
Sort *string `query:"sort"`
315465
}
316466

467+
func (p ListFuturesSchedulesParams) WithSessionEndDate(q Date) *ListFuturesSchedulesParams {
468+
p.SessionEndDate = &q
469+
return &p
470+
}
471+
472+
func (p ListFuturesSchedulesParams) WithTradingVenue(q string) *ListFuturesSchedulesParams {
473+
p.TradingVenue = &q
474+
return &p
475+
}
476+
477+
func (p ListFuturesSchedulesParams) WithLimit(q int) *ListFuturesSchedulesParams {
478+
p.Limit = &q
479+
return &p
480+
}
481+
482+
func (p ListFuturesSchedulesParams) WithSort(q string) *ListFuturesSchedulesParams {
483+
p.Sort = &q
484+
return &p
485+
}
486+
317487
// ListFuturesSchedulesResponse defines the response for the ListFuturesSchedules endpoint.
318488
type ListFuturesSchedulesResponse struct {
319489
BaseResponse
@@ -369,6 +539,16 @@ func (p ListFuturesTradesParams) WithSessionEndDate(c Comparator, q string) *Lis
369539
return &p
370540
}
371541

542+
func (p ListFuturesTradesParams) WithLimit(q int) *ListFuturesTradesParams {
543+
p.Limit = &q
544+
return &p
545+
}
546+
547+
func (p ListFuturesTradesParams) WithSort(q string) *ListFuturesTradesParams {
548+
p.Sort = &q
549+
return &p
550+
}
551+
372552
// ListFuturesTradesResponse defines the response for the ListFuturesTrades endpoint.
373553
type ListFuturesTradesResponse struct {
374554
BaseResponse

0 commit comments

Comments
 (0)