-
Notifications
You must be signed in to change notification settings - Fork 1
/
disputes.go
797 lines (703 loc) · 22.2 KB
/
disputes.go
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
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
// This file was auto-generated by Fern from our API Definition.
package square
import (
json "encoding/json"
fmt "fmt"
internal "github.com/square/square-go-sdk/internal"
io "io"
)
type DisputesCreateEvidenceFileRequest struct {
// The ID of the dispute for which you want to upload evidence.
DisputeID string `json:"-" url:"-"`
ImageFile io.Reader `json:"-" url:"-"`
Request *CreateDisputeEvidenceFileRequest `json:"request,omitempty" url:"-"`
}
type CreateDisputeEvidenceTextRequest struct {
// The ID of the dispute for which you want to upload evidence.
DisputeID string `json:"-" url:"-"`
// A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
IdempotencyKey string `json:"idempotency_key" url:"-"`
// The type of evidence you are uploading.
// See [DisputeEvidenceType](#type-disputeevidencetype) for possible values
EvidenceType *DisputeEvidenceType `json:"evidence_type,omitempty" url:"-"`
// The evidence string.
EvidenceText string `json:"evidence_text" url:"-"`
}
type DisputesSubmitEvidenceRequest struct {
// The ID of the dispute for which you want to submit evidence.
DisputeID string `json:"-" url:"-"`
}
type DisputesAcceptRequest struct {
// The ID of the dispute you want to accept.
DisputeID string `json:"-" url:"-"`
}
type DisputesGetRequest struct {
// The ID of the dispute you want more details about.
DisputeID string `json:"-" url:"-"`
}
type DisputesListRequest struct {
// A pagination cursor returned by a previous call to this endpoint.
// Provide this cursor to retrieve the next set of results for the original query.
// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
Cursor *string `json:"-" url:"cursor,omitempty"`
// The dispute states used to filter the result. If not specified, the endpoint returns all disputes.
States *DisputeState `json:"-" url:"states,omitempty"`
// The ID of the location for which to return a list of disputes.
// If not specified, the endpoint returns disputes associated with all locations.
LocationID *string `json:"-" url:"location_id,omitempty"`
}
// Defines the fields in an `AcceptDispute` response.
type AcceptDisputeResponse struct {
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
// Details about the accepted dispute.
Dispute *Dispute `json:"dispute,omitempty" url:"dispute,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (a *AcceptDisputeResponse) GetErrors() []*Error {
if a == nil {
return nil
}
return a.Errors
}
func (a *AcceptDisputeResponse) GetDispute() *Dispute {
if a == nil {
return nil
}
return a.Dispute
}
func (a *AcceptDisputeResponse) GetExtraProperties() map[string]interface{} {
return a.extraProperties
}
func (a *AcceptDisputeResponse) UnmarshalJSON(data []byte) error {
type unmarshaler AcceptDisputeResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*a = AcceptDisputeResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *a)
if err != nil {
return err
}
a.extraProperties = extraProperties
a.rawJSON = json.RawMessage(data)
return nil
}
func (a *AcceptDisputeResponse) String() string {
if len(a.rawJSON) > 0 {
if value, err := internal.StringifyJSON(a.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(a); err == nil {
return value
}
return fmt.Sprintf("%#v", a)
}
// Defines the parameters for a `CreateDisputeEvidenceFile` request.
type CreateDisputeEvidenceFileRequest struct {
// A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
IdempotencyKey string `json:"idempotency_key" url:"idempotency_key"`
// The type of evidence you are uploading.
// See [DisputeEvidenceType](#type-disputeevidencetype) for possible values
EvidenceType *DisputeEvidenceType `json:"evidence_type,omitempty" url:"evidence_type,omitempty"`
// The MIME type of the uploaded file.
// The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.
ContentType *string `json:"content_type,omitempty" url:"content_type,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (c *CreateDisputeEvidenceFileRequest) GetIdempotencyKey() string {
if c == nil {
return ""
}
return c.IdempotencyKey
}
func (c *CreateDisputeEvidenceFileRequest) GetEvidenceType() *DisputeEvidenceType {
if c == nil {
return nil
}
return c.EvidenceType
}
func (c *CreateDisputeEvidenceFileRequest) GetContentType() *string {
if c == nil {
return nil
}
return c.ContentType
}
func (c *CreateDisputeEvidenceFileRequest) GetExtraProperties() map[string]interface{} {
return c.extraProperties
}
func (c *CreateDisputeEvidenceFileRequest) UnmarshalJSON(data []byte) error {
type unmarshaler CreateDisputeEvidenceFileRequest
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*c = CreateDisputeEvidenceFileRequest(value)
extraProperties, err := internal.ExtractExtraProperties(data, *c)
if err != nil {
return err
}
c.extraProperties = extraProperties
c.rawJSON = json.RawMessage(data)
return nil
}
func (c *CreateDisputeEvidenceFileRequest) String() string {
if len(c.rawJSON) > 0 {
if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(c); err == nil {
return value
}
return fmt.Sprintf("%#v", c)
}
// Defines the fields in a `CreateDisputeEvidenceFile` response.
type CreateDisputeEvidenceFileResponse struct {
// Any errors that occurred during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
// The metadata of the newly uploaded dispute evidence.
Evidence *DisputeEvidence `json:"evidence,omitempty" url:"evidence,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (c *CreateDisputeEvidenceFileResponse) GetErrors() []*Error {
if c == nil {
return nil
}
return c.Errors
}
func (c *CreateDisputeEvidenceFileResponse) GetEvidence() *DisputeEvidence {
if c == nil {
return nil
}
return c.Evidence
}
func (c *CreateDisputeEvidenceFileResponse) GetExtraProperties() map[string]interface{} {
return c.extraProperties
}
func (c *CreateDisputeEvidenceFileResponse) UnmarshalJSON(data []byte) error {
type unmarshaler CreateDisputeEvidenceFileResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*c = CreateDisputeEvidenceFileResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *c)
if err != nil {
return err
}
c.extraProperties = extraProperties
c.rawJSON = json.RawMessage(data)
return nil
}
func (c *CreateDisputeEvidenceFileResponse) String() string {
if len(c.rawJSON) > 0 {
if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(c); err == nil {
return value
}
return fmt.Sprintf("%#v", c)
}
// Defines the fields in a `CreateDisputeEvidenceText` response.
type CreateDisputeEvidenceTextResponse struct {
// Any errors that occurred during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
// The newly uploaded dispute evidence metadata.
Evidence *DisputeEvidence `json:"evidence,omitempty" url:"evidence,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (c *CreateDisputeEvidenceTextResponse) GetErrors() []*Error {
if c == nil {
return nil
}
return c.Errors
}
func (c *CreateDisputeEvidenceTextResponse) GetEvidence() *DisputeEvidence {
if c == nil {
return nil
}
return c.Evidence
}
func (c *CreateDisputeEvidenceTextResponse) GetExtraProperties() map[string]interface{} {
return c.extraProperties
}
func (c *CreateDisputeEvidenceTextResponse) UnmarshalJSON(data []byte) error {
type unmarshaler CreateDisputeEvidenceTextResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*c = CreateDisputeEvidenceTextResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *c)
if err != nil {
return err
}
c.extraProperties = extraProperties
c.rawJSON = json.RawMessage(data)
return nil
}
func (c *CreateDisputeEvidenceTextResponse) String() string {
if len(c.rawJSON) > 0 {
if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(c); err == nil {
return value
}
return fmt.Sprintf("%#v", c)
}
// Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank.
type Dispute struct {
// The unique ID for this `Dispute`, generated by Square.
DisputeID *string `json:"dispute_id,omitempty" url:"dispute_id,omitempty"`
// The unique ID for this `Dispute`, generated by Square.
ID *string `json:"id,omitempty" url:"id,omitempty"`
// The disputed amount, which can be less than the total transaction amount.
// For instance, if multiple items were purchased but the cardholder only initiates a dispute over some of the items.
AmountMoney *Money `json:"amount_money,omitempty" url:"amount_money,omitempty"`
// The reason why the cardholder initiated the dispute.
// See [DisputeReason](#type-disputereason) for possible values
Reason *DisputeReason `json:"reason,omitempty" url:"reason,omitempty"`
// The current state of this dispute.
// See [DisputeState](#type-disputestate) for possible values
State *DisputeState `json:"state,omitempty" url:"state,omitempty"`
// The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates).
DueAt *string `json:"due_at,omitempty" url:"due_at,omitempty"`
// The payment challenged in this dispute.
DisputedPayment *DisputedPayment `json:"disputed_payment,omitempty" url:"disputed_payment,omitempty"`
// The IDs of the evidence associated with the dispute.
EvidenceIDs []string `json:"evidence_ids,omitempty" url:"evidence_ids,omitempty"`
// The card brand used in the disputed payment.
// See [CardBrand](#type-cardbrand) for possible values
CardBrand *CardBrand `json:"card_brand,omitempty" url:"card_brand,omitempty"`
// The timestamp when the dispute was created, in RFC 3339 format.
CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
// The timestamp when the dispute was last updated, in RFC 3339 format.
UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,omitempty"`
// The ID of the dispute in the card brand system, generated by the card brand.
BrandDisputeID *string `json:"brand_dispute_id,omitempty" url:"brand_dispute_id,omitempty"`
// The timestamp when the dispute was reported, in RFC 3339 format.
ReportedDate *string `json:"reported_date,omitempty" url:"reported_date,omitempty"`
// The timestamp when the dispute was reported, in RFC 3339 format.
ReportedAt *string `json:"reported_at,omitempty" url:"reported_at,omitempty"`
// The current version of the `Dispute`.
Version *int `json:"version,omitempty" url:"version,omitempty"`
// The ID of the location where the dispute originated.
LocationID *string `json:"location_id,omitempty" url:"location_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (d *Dispute) GetDisputeID() *string {
if d == nil {
return nil
}
return d.DisputeID
}
func (d *Dispute) GetID() *string {
if d == nil {
return nil
}
return d.ID
}
func (d *Dispute) GetAmountMoney() *Money {
if d == nil {
return nil
}
return d.AmountMoney
}
func (d *Dispute) GetReason() *DisputeReason {
if d == nil {
return nil
}
return d.Reason
}
func (d *Dispute) GetState() *DisputeState {
if d == nil {
return nil
}
return d.State
}
func (d *Dispute) GetDueAt() *string {
if d == nil {
return nil
}
return d.DueAt
}
func (d *Dispute) GetDisputedPayment() *DisputedPayment {
if d == nil {
return nil
}
return d.DisputedPayment
}
func (d *Dispute) GetEvidenceIDs() []string {
if d == nil {
return nil
}
return d.EvidenceIDs
}
func (d *Dispute) GetCardBrand() *CardBrand {
if d == nil {
return nil
}
return d.CardBrand
}
func (d *Dispute) GetCreatedAt() *string {
if d == nil {
return nil
}
return d.CreatedAt
}
func (d *Dispute) GetUpdatedAt() *string {
if d == nil {
return nil
}
return d.UpdatedAt
}
func (d *Dispute) GetBrandDisputeID() *string {
if d == nil {
return nil
}
return d.BrandDisputeID
}
func (d *Dispute) GetReportedDate() *string {
if d == nil {
return nil
}
return d.ReportedDate
}
func (d *Dispute) GetReportedAt() *string {
if d == nil {
return nil
}
return d.ReportedAt
}
func (d *Dispute) GetVersion() *int {
if d == nil {
return nil
}
return d.Version
}
func (d *Dispute) GetLocationID() *string {
if d == nil {
return nil
}
return d.LocationID
}
func (d *Dispute) GetExtraProperties() map[string]interface{} {
return d.extraProperties
}
func (d *Dispute) UnmarshalJSON(data []byte) error {
type unmarshaler Dispute
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = Dispute(value)
extraProperties, err := internal.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d.rawJSON = json.RawMessage(data)
return nil
}
func (d *Dispute) String() string {
if len(d.rawJSON) > 0 {
if value, err := internal.StringifyJSON(d.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
// The list of possible reasons why a cardholder might initiate a
// dispute with their bank.
type DisputeReason string
const (
DisputeReasonAmountDiffers DisputeReason = "AMOUNT_DIFFERS"
DisputeReasonCancelled DisputeReason = "CANCELLED"
DisputeReasonDuplicate DisputeReason = "DUPLICATE"
DisputeReasonNoKnowledge DisputeReason = "NO_KNOWLEDGE"
DisputeReasonNotAsDescribed DisputeReason = "NOT_AS_DESCRIBED"
DisputeReasonNotReceived DisputeReason = "NOT_RECEIVED"
DisputeReasonPaidByOtherMeans DisputeReason = "PAID_BY_OTHER_MEANS"
DisputeReasonCustomerRequestsCredit DisputeReason = "CUSTOMER_REQUESTS_CREDIT"
DisputeReasonEmvLiabilityShift DisputeReason = "EMV_LIABILITY_SHIFT"
)
func NewDisputeReasonFromString(s string) (DisputeReason, error) {
switch s {
case "AMOUNT_DIFFERS":
return DisputeReasonAmountDiffers, nil
case "CANCELLED":
return DisputeReasonCancelled, nil
case "DUPLICATE":
return DisputeReasonDuplicate, nil
case "NO_KNOWLEDGE":
return DisputeReasonNoKnowledge, nil
case "NOT_AS_DESCRIBED":
return DisputeReasonNotAsDescribed, nil
case "NOT_RECEIVED":
return DisputeReasonNotReceived, nil
case "PAID_BY_OTHER_MEANS":
return DisputeReasonPaidByOtherMeans, nil
case "CUSTOMER_REQUESTS_CREDIT":
return DisputeReasonCustomerRequestsCredit, nil
case "EMV_LIABILITY_SHIFT":
return DisputeReasonEmvLiabilityShift, nil
}
var t DisputeReason
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (d DisputeReason) Ptr() *DisputeReason {
return &d
}
// The list of possible dispute states.
type DisputeState string
const (
DisputeStateInquiryEvidenceRequired DisputeState = "INQUIRY_EVIDENCE_REQUIRED"
DisputeStateInquiryProcessing DisputeState = "INQUIRY_PROCESSING"
DisputeStateInquiryClosed DisputeState = "INQUIRY_CLOSED"
DisputeStateEvidenceRequired DisputeState = "EVIDENCE_REQUIRED"
DisputeStateProcessing DisputeState = "PROCESSING"
DisputeStateWon DisputeState = "WON"
DisputeStateLost DisputeState = "LOST"
DisputeStateAccepted DisputeState = "ACCEPTED"
)
func NewDisputeStateFromString(s string) (DisputeState, error) {
switch s {
case "INQUIRY_EVIDENCE_REQUIRED":
return DisputeStateInquiryEvidenceRequired, nil
case "INQUIRY_PROCESSING":
return DisputeStateInquiryProcessing, nil
case "INQUIRY_CLOSED":
return DisputeStateInquiryClosed, nil
case "EVIDENCE_REQUIRED":
return DisputeStateEvidenceRequired, nil
case "PROCESSING":
return DisputeStateProcessing, nil
case "WON":
return DisputeStateWon, nil
case "LOST":
return DisputeStateLost, nil
case "ACCEPTED":
return DisputeStateAccepted, nil
}
var t DisputeState
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (d DisputeState) Ptr() *DisputeState {
return &d
}
// The payment the cardholder disputed.
type DisputedPayment struct {
// Square-generated unique ID of the payment being disputed.
PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (d *DisputedPayment) GetPaymentID() *string {
if d == nil {
return nil
}
return d.PaymentID
}
func (d *DisputedPayment) GetExtraProperties() map[string]interface{} {
return d.extraProperties
}
func (d *DisputedPayment) UnmarshalJSON(data []byte) error {
type unmarshaler DisputedPayment
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DisputedPayment(value)
extraProperties, err := internal.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d.rawJSON = json.RawMessage(data)
return nil
}
func (d *DisputedPayment) String() string {
if len(d.rawJSON) > 0 {
if value, err := internal.StringifyJSON(d.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
// Defines fields in a `RetrieveDispute` response.
type GetDisputeResponse struct {
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
// Details about the requested `Dispute`.
Dispute *Dispute `json:"dispute,omitempty" url:"dispute,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (g *GetDisputeResponse) GetErrors() []*Error {
if g == nil {
return nil
}
return g.Errors
}
func (g *GetDisputeResponse) GetDispute() *Dispute {
if g == nil {
return nil
}
return g.Dispute
}
func (g *GetDisputeResponse) GetExtraProperties() map[string]interface{} {
return g.extraProperties
}
func (g *GetDisputeResponse) UnmarshalJSON(data []byte) error {
type unmarshaler GetDisputeResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*g = GetDisputeResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *g)
if err != nil {
return err
}
g.extraProperties = extraProperties
g.rawJSON = json.RawMessage(data)
return nil
}
func (g *GetDisputeResponse) String() string {
if len(g.rawJSON) > 0 {
if value, err := internal.StringifyJSON(g.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(g); err == nil {
return value
}
return fmt.Sprintf("%#v", g)
}
// Defines fields in a `ListDisputes` response.
type ListDisputesResponse struct {
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
// The list of disputes.
Disputes []*Dispute `json:"disputes,omitempty" url:"disputes,omitempty"`
// The pagination cursor to be used in a subsequent request.
// If unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
Cursor *string `json:"cursor,omitempty" url:"cursor,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (l *ListDisputesResponse) GetErrors() []*Error {
if l == nil {
return nil
}
return l.Errors
}
func (l *ListDisputesResponse) GetDisputes() []*Dispute {
if l == nil {
return nil
}
return l.Disputes
}
func (l *ListDisputesResponse) GetCursor() *string {
if l == nil {
return nil
}
return l.Cursor
}
func (l *ListDisputesResponse) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *ListDisputesResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ListDisputesResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = ListDisputesResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l.rawJSON = json.RawMessage(data)
return nil
}
func (l *ListDisputesResponse) String() string {
if len(l.rawJSON) > 0 {
if value, err := internal.StringifyJSON(l.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}
// Defines the fields in a `SubmitEvidence` response.
type SubmitEvidenceResponse struct {
// Information about errors encountered during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
// The `Dispute` for which evidence was submitted.
Dispute *Dispute `json:"dispute,omitempty" url:"dispute,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (s *SubmitEvidenceResponse) GetErrors() []*Error {
if s == nil {
return nil
}
return s.Errors
}
func (s *SubmitEvidenceResponse) GetDispute() *Dispute {
if s == nil {
return nil
}
return s.Dispute
}
func (s *SubmitEvidenceResponse) GetExtraProperties() map[string]interface{} {
return s.extraProperties
}
func (s *SubmitEvidenceResponse) UnmarshalJSON(data []byte) error {
type unmarshaler SubmitEvidenceResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*s = SubmitEvidenceResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *s)
if err != nil {
return err
}
s.extraProperties = extraProperties
s.rawJSON = json.RawMessage(data)
return nil
}
func (s *SubmitEvidenceResponse) String() string {
if len(s.rawJSON) > 0 {
if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}