• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-go / 11296113556

11 Oct 2024 04:42PM UTC coverage: 62.991% (-0.02%) from 63.015%
11296113556

Pull #1934

github

stripe-openapi[bot]
Update generated code for v1291
Pull Request #1934: Update generated code for beta

0 of 8 new or added lines in 2 files covered. (0.0%)

469 existing lines in 20 files now uncovered.

6209 of 9857 relevant lines covered (62.99%)

15.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/tax_form.go
1
//
2
//
3
// File generated from our OpenAPI spec
4
//
5
//
6

7
package stripe
8

9
import "encoding/json"
10

11
// Indicates the level of the jurisdiction where the form was filed.
12
type TaxFormFilingStatusJurisdictionLevel string
13

14
// List of values that TaxFormFilingStatusJurisdictionLevel can take
15
const (
16
        TaxFormFilingStatusJurisdictionLevelCountry TaxFormFilingStatusJurisdictionLevel = "country"
17
        TaxFormFilingStatusJurisdictionLevelState   TaxFormFilingStatusJurisdictionLevel = "state"
18
)
19

20
// The current status of the filed form.
21
type TaxFormFilingStatusValue string
22

23
// List of values that TaxFormFilingStatusValue can take
24
const (
25
        TaxFormFilingStatusValueAccepted TaxFormFilingStatusValue = "accepted"
26
        TaxFormFilingStatusValueFiled    TaxFormFilingStatusValue = "filed"
27
        TaxFormFilingStatusValueRejected TaxFormFilingStatusValue = "rejected"
28
)
29

30
// Always `account`.
31
type TaxFormPayeeType string
32

33
// List of values that TaxFormPayeeType can take
34
const (
35
        TaxFormPayeeTypeAccount TaxFormPayeeType = "account"
36
)
37

38
// The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type.
39
type TaxFormType string
40

41
// List of values that TaxFormType can take
42
const (
43
        TaxFormTypeUS1099K    TaxFormType = "us_1099_k"
44
        TaxFormTypeUS1099MISC TaxFormType = "us_1099_misc"
45
        TaxFormTypeUS1099Nec  TaxFormType = "us_1099_nec"
46
)
47

48
// The payee whose volume is represented on the tax form.
49
type TaxFormListPayeeParams struct {
50
        // The ID of the Stripe account whose forms will be retrieved.
51
        Account *string `form:"account"`
52
        // Specifies the payee type. Always `account`.
53
        Type *string `form:"type"`
54
}
55

56
// Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first.
57
type TaxFormListParams struct {
58
        ListParams `form:"*"`
59
        // Specifies which fields in the response should be expanded.
60
        Expand []*string `form:"expand"`
61
        // The payee whose volume is represented on the tax form.
62
        Payee *TaxFormListPayeeParams `form:"payee"`
63
        // An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future tax form types. If your integration expects only one type of tax form in the response, make sure to provide a type value in the request.
64
        Type *string `form:"type"`
65
}
66

67
// AddExpand appends a new field to expand.
UNCOV
68
func (p *TaxFormListParams) AddExpand(f string) {
×
UNCOV
69
        p.Expand = append(p.Expand, &f)
×
UNCOV
70
}
×
71

72
// Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information.
73
type TaxFormParams struct {
74
        Params `form:"*"`
75
        // Specifies which fields in the response should be expanded.
76
        Expand []*string `form:"expand"`
77
}
78

79
// AddExpand appends a new field to expand.
UNCOV
80
func (p *TaxFormParams) AddExpand(f string) {
×
UNCOV
81
        p.Expand = append(p.Expand, &f)
×
UNCOV
82
}
×
83

84
// Download the PDF for a tax form.
85
type TaxFormPDFParams struct {
86
        Params `form:"*"`
87
        // Specifies which fields in the response should be expanded.
88
        Expand []*string `form:"expand"`
89
}
90

