-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalendar_api.go
271 lines (240 loc) · 12.1 KB
/
calendar_api.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
/*
* EVE Swagger Interface
*
* An OpenAPI for EVE Online
*
* OpenAPI spec version: 0.4.1.dev1
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
package swagger
import (
"net/url"
"strings"
"encoding/json"
"fmt"
)
type CalendarApi struct {
Configuration *Configuration
}
func NewCalendarApi() *CalendarApi {
configuration := NewConfiguration()
return &CalendarApi{
Configuration: configuration,
}
}
func NewCalendarApiWithBasePath(basePath string) *CalendarApi {
configuration := NewConfiguration()
configuration.BasePath = basePath
return &CalendarApi{
Configuration: configuration,
}
}
/**
* List calendar event summaries
* Get 50 event summaries from the calendar. If no event ID is given, the resource will return the next 50 chronological event summaries from now. If an event ID is specified, it will return the next 50 chronological event summaries from after that event. --- Alternate route: `/v1/characters/{character_id}/calendar/` Alternate route: `/legacy/characters/{character_id}/calendar/` Alternate route: `/dev/characters/{character_id}/calendar/` --- This route is cached for up to 5 seconds
*
* @param characterId The character to retrieve events from
* @param datasource The server name you would like data from
* @param fromEvent The event ID to retrieve events from
* @param token Access token to use, if preferred over a header
* @param userAgent Client identifier, takes precedence over headers
* @param xUserAgent Client identifier, takes precedence over User-Agent
* @return []GetCharactersCharacterIdCalendar200Ok
*/
func (a CalendarApi) GetCharactersCharacterIdCalendar(characterId int32, datasource string, fromEvent int32, token string, userAgent string, xUserAgent string) ([]GetCharactersCharacterIdCalendar200Ok, *APIResponse, error) {
var localVarHttpMethod = strings.ToUpper("Get")
// create path and map variables
localVarPath := a.Configuration.BasePath + "/characters/{character_id}/calendar/"
localVarPath = strings.Replace(localVarPath, "{"+"character_id"+"}", fmt.Sprintf("%v", characterId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := make(map[string]string)
var localVarPostBody interface{}
var localVarFileName string
var localVarFileBytes []byte
// authentication '(evesso)' required
// oauth required
if a.Configuration.AccessToken != ""{
localVarHeaderParams["Authorization"] = "Bearer " + a.Configuration.AccessToken
}
// add default headers if any
for key := range a.Configuration.DefaultHeader {
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
}
localVarQueryParams.Add("datasource", a.Configuration.APIClient.ParameterToString(datasource, ""))
localVarQueryParams.Add("from_event", a.Configuration.APIClient.ParameterToString(fromEvent, ""))
localVarQueryParams.Add("token", a.Configuration.APIClient.ParameterToString(token, ""))
localVarQueryParams.Add("user_agent", a.Configuration.APIClient.ParameterToString(userAgent, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// header params "X-User-Agent"
localVarHeaderParams["X-User-Agent"] = a.Configuration.APIClient.ParameterToString(xUserAgent, "")
var successPayload = new([]GetCharactersCharacterIdCalendar200Ok)
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
var localVarURL, _ = url.Parse(localVarPath)
localVarURL.RawQuery = localVarQueryParams.Encode()
var localVarAPIResponse = &APIResponse{Operation: "GetCharactersCharacterIdCalendar", Method: localVarHttpMethod, RequestURL: localVarURL.String()}
if localVarHttpResponse != nil {
localVarAPIResponse.Response = localVarHttpResponse.RawResponse
localVarAPIResponse.Payload = localVarHttpResponse.Body()
}
if err != nil {
return *successPayload, localVarAPIResponse, err
}
err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload)
return *successPayload, localVarAPIResponse, err
}
/**
* Get an event
* Get all the information for a specific event --- Alternate route: `/v3/characters/{character_id}/calendar/{event_id}/` Alternate route: `/dev/characters/{character_id}/calendar/{event_id}/` --- This route is cached for up to 5 seconds
*
* @param characterId The character id requesting the event
* @param eventId The id of the event requested
* @param datasource The server name you would like data from
* @param token Access token to use, if preferred over a header
* @param userAgent Client identifier, takes precedence over headers
* @param xUserAgent Client identifier, takes precedence over User-Agent
* @return *GetCharactersCharacterIdCalendarEventIdOk
*/
func (a CalendarApi) GetCharactersCharacterIdCalendarEventId(characterId int32, eventId int32, datasource string, token string, userAgent string, xUserAgent string) (*GetCharactersCharacterIdCalendarEventIdOk, *APIResponse, error) {
var localVarHttpMethod = strings.ToUpper("Get")
// create path and map variables
localVarPath := a.Configuration.BasePath + "/characters/{character_id}/calendar/{event_id}/"
localVarPath = strings.Replace(localVarPath, "{"+"character_id"+"}", fmt.Sprintf("%v", characterId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"event_id"+"}", fmt.Sprintf("%v", eventId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := make(map[string]string)
var localVarPostBody interface{}
var localVarFileName string
var localVarFileBytes []byte
// authentication '(evesso)' required
// oauth required
if a.Configuration.AccessToken != ""{
localVarHeaderParams["Authorization"] = "Bearer " + a.Configuration.AccessToken
}
// add default headers if any
for key := range a.Configuration.DefaultHeader {
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
}
localVarQueryParams.Add("datasource", a.Configuration.APIClient.ParameterToString(datasource, ""))
localVarQueryParams.Add("token", a.Configuration.APIClient.ParameterToString(token, ""))
localVarQueryParams.Add("user_agent", a.Configuration.APIClient.ParameterToString(userAgent, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// header params "X-User-Agent"
localVarHeaderParams["X-User-Agent"] = a.Configuration.APIClient.ParameterToString(xUserAgent, "")
var successPayload = new(GetCharactersCharacterIdCalendarEventIdOk)
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
var localVarURL, _ = url.Parse(localVarPath)
localVarURL.RawQuery = localVarQueryParams.Encode()
var localVarAPIResponse = &APIResponse{Operation: "GetCharactersCharacterIdCalendarEventId", Method: localVarHttpMethod, RequestURL: localVarURL.String()}
if localVarHttpResponse != nil {
localVarAPIResponse.Response = localVarHttpResponse.RawResponse
localVarAPIResponse.Payload = localVarHttpResponse.Body()
}
if err != nil {
return successPayload, localVarAPIResponse, err
}
err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload)
return successPayload, localVarAPIResponse, err
}
/**
* Respond to an event
* Set your response status to an event --- Alternate route: `/v3/characters/{character_id}/calendar/{event_id}/` Alternate route: `/dev/characters/{character_id}/calendar/{event_id}/`
*
* @param characterId The character ID requesting the event
* @param eventId The ID of the event requested
* @param response The response value to set, overriding current value.
* @param datasource The server name you would like data from
* @param token Access token to use, if preferred over a header
* @param userAgent Client identifier, takes precedence over headers
* @param xUserAgent Client identifier, takes precedence over User-Agent
* @return void
*/
func (a CalendarApi) PutCharactersCharacterIdCalendarEventId(characterId int32, eventId int32, response PutCharactersCharacterIdCalendarEventIdResponse, datasource string, token string, userAgent string, xUserAgent string) (*APIResponse, error) {
var localVarHttpMethod = strings.ToUpper("Put")
// create path and map variables
localVarPath := a.Configuration.BasePath + "/characters/{character_id}/calendar/{event_id}/"
localVarPath = strings.Replace(localVarPath, "{"+"character_id"+"}", fmt.Sprintf("%v", characterId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"event_id"+"}", fmt.Sprintf("%v", eventId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := make(map[string]string)
var localVarPostBody interface{}
var localVarFileName string
var localVarFileBytes []byte
// authentication '(evesso)' required
// oauth required
if a.Configuration.AccessToken != ""{
localVarHeaderParams["Authorization"] = "Bearer " + a.Configuration.AccessToken
}
// add default headers if any
for key := range a.Configuration.DefaultHeader {
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
}
localVarQueryParams.Add("datasource", a.Configuration.APIClient.ParameterToString(datasource, ""))
localVarQueryParams.Add("token", a.Configuration.APIClient.ParameterToString(token, ""))
localVarQueryParams.Add("user_agent", a.Configuration.APIClient.ParameterToString(userAgent, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// header params "X-User-Agent"
localVarHeaderParams["X-User-Agent"] = a.Configuration.APIClient.ParameterToString(xUserAgent, "")
// body params
localVarPostBody = &response
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
var localVarURL, _ = url.Parse(localVarPath)
localVarURL.RawQuery = localVarQueryParams.Encode()
var localVarAPIResponse = &APIResponse{Operation: "PutCharactersCharacterIdCalendarEventId", Method: localVarHttpMethod, RequestURL: localVarURL.String()}
if localVarHttpResponse != nil {
localVarAPIResponse.Response = localVarHttpResponse.RawResponse
localVarAPIResponse.Payload = localVarHttpResponse.Body()
}
if err != nil {
return localVarAPIResponse, err
}
return localVarAPIResponse, err
}