oanda-client 1.1.0

An async, provider-native Rust client for OANDA's v20 REST API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
//! Decodes an independently sourced fixture for every documented definition.
//!
//! Fixture field sets and values are built from the pinned `OpenAPI` spec, a
//! different document parsed by a different reader than the website generator,
//! so a field the generator dropped or misnamed cannot also vanish from the
//! fixture: the round trip fails instead. Where the spec documents a field the
//! website does not, the website is authoritative and the field is recorded as
//! drift by the builder rather than silently ignored. Definitions the website
//! adds beyond the spec are fixture'd from the saved definition pages:
//! `AccumulatedAccountState`, `CandleSpecification`, `CandlestickResponse`, `ConversionFactor`, `DayOfWeek`, `DividendAdjustmentTransaction`, `FinancingDayOfWeek`, `GuaranteedStopLossDetails`, `GuaranteedStopLossOrder`, `GuaranteedStopLossOrderModeForInstrument`, `GuaranteedStopLossOrderMutability`, `GuaranteedStopLossOrderParameters`, `GuaranteedStopLossOrderReason`, `GuaranteedStopLossOrderRejectTransaction`, `GuaranteedStopLossOrderRequest`, `GuaranteedStopLossOrderTransaction`, `HomeConversionFactors`, `InstrumentFinancing`, `OpenTradeDividendAdjustment`, `PricingComponent`, `Tag`, `UserAttributes`.
//! Removing a field the struct holds as required must fail to decode, locking
//! the requiredness contract in place.
// Checked in and reviewed; hand-maintained alongside the definitions it decodes.
#![allow(
    clippy::expect_used,
    clippy::unwrap_used,
    clippy::panic,
    clippy::too_many_lines,
    clippy::needless_pass_by_value
)]
use serde_json::json;

fn decode_fixture<T: serde::Serialize + serde::de::DeserializeOwned>(fixture: serde_json::Value) {
    let value: T = serde_json::from_value(fixture.clone()).expect("decode fixture");
    let encoded = serde_json::to_value(value).expect("encode fixture");
    assert_eq!(encoded, fixture, "the fixture must survive the round trip");
}

fn missing_required_fails<T: serde::de::DeserializeOwned>(fixture: serde_json::Value, field: &str) {
    let mut reduced = fixture;
    let object = reduced.as_object_mut().expect("fixture is an object");
    assert!(object.remove(field).is_some(), "fixture carries {field}");
    assert!(
        serde_json::from_value::<T>(reduced).is_err(),
        "removing required field {field} must fail to decode"
    );
}