91
// AddExpand appends a new field to expand.
UNCOV
92
func (p *TaxFormPDFParams) AddExpand(f string) {
×
UNCOV
93
        p.Expand = append(p.Expand, &f)
×
UNCOV
94
}
×
95

96
type TaxFormFilingStatusJurisdiction struct {
97
        // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Always `US`.
98
        Country string `json:"country"`
99
        // Indicates the level of the jurisdiction where the form was filed.
100
        Level TaxFormFilingStatusJurisdictionLevel `json:"level"`
101
        // [ISO 3166-2 U.S. state code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix, if any. For example, "NY" for New York, United States.
102
        State string `json:"state"`
103
}
104

105
// A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction's tax authority.
106
type TaxFormFilingStatus struct {
107
        // Time when the filing status was updated.
108
        EffectiveAt  int64                            `json:"effective_at"`
109
        Jurisdiction *TaxFormFilingStatusJurisdiction `json:"jurisdiction"`
110
        // The current status of the filed form.
111
        Value TaxFormFilingStatusValue `json:"value"`
112
}
113
type TaxFormPayee struct {
114
        // The ID of the payee's Stripe account.
115
        Account *Account `json:"account"`
116
        // Always `account`.
117
        Type TaxFormPayeeType `json:"type"`
118
}
119
type TaxFormUS1099K struct {
120
        // Year represented by the information reported on the tax form.
121
        ReportingYear int64 `json:"reporting_year"`
122
}
123
type TaxFormUS1099MISC struct {
124
        // Year represented by the information reported on the tax form.
125
        ReportingYear int64 `json:"reporting_year"`
126
}
127
type TaxFormUS1099Nec struct {
128
        // Year represented by the information reported on the tax form.
129
        ReportingYear int64 `json:"reporting_year"`
130
}
131

132
// Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes.
133
//
134
// Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting)
135
type TaxForm struct {
136
        APIResource
137
        // The form that corrects this form, if any.
138
        CorrectedBy *TaxForm `json:"corrected_by"`
139
        // Time at which the object was created. Measured in seconds since the Unix epoch.
140
        Created int64 `json:"created"`
141
        // A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction's tax authority.
142
        FilingStatuses []*TaxFormFilingStatus `json:"filing_statuses"`
143
        // Unique identifier for the object.
144
        ID string `json:"id"`
145
        // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
146
        Livemode bool `json:"livemode"`
147
        // String representing the object's type. Objects of the same type share the same value.
148
        Object string        `json:"object"`
149
        Payee  *TaxFormPayee `json:"payee"`
150
        // The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type.
151
        Type       TaxFormType        `json:"type"`
152
        US1099K    *TaxFormUS1099K    `json:"us_1099_k"`
153
        US1099MISC *TaxFormUS1099MISC `json:"us_1099_misc"`
154
        US1099Nec  *TaxFormUS1099Nec  `json:"us_1099_nec"`
155
}
156

157
// TaxFormList is a list of Forms as retrieved from a list endpoint.
158
type TaxFormList struct {
159
        APIResource
160
        ListMeta
161
        Data []*TaxForm `json:"data"`
162
}
163

164
// UnmarshalJSON handles deserialization of a TaxForm.
165
// This custom unmarshaling is needed because the resulting
166
// property may be an id or the full struct if it was expanded.
UNCOV
167
func (t *TaxForm) UnmarshalJSON(data []byte) error {
×
UNCOV
168
        if id, ok := ParseID(data); ok {
×
UNCOV
169
                t.ID = id
×
UNCOV
170
                return nil
×
UNCOV
171
        }
×
172

UNCOV
173
        type taxForm TaxForm
×
UNCOV
174
        var v taxForm
×
UNCOV
175
        if err := json.Unmarshal(data, &v); err != nil {
×
UNCOV
176
                return err
×
177
        }
×
178

UNCOV
179
        *t = TaxForm(v)
×
UNCOV
180
        return nil
×
181
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc