-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral_ledger_account_read.go
More file actions
251 lines (222 loc) · 8.3 KB
/
Copy pathgeneral_ledger_account_read.go
File metadata and controls
251 lines (222 loc) · 8.3 KB
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
package webservices
import (
"context"
"net/http"
"net/url"
"github.com/omniboost/go-exactglobe-webservices/edm"
"github.com/omniboost/go-exactglobe-webservices/odata"
"github.com/omniboost/go-exactglobe-webservices/utils"
uuid "github.com/satori/go.uuid"
)
func (c *Client) NewGeneralLedgerAccountReadRequest() GeneralLedgerAccountReadRequest {
return GeneralLedgerAccountReadRequest{
client: c,
queryParams: c.NewGeneralLedgerAccountReadQueryParams(),
pathParams: c.NewGeneralLedgerAccountReadPathParams(),
method: http.MethodGet,
headers: http.Header{},
requestBody: c.NewGeneralLedgerAccountReadRequestBody(),
}
}
type GeneralLedgerAccountReadRequest struct {
client *Client
queryParams *GeneralLedgerAccountReadQueryParams
pathParams *GeneralLedgerAccountReadPathParams
method string
headers http.Header
requestBody GeneralLedgerAccountReadRequestBody
}
func (c *Client) NewGeneralLedgerAccountReadQueryParams() *GeneralLedgerAccountReadQueryParams {
selectFields, _ := utils.Fields(&GeneralLedgerAccount{})
return &GeneralLedgerAccountReadQueryParams{
Select: odata.NewSelect(selectFields),
Filter: odata.NewFilter(),
Top: odata.NewTop(),
Skip: odata.NewSkip(),
}
}
type GeneralLedgerAccountReadQueryParams struct {
// @TODO: check if this an OData struct or something
Select *odata.Select `schema:"$select,omitempty"`
Filter *odata.Filter `schema:"$filter,omitempty"`
Top *odata.Top `schema:"$top,omitempty"`
Skip *odata.Skip `schema:"$skip,omitempty"`
}
func (p GeneralLedgerAccountReadQueryParams) ToURLValues() (url.Values, error) {
encoder := utils.NewSchemaEncoder()
params := url.Values{}
err := encoder.Encode(p, params)
if err != nil {
return params, err
}
return params, nil
}
func (r *GeneralLedgerAccountReadRequest) QueryParams() *GeneralLedgerAccountReadQueryParams {
return r.queryParams
}
func (c *Client) NewGeneralLedgerAccountReadPathParams() *GeneralLedgerAccountReadPathParams {
return &GeneralLedgerAccountReadPathParams{}
}
type GeneralLedgerAccountReadPathParams struct {
}
func (p *GeneralLedgerAccountReadPathParams) Params() map[string]string {
return map[string]string{}
}
func (r *GeneralLedgerAccountReadRequest) PathParams() *GeneralLedgerAccountReadPathParams {
return r.pathParams
}
func (r *GeneralLedgerAccountReadRequest) SetMethod(method string) {
r.method = method
}
func (r *GeneralLedgerAccountReadRequest) Method() string {
return r.method
}
func (s *Client) NewGeneralLedgerAccountReadRequestBody() GeneralLedgerAccountReadRequestBody {
return GeneralLedgerAccountReadRequestBody{}
}
type GeneralLedgerAccountReadRequestBody GeneralLedgerAccounts
func (r *GeneralLedgerAccountReadRequest) RequestBody() *GeneralLedgerAccountReadRequestBody {
return &r.requestBody
}
func (r *GeneralLedgerAccountReadRequest) SetRequestBody(body GeneralLedgerAccountReadRequestBody) {
r.requestBody = body
}
func (r *GeneralLedgerAccountReadRequest) NewResponseBody() *GeneralLedgerAccountReadResponseBody {
return &GeneralLedgerAccountReadResponseBody{}
}
type GeneralLedgerAccountReadResponseBody struct {
D struct {
Results []struct {
Next string `json:"__next"`
MetaData edm.MetaData `json:"__metadata"`
GeneralLedgerAccount
} `json:"results"`
Next string `json:"__next"`
} `json:"d"`
}
func (r *GeneralLedgerAccountReadRequest) URL() url.URL {
return r.client.GetEndpointURL("GeneralLedgerAccount", r.PathParams())
}
func (r *GeneralLedgerAccountReadRequest) Do(ctx context.Context) (GeneralLedgerAccountReadResponseBody, error) {
// Create http request
req, err := r.client.NewRequest(ctx, r.Method(), r.URL(), r.RequestBody())
if err != nil {
return *r.NewResponseBody(), err
}
// Process query parameters
err = utils.AddQueryParamsToRequest(r.QueryParams(), req, false)
if err != nil {
return *r.NewResponseBody(), err
}
responseBody := r.NewResponseBody()
_, err = r.client.Do(req, responseBody)
return *responseBody, err
}
type GeneralLedgerAccounts []GeneralLedgerAccount
type GeneralLedgerAccount struct {
AccountConversionType int
AccountReportCategory string
AdjustmentAccount string
AlternativeLedger string
Assets bool
BalanceProfitAndLoss string
Blocked bool
CentralizationAccount string
ChequeAccount bool
Class1 string
Class1Description string
Class2 string
Class2Description string
Class3 string
Class3Description string
Class4 string
Class4Description string
Class5 string
Class5Description string
Class6 string
Class6Description string
Class7 string
Class7Description string
Class8 string
Class8Description string
Class9 string
Class9Description string
Class10 string
Class10Description string
Class11 string
Class12 string
ClosingEntryAccount string
Compress bool
CorporateGeneralLedgerCode string
CorporateGeneralLedgerDescription string
CostCentreAccount bool
CostUnitAccount bool
CreatedDate edm.DateTime
Creator int
CreatorFullName string
DebitCredit string
DefaultCostCentre string
DefaultCostUnit string
DefaultDebtorCreditor bool
CompanyCode string
CompanyName string
DocumentID *uuid.UUID
DocumentSubject string
ExcludeVATListing bool
ExternalBalanceCredit string
TextFreeField1 string
TextFreeField2 string
TextFreeField3 string
TextFreeField4 string
TextFreeField5 string
TextFreeField6 string
TextFreeField7 string
TextFreeField8 string
TextFreeField9 string
TextFreeField10 string
AmountFreeField1 float64
AmountFreeField2 float64
AmountFreeField3 float64
AmountFreeField4 float64
AmountFreeField5 float64
YesNoFreeField1 bool
YesNoFreeField2 bool
YesNoFreeField3 bool
YesNoFreeField4 bool
YesNoFreeField5 bool
GeneralLedgerAccountNumber string
GLAssociate string
GeneralLedgerCode string
GeneralLedgerDescription string
GeneralLedgerDescription1 string
GeneralLedgerDescription2 string
GeneralLedgerDescription3 string
GeneralLedgerDescription4 string
ID int
InvoiceRegisterType string
ItemAccount bool
Match bool
ModifiedDate edm.DateTime
Modifier int
ModifierFullName string
PageAfterClosing int
PercentagePrivate float64
PersonalAccount bool
ProjectAccount bool
PurchaseVATReturnType string
Quantities bool
RegisterMinerals string
ResourceAccount bool
Revalue bool
RevenueAccount string
RewardType string
SchemeType string
ShowNotes bool
SubTotalAccount string
TypeAdjustmentInflation string
UseCostcenterAllocation bool
UseIntercompany bool
VATCode string
VATNonDeductibleAccount string
VatNonDeductiblePercent float64
}