#[test]
fn every_documented_definition_decodes_an_independent_fixture() {
    decode_fixture::<oanda_client::models::AcceptDatetimeFormat>(json!("UNIX"));
    decode_fixture::<oanda_client::models::Account>(
        json!({"NAV": "1.5", "alias": "1", "balance": "1.5", "commission": "1.5", "createdByUserID": 1, "createdTime": "2024-01-02T03:04:05.123456789Z", "currency": "USD", "financing": "1.5", "guaranteedExecutionFees": "1.5", "guaranteedStopLossOrderMode": "DISABLED", "hedgingEnabled": true, "id": "1", "lastMarginCallExtensionTime": "2024-01-02T03:04:05.123456789Z", "lastTransactionID": "1", "marginAvailable": "1.5", "marginCallEnterTime": "2024-01-02T03:04:05.123456789Z", "marginCallExtensionCount": 1, "marginCallMarginUsed": "1.5", "marginCallPercent": "1.5", "marginCloseoutMarginUsed": "1.5", "marginCloseoutNAV": "1.5", "marginCloseoutPercent": "1.5", "marginCloseoutPositionValue": "1.5", "marginCloseoutUnrealizedPL": "1.5", "marginRate": "1.5", "marginUsed": "1.5", "openPositionCount": 1, "openTradeCount": 1, "orders": [], "pendingOrderCount": 1, "pl": "1.5", "positionValue": "1.5", "positions": [], "resettablePL": "1.5", "resettablePLTime": "2024-01-02T03:04:05.123456789Z", "trades": [], "unrealizedPL": "1.5", "withdrawalLimit": "1.5"}),
    );
    decode_fixture::<oanda_client::models::AccountChanges>(
        json!({"ordersCancelled": [], "ordersCreated": [], "ordersFilled": [], "ordersTriggered": [], "positions": [], "tradesClosed": [], "tradesOpened": [], "tradesReduced": [], "transactions": []}),
    );
    decode_fixture::<oanda_client::models::AccountChangesState>(
        json!({"NAV": "1.5", "marginAvailable": "1.5", "marginCallMarginUsed": "1.5", "marginCallPercent": "1.5", "marginCloseoutMarginUsed": "1.5", "marginCloseoutNAV": "1.5", "marginCloseoutPercent": "1.5", "marginCloseoutPositionValue": "1.5", "marginCloseoutUnrealizedPL": "1.5", "marginUsed": "1.5", "orders": [], "positionValue": "1.5", "positions": [], "trades": [], "unrealizedPL": "1.5", "withdrawalLimit": "1.5"}),
    );
    decode_fixture::<oanda_client::models::AccountFinancingMode>(json!("NO_FINANCING"));
    decode_fixture::<oanda_client::models::AccountID>(json!("1"));
    decode_fixture::<oanda_client::models::AccountProperties>(
        json!({"id": "1", "mt4AccountID": 1, "tags": ["1"]}),
    );
    decode_fixture::<oanda_client::models::AccountSummary>(
        json!({"NAV": "1.5", "alias": "1", "balance": "1.5", "commission": "1.5", "createdByUserID": 1, "createdTime": "2024-01-02T03:04:05.123456789Z", "currency": "USD", "financing": "1.5", "guaranteedExecutionFees": "1.5", "guaranteedStopLossOrderMode": "DISABLED", "hedgingEnabled": true, "id": "1", "lastMarginCallExtensionTime": "2024-01-02T03:04:05.123456789Z", "lastTransactionID": "1", "marginAvailable": "1.5", "marginCallEnterTime": "2024-01-02T03:04:05.123456789Z", "marginCallExtensionCount": 1, "marginCallMarginUsed": "1.5", "marginCallPercent": "1.5", "marginCloseoutMarginUsed": "1.5", "marginCloseoutNAV": "1.5", "marginCloseoutPercent": "1.5", "marginCloseoutPositionValue": "1.5", "marginCloseoutUnrealizedPL": "1.5", "marginRate": "1.5", "marginUsed": "1.5", "openPositionCount": 1, "openTradeCount": 1, "pendingOrderCount": 1, "pl": "1.5", "positionValue": "1.5", "resettablePL": "1.5", "resettablePLTime": "2024-01-02T03:04:05.123456789Z", "unrealizedPL": "1.5", "withdrawalLimit": "1.5"}),
    );
    decode_fixture::<oanda_client::models::AccountUnits>(json!("1.5"));
    decode_fixture::<oanda_client::models::AccumulatedAccountState>(
        json!({"balance": "1.5", "commission": "1.5", "dividendAdjustment": "1.5", "financing": "1.5", "guaranteedExecutionFees": "1.5", "lastMarginCallExtensionTime": "2024-01-02T03:04:05.123456789Z", "marginCallEnterTime": "2024-01-02T03:04:05.123456789Z", "marginCallExtensionCount": 1, "pl": "1.5", "resettablePL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::CalculatedAccountState>(
        json!({"NAV": "1.5", "marginAvailable": "1.5", "marginCallMarginUsed": "1.5", "marginCallPercent": "1.5", "marginCloseoutMarginUsed": "1.5", "marginCloseoutNAV": "1.5", "marginCloseoutPercent": "1.5", "marginCloseoutPositionValue": "1.5", "marginCloseoutUnrealizedPL": "1.5", "marginUsed": "1.5", "positionValue": "1.5", "unrealizedPL": "1.5", "withdrawalLimit": "1.5"}),
    );
    decode_fixture::<oanda_client::models::CalculatedPositionState>(
        json!({"instrument": "1", "longUnrealizedPL": "1.5", "marginUsed": "1.5", "netUnrealizedPL": "1.5", "shortUnrealizedPL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::CalculatedTradeState>(
        json!({"id": "1", "marginUsed": "1.5", "unrealizedPL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::CancellableOrderType>(json!("LIMIT"));
    decode_fixture::<oanda_client::models::CandleSpecification>(json!("M10:M"));
    decode_fixture::<oanda_client::models::Candlestick>(
        json!({"ask": {"c": "1", "h": "1", "l": "1", "o": "1"}, "bid": {"c": "1", "h": "1", "l": "1", "o": "1"}, "complete": true, "mid": {"c": "1", "h": "1", "l": "1", "o": "1"}, "time": "2024-01-02T03:04:05.123456789Z", "volume": 1}),
    );
    decode_fixture::<oanda_client::models::CandlestickData>(
        json!({"c": "1", "h": "1", "l": "1", "o": "1"}),
    );
    decode_fixture::<oanda_client::models::CandlestickGranularity>(json!("S5"));
    decode_fixture::<oanda_client::models::CandlestickResponse>(
        json!({"candles": [{"ask": {"c": "1", "h": "1", "l": "1", "o": "1"}, "bid": {"c": "1", "h": "1", "l": "1", "o": "1"}, "complete": true, "mid": {"c": "1", "h": "1", "l": "1", "o": "1"}, "time": "2024-01-02T03:04:05.123456789Z", "volume": 1}], "granularity": "S5", "instrument": "EUR_USD"}),
    );
    decode_fixture::<oanda_client::models::ClientComment>(json!("1"));
    decode_fixture::<oanda_client::models::ClientConfigureRejectTransaction>(
        json!({"accountID": "1", "alias": "1", "batchID": "1", "id": "1", "marginRate": "1.5", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::ClientConfigureTransaction>(
        json!({"accountID": "1", "alias": "1", "batchID": "1", "id": "1", "marginRate": "1.5", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::ClientExtensions>(
        json!({"comment": "1", "id": "1", "tag": "1"}),
    );
    decode_fixture::<oanda_client::models::ClientID>(json!("1"));
    decode_fixture::<oanda_client::models::ClientPrice>(
        json!({"asks": [], "bids": [], "closeoutAsk": "1", "closeoutBid": "1", "instrument": "1", "quoteHomeConversionFactors": {"negativeUnits": "1.5", "positiveUnits": "1.5"}, "status": "tradeable", "time": "2024-01-02T03:04:05.123456789Z", "tradeable": true, "type": "1", "unitsAvailable": {"default": {"long": "1.5", "short": "1.5"}, "openOnly": {"long": "1.5", "short": "1.5"}, "reduceFirst": {"long": "1.5", "short": "1.5"}, "reduceOnly": {"long": "1.5", "short": "1.5"}}}),
    );
    decode_fixture::<oanda_client::models::ClientRequestID>(json!("1"));
    decode_fixture::<oanda_client::models::ClientTag>(json!("1"));
    decode_fixture::<oanda_client::models::CloseTransaction>(
        json!({"accountID": "1", "batchID": "1", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::ConversionFactor>(json!({"factor": "1.5"}));
    decode_fixture::<oanda_client::models::CreateTransaction>(
        json!({"accountID": "1", "accountNumber": 1, "accountUserID": 1, "batchID": "1", "divisionID": 1, "homeCurrency": "USD", "id": "1", "requestID": "1", "siteID": 1, "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::Currency>(json!("USD"));
    decode_fixture::<oanda_client::models::DailyFinancingTransaction>(
        json!({"accountBalance": "1.5", "accountFinancingMode": "NO_FINANCING", "accountID": "1", "batchID": "1", "financing": "1.5", "id": "1", "positionFinancings": [], "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::DateTime>(json!("2024-01-02T03:04:05.123456789Z"));
    decode_fixture::<oanda_client::models::DayOfWeek>(json!(
        "SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY"
    ));
    decode_fixture::<oanda_client::models::DecimalNumber>(json!("1.5"));
    decode_fixture::<oanda_client::models::DelayedTradeClosureTransaction>(
        json!({"accountID": "1", "batchID": "1", "id": "1", "reason": "CLIENT_ORDER", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "tradeIDs": "1", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::Direction>(json!("LONG"));
    decode_fixture::<oanda_client::models::DividendAdjustmentTransaction>(
        json!({"accountBalance": "1.5", "accountID": "1", "batchID": "1", "dividendAdjustment": "1.5", "homeConversionFactors": {"gainBaseHome": {"factor": "1.5"}, "gainQuoteHome": {"factor": "1.5"}, "lossBaseHome": {"factor": "1.5"}, "lossQuoteHome": {"factor": "1.5"}}, "id": "1", "instrument": "EUR_USD", "openTradeDividendAdjustments": [{"dividendAdjustment": "1.5", "quoteDividendAdjustment": "1.5", "tradeID": "1"}], "quoteDividendAdjustment": "1.5", "requestID": "42", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::DynamicOrderState>(
        json!({"id": "1", "isTriggerDistanceExact": true, "trailingStopValue": "1", "triggerDistance": "1"}),
    );
    decode_fixture::<oanda_client::models::FinancingDayOfWeek>(
        json!({"dayOfWeek": "SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY", "daysCharged": 1}),
    );
    decode_fixture::<oanda_client::models::FixedPriceOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::FixedPriceOrderReason>(json!(
        "PLATFORM_ACCOUNT_MIGRATION"
    ));
    decode_fixture::<oanda_client::models::FixedPriceOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "PLATFORM_ACCOUNT_MIGRATION", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::FundingReason>(json!("CLIENT_FUNDING"));
    decode_fixture::<oanda_client::models::GuaranteedStopLossDetails>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1.5", "timeInForce": "GTC"}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteedExecutionPremium": "1.5", "id": "1", "price": "1.5", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderEntryData>(
        json!({"levelRestriction": {"priceRange": "1.5", "volume": "1.5"}, "minimumDistance": "1.5", "premium": "1.5"}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderLevelRestriction>(
        json!({"priceRange": "1.5", "volume": "1.5"}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderMode>(json!("DISABLED"));
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderModeForInstrument>(json!(
        "DISABLED ALLOWED REQUIRED"
    ));
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderMutability>(json!(
        "FIXED REPLACEABLE CANCELABLE PRICE_WIDEN_ONLY"
    ));
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderParameters>(
        json!({"mutabilityMarketHalted": "FIXED REPLACEABLE CANCELABLE PRICE_WIDEN_ONLY", "mutabilityMarketOpen": "FIXED REPLACEABLE CANCELABLE PRICE_WIDEN_ONLY"}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderReason>(json!(
        "CLIENT_ORDER REPLACEMENT ON_FILL"
    ));
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "price": "1.5", "reason": "CLIENT_ORDER REPLACEMENT ON_FILL", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "42", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1.5", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::GuaranteedStopLossOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteedExecutionPremium": "1.5", "id": "1", "orderFillTransactionID": "1", "price": "1.5", "reason": "CLIENT_ORDER REPLACEMENT ON_FILL", "replacesOrderID": "1", "requestID": "42", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::HomeConversionFactors>(
        json!({"gainBaseHome": {"factor": "1.5"}, "gainQuoteHome": {"factor": "1.5"}, "lossBaseHome": {"factor": "1.5"}, "lossQuoteHome": {"factor": "1.5"}}),
    );
    decode_fixture::<oanda_client::models::HomeConversions>(
        json!({"accountGain": "1.5", "accountLoss": "1.5", "currency": "USD", "positionValue": "1.5"}),
    );
    decode_fixture::<oanda_client::models::Instrument>(
        json!({"commission": {"commission": "1.5", "minimumCommission": "1.5", "unitsTraded": "1.5"}, "displayName": "1", "displayPrecision": 1, "marginRate": "1.5", "maximumOrderUnits": "1.5", "maximumPositionSize": "1.5", "maximumTrailingStopDistance": "1.5", "minimumTradeSize": "1.5", "minimumTrailingStopDistance": "1.5", "name": "1", "pipLocation": 1, "tradeUnitsPrecision": 1, "type": "CURRENCY"}),
    );
    decode_fixture::<oanda_client::models::InstrumentCommission>(
        json!({"commission": "1.5", "minimumCommission": "1.5", "unitsTraded": "1.5"}),
    );
    decode_fixture::<oanda_client::models::InstrumentFinancing>(
        json!({"financingDaysOfWeek": [{"dayOfWeek": "SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY", "daysCharged": 1}], "longRate": "1.5", "shortRate": "1.5"}),
    );
    decode_fixture::<oanda_client::models::InstrumentName>(json!("EUR_USD"));
    decode_fixture::<oanda_client::models::InstrumentType>(json!("CURRENCY"));
    decode_fixture::<oanda_client::models::LimitOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::LimitOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::LimitOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::LimitOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::LimitOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::LiquidityRegenerationSchedule>(json!({"steps": []}));
    decode_fixture::<oanda_client::models::LiquidityRegenerationScheduleStep>(
        json!({"askLiquidityUsed": "1.5", "bidLiquidityUsed": "1.5", "timestamp": "2024-01-02T03:04:05.123456789Z"}),
    );
    decode_fixture::<oanda_client::models::MarginCallEnterTransaction>(
        json!({"accountID": "1", "batchID": "1", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::MarginCallExitTransaction>(
        json!({"accountID": "1", "batchID": "1", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::MarginCallExtendTransaction>(
        json!({"accountID": "1", "batchID": "1", "extensionNumber": 1, "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::MarketIfTouchedOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "initialMarketPrice": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::MarketIfTouchedOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::MarketIfTouchedOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::MarketIfTouchedOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::MarketIfTouchedOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::MarketOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::MarketOrderDelayedTradeClose>(
        json!({"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}),
    );
    decode_fixture::<oanda_client::models::MarketOrderMarginCloseout>(
        json!({"reason": "MARGIN_CHECK_VIOLATION"}),
    );
    decode_fixture::<oanda_client::models::MarketOrderMarginCloseoutReason>(json!(
        "MARGIN_CHECK_VIOLATION"
    ));
    decode_fixture::<oanda_client::models::MarketOrderPositionCloseout>(
        json!({"instrument": "1", "units": "1"}),
    );
    decode_fixture::<oanda_client::models::MarketOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::MarketOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::MarketOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "instrument": "1", "positionFill": "OPEN_ONLY", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::MarketOrderTradeClose>(
        json!({"clientTradeID": "1", "tradeID": "1", "units": "1"}),
    );
    decode_fixture::<oanda_client::models::MarketOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "reason": "CLIENT_ORDER", "requestID": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::OpenTradeDividendAdjustment>(
        json!({"dividendAdjustment": "1.5", "quoteDividendAdjustment": "1.5", "tradeID": "1"}),
    );
    decode_fixture::<oanda_client::models::OpenTradeFinancing>(
        json!({"financing": "1.5", "tradeID": "1"}),
    );
    decode_fixture::<oanda_client::models::Order>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::OrderCancelReason>(json!("INTERNAL_SERVER_ERROR"));
    decode_fixture::<oanda_client::models::OrderCancelRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientOrderID": "1", "id": "1", "orderID": "1", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::OrderCancelTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientOrderID": "1", "id": "1", "orderID": "1", "reason": "INTERNAL_SERVER_ERROR", "replacedByOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::OrderClientExtensionsModifyRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensionsModify": {"comment": "1", "id": "1", "tag": "1"}, "clientOrderID": "1", "id": "1", "orderID": "1", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensionsModify": {"comment": "1", "id": "1", "tag": "1"}, "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::OrderClientExtensionsModifyTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensionsModify": {"comment": "1", "id": "1", "tag": "1"}, "clientOrderID": "1", "id": "1", "orderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensionsModify": {"comment": "1", "id": "1", "tag": "1"}, "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::OrderFillReason>(json!("LIMIT_ORDER"));
    decode_fixture::<oanda_client::models::OrderFillTransaction>(
        json!({"accountBalance": "1.5", "accountID": "1", "batchID": "1", "clientOrderID": "1", "commission": "1.5", "financing": "1.5", "fullPrice": {"asks": [], "bids": [], "closeoutAsk": "1", "closeoutBid": "1", "instrument": "1", "quoteHomeConversionFactors": {"negativeUnits": "1.5", "positiveUnits": "1.5"}, "status": "tradeable", "time": "2024-01-02T03:04:05.123456789Z", "tradeable": true, "type": "1", "unitsAvailable": {"default": {"long": "1.5", "short": "1.5"}, "openOnly": {"long": "1.5", "short": "1.5"}, "reduceFirst": {"long": "1.5", "short": "1.5"}, "reduceOnly": {"long": "1.5", "short": "1.5"}}}, "fullVWAP": "1", "gainQuoteHomeConversionFactor": "1.5", "guaranteedExecutionFee": "1.5", "halfSpreadCost": "1.5", "id": "1", "instrument": "1", "lossQuoteHomeConversionFactor": "1.5", "orderID": "1", "pl": "1.5", "price": "1", "reason": "LIMIT_ORDER", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "tradeOpened": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "guaranteedExecutionFee": "1.5", "halfSpreadCost": "1.5", "initialMarginRequired": "1.5", "price": "1", "tradeID": "1", "units": "1.5"}, "tradeReduced": {"financing": "1.5", "guaranteedExecutionFee": "1.5", "halfSpreadCost": "1.5", "price": "1", "realizedPL": "1.5", "tradeID": "1", "units": "1.5"}, "tradesClosed": [], "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::OrderID>(json!("1"));
    decode_fixture::<oanda_client::models::OrderIdentifier>(
        json!({"clientOrderID": "1", "orderID": "1"}),
    );
    decode_fixture::<oanda_client::models::OrderPositionFill>(json!("OPEN_ONLY"));
    decode_fixture::<oanda_client::models::OrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "instrument": "1", "positionFill": "OPEN_ONLY", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::OrderSpecifier>(json!("1"));
    decode_fixture::<oanda_client::models::OrderState>(json!("PENDING"));
    decode_fixture::<oanda_client::models::OrderStateFilter>(json!("PENDING"));
    decode_fixture::<oanda_client::models::OrderTriggerCondition>(json!("DEFAULT"));
    decode_fixture::<oanda_client::models::OrderType>(json!("MARKET"));
    decode_fixture::<oanda_client::models::Position>(
        json!({"commission": "1.5", "financing": "1.5", "guaranteedExecutionFees": "1.5", "instrument": "1", "long": {"averagePrice": "1", "financing": "1.5", "guaranteedExecutionFees": "1.5", "pl": "1.5", "resettablePL": "1.5", "tradeIDs": ["1"], "units": "1.5", "unrealizedPL": "1.5"}, "marginUsed": "1.5", "pl": "1.5", "resettablePL": "1.5", "short": {"averagePrice": "1", "financing": "1.5", "guaranteedExecutionFees": "1.5", "pl": "1.5", "resettablePL": "1.5", "tradeIDs": ["1"], "units": "1.5", "unrealizedPL": "1.5"}, "unrealizedPL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::PositionAggregationMode>(json!("ABSOLUTE_SUM"));
    decode_fixture::<oanda_client::models::PositionFinancing>(
        json!({"financing": "1.5", "instrument": "1", "openTradeFinancings": []}),
    );
    decode_fixture::<oanda_client::models::PositionSide>(
        json!({"averagePrice": "1", "financing": "1.5", "guaranteedExecutionFees": "1.5", "pl": "1.5", "resettablePL": "1.5", "tradeIDs": ["1"], "units": "1.5", "unrealizedPL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::PriceBucket>(json!({"liquidity": "1", "price": "1"}));
    decode_fixture::<oanda_client::models::PriceStatus>(json!("tradeable"));
    decode_fixture::<oanda_client::models::PriceValue>(json!("1.5"));
    decode_fixture::<oanda_client::models::PricingComponent>(json!("M"));
    decode_fixture::<oanda_client::models::PricingHeartbeat>(
        json!({"time": "2024-01-02T03:04:05.123456789Z", "type": "1"}),
    );
    decode_fixture::<oanda_client::models::QuoteHomeConversionFactors>(
        json!({"negativeUnits": "1.5", "positiveUnits": "1.5"}),
    );
    decode_fixture::<oanda_client::models::ReopenTransaction>(
        json!({"accountID": "1", "batchID": "1", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::RequestID>(json!("42"));
    decode_fixture::<oanda_client::models::ResetResettablePLTransaction>(
        json!({"accountID": "1", "batchID": "1", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::StopLossDetails>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}),
    );
    decode_fixture::<oanda_client::models::StopLossOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "guaranteedExecutionPremium": "1.5", "id": "1", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::StopLossOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::StopLossOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::StopLossOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::StopLossOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "guaranteedExecutionPremium": "1.5", "id": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::StopOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::StopOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::StopOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::StopOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::StopOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::Tag>(json!({"name": "1", "type": "1"}));
    decode_fixture::<oanda_client::models::TakeProfitDetails>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}),
    );
    decode_fixture::<oanda_client::models::TakeProfitOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::TakeProfitOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::TakeProfitOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TakeProfitOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::TakeProfitOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TimeInForce>(json!("GTC"));
    decode_fixture::<oanda_client::models::Trade>(
        json!({"averageClosePrice": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "closeTime": "2024-01-02T03:04:05.123456789Z", "closingTransactionIDs": ["1"], "currentUnits": "1.5", "financing": "1.5", "id": "1", "initialMarginRequired": "1.5", "initialUnits": "1.5", "instrument": "1", "marginUsed": "1.5", "openTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "realizedPL": "1.5", "state": "OPEN", "stopLossOrder": {"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "guaranteedExecutionPremium": "1.5", "id": "1", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}, "takeProfitOrder": {"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}, "trailingStopLossOrder": {"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopValue": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}, "unrealizedPL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::TradeClientExtensionsModifyRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientTradeID": "1", "id": "1", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensionsModify": {"comment": "1", "id": "1", "tag": "1"}, "tradeID": "1", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TradeClientExtensionsModifyTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientTradeID": "1", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensionsModify": {"comment": "1", "id": "1", "tag": "1"}, "tradeID": "1", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TradeID>(json!("1"));
    decode_fixture::<oanda_client::models::TradeOpen>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "guaranteedExecutionFee": "1.5", "halfSpreadCost": "1.5", "initialMarginRequired": "1.5", "price": "1", "tradeID": "1", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::TradePL>(json!("POSITIVE"));
    decode_fixture::<oanda_client::models::TradeReduce>(
        json!({"financing": "1.5", "guaranteedExecutionFee": "1.5", "halfSpreadCost": "1.5", "price": "1", "realizedPL": "1.5", "tradeID": "1", "units": "1.5"}),
    );
    decode_fixture::<oanda_client::models::TradeSpecifier>(json!("1"));
    decode_fixture::<oanda_client::models::TradeState>(json!("OPEN"));
    decode_fixture::<oanda_client::models::TradeStateFilter>(json!("OPEN"));
    decode_fixture::<oanda_client::models::TradeSummary>(
        json!({"averageClosePrice": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "closeTime": "2024-01-02T03:04:05.123456789Z", "closingTransactionIDs": ["1"], "currentUnits": "1.5", "financing": "1.5", "id": "1", "initialMarginRequired": "1.5", "initialUnits": "1.5", "instrument": "1", "marginUsed": "1.5", "openTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "realizedPL": "1.5", "state": "OPEN", "stopLossOrderID": "1", "takeProfitOrderID": "1", "trailingStopLossOrderID": "1", "unrealizedPL": "1.5"}),
    );
    decode_fixture::<oanda_client::models::TrailingStopLossDetails>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}),
    );
    decode_fixture::<oanda_client::models::TrailingStopLossOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopValue": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::TrailingStopLossOrderReason>(json!("CLIENT_ORDER"));
    decode_fixture::<oanda_client::models::TrailingStopLossOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TrailingStopLossOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
    );
    decode_fixture::<oanda_client::models::TrailingStopLossOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "orderFillTransactionID": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::Transaction>(
        json!({"accountID": "1", "accountNumber": 1, "accountUserID": 1, "batchID": "1", "divisionID": 1, "homeCurrency": "USD", "id": "1", "requestID": "1", "siteID": 1, "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TransactionFilter>(json!("ORDER"));
    decode_fixture::<oanda_client::models::TransactionHeartbeat>(
        json!({"lastTransactionID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "1"}),
    );
    decode_fixture::<oanda_client::models::TransactionID>(json!("1"));
    decode_fixture::<oanda_client::models::TransactionRejectReason>(json!("INTERNAL_SERVER_ERROR"));
    decode_fixture::<oanda_client::models::TransactionType>(json!("CREATE"));
    decode_fixture::<oanda_client::models::TransferFundsRejectTransaction>(
        json!({"accountID": "1", "amount": "1.5", "batchID": "1", "comment": "1", "fundingReason": "CLIENT_FUNDING", "id": "1", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::TransferFundsTransaction>(
        json!({"accountBalance": "1.5", "accountID": "1", "amount": "1.5", "batchID": "1", "comment": "1", "fundingReason": "CLIENT_FUNDING", "id": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "type": "CREATE", "userID": 1}),
    );
    decode_fixture::<oanda_client::models::UnitsAvailable>(
        json!({"default": {"long": "1.5", "short": "1.5"}, "openOnly": {"long": "1.5", "short": "1.5"}, "reduceFirst": {"long": "1.5", "short": "1.5"}, "reduceOnly": {"long": "1.5", "short": "1.5"}}),
    );
    decode_fixture::<oanda_client::models::UnitsAvailableDetails>(
        json!({"long": "1.5", "short": "1.5"}),
    );
    decode_fixture::<oanda_client::models::UserAttributes>(
        json!({"divisionAbbreviation": "1", "email": "1", "homeCurrency": "USD", "languageAbbreviation": "1", "name": "1", "title": "1", "userID": 1, "username": "1"}),
    );
    decode_fixture::<oanda_client::models::WeeklyAlignment>(json!("Monday"));
}

#[test]
fn removing_a_required_documented_field_fails_to_decode() {
    missing_required_fails::<oanda_client::models::FixedPriceOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::FixedPriceOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::FixedPriceOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::FixedPriceOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "PLATFORM_ACCOUNT_MIGRATION", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::FixedPriceOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "PLATFORM_ACCOUNT_MIGRATION", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::FixedPriceOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "PLATFORM_ACCOUNT_MIGRATION", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeState": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::GuaranteedStopLossOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteedExecutionPremium": "1.5", "id": "1", "price": "1.5", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::GuaranteedStopLossOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "price": "1.5", "reason": "CLIENT_ORDER REPLACEMENT ON_FILL", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "42", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::GuaranteedStopLossOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1.5", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::GuaranteedStopLossOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteedExecutionPremium": "1.5", "id": "1", "orderFillTransactionID": "1", "price": "1.5", "reason": "CLIENT_ORDER REPLACEMENT ON_FILL", "replacesOrderID": "1", "requestID": "42", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::LimitOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::LimitOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::LimitOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::LimitOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::LimitOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::LimitOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::LimitOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::LimitOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::LimitOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::LimitOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::LimitOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::LimitOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "initialMarketPrice": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "initialMarketPrice": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "initialMarketPrice": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::MarketIfTouchedOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "instrument": "1", "positionFill": "OPEN_ONLY", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "instrument": "1", "positionFill": "OPEN_ONLY", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::MarketOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "reason": "CLIENT_ORDER", "requestID": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::MarketOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "delayedTradeClose": {"clientTradeID": "1", "sourceTransactionID": "1", "tradeID": "1"}, "id": "1", "instrument": "1", "longPositionCloseout": {"instrument": "1", "units": "1"}, "marginCloseout": {"reason": "MARGIN_CHECK_VIOLATION"}, "positionFill": "OPEN_ONLY", "priceBound": "1", "reason": "CLIENT_ORDER", "requestID": "1", "shortPositionCloseout": {"instrument": "1", "units": "1"}, "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClose": {"clientTradeID": "1", "tradeID": "1", "units": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::StopLossOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "guaranteedExecutionPremium": "1.5", "id": "1", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopLossOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopLossOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopLossOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "guaranteedExecutionPremium": "1.5", "id": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::StopOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "tradeClosedIDs": ["1"], "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::StopOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::StopOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "intendedReplacesOrderID": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::StopOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::StopOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "MARKET", "units": "1.5"}),
        "units",
    );
    missing_required_fails::<oanda_client::models::StopOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "instrument",
    );
    missing_required_fails::<oanda_client::models::StopOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::StopOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "instrument": "1", "positionFill": "OPEN_ONLY", "price": "1", "priceBound": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "stopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "guaranteed": true, "price": "1", "timeInForce": "GTC"}, "takeProfitOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC"}, "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeClientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "trailingStopLossOnFill": {"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC"}, "triggerCondition": "DEFAULT", "type": "CREATE", "units": "1.5", "userID": 1}),
        "units",
    );
    missing_required_fails::<oanda_client::models::TakeProfitOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "price": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::TakeProfitOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::TakeProfitOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "price": "1", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "price",
    );
    missing_required_fails::<oanda_client::models::TakeProfitOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "orderFillTransactionID": "1", "price": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "price",
    );
    missing_required_fails::<oanda_client::models::TrailingStopLossOrder>(
        json!({"cancelledTime": "2024-01-02T03:04:05.123456789Z", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "createTime": "2024-01-02T03:04:05.123456789Z", "distance": "1.5", "filledTime": "2024-01-02T03:04:05.123456789Z", "fillingTransactionID": "1", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "replacedByOrderID": "1", "replacesOrderID": "1", "state": "PENDING", "timeInForce": "GTC", "tradeClosedIDs": ["1"], "tradeID": "1", "tradeOpenedID": "1", "tradeReducedID": "1", "trailingStopValue": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "distance",
    );
    missing_required_fails::<oanda_client::models::TrailingStopLossOrderRejectTransaction>(
        json!({"accountID": "1", "batchID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "intendedReplacesOrderID": "1", "orderFillTransactionID": "1", "reason": "CLIENT_ORDER", "rejectReason": "INTERNAL_SERVER_ERROR", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "distance",
    );
    missing_required_fails::<oanda_client::models::TrailingStopLossOrderRequest>(
        json!({"clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "MARKET"}),
        "distance",
    );
    missing_required_fails::<oanda_client::models::TrailingStopLossOrderTransaction>(
        json!({"accountID": "1", "batchID": "1", "cancellingTransactionID": "1", "clientExtensions": {"comment": "1", "id": "1", "tag": "1"}, "clientTradeID": "1", "distance": "1.5", "gtdTime": "2024-01-02T03:04:05.123456789Z", "id": "1", "orderFillTransactionID": "1", "reason": "CLIENT_ORDER", "replacesOrderID": "1", "requestID": "1", "time": "2024-01-02T03:04:05.123456789Z", "timeInForce": "GTC", "tradeID": "1", "triggerCondition": "DEFAULT", "type": "CREATE", "userID": 1}),
        "distance",
    );
}