esi-sdk 1.1.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/cicd.yml +17 -2
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +38 -0
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +21 -40
  7. data/README.md +2 -0
  8. data/Rakefile +75 -37
  9. data/bin/console +1 -1
  10. data/esi-sdk.gemspec +2 -3
  11. data/lib/esi/client/alliance.rb +103 -10
  12. data/lib/esi/client/assets.rb +193 -18
  13. data/lib/esi/client/bookmarks.rb +130 -12
  14. data/lib/esi/client/calendar.rb +144 -16
  15. data/lib/esi/client/character.rb +414 -42
  16. data/lib/esi/client/clones.rb +65 -6
  17. data/lib/esi/client/contacts.rb +294 -30
  18. data/lib/esi/client/contracts.rb +294 -31
  19. data/lib/esi/client/corporation.rb +755 -152
  20. data/lib/esi/client/dogma.rb +118 -12
  21. data/lib/esi/client/faction_warfare.rb +198 -14
  22. data/lib/esi/client/fittings.rb +94 -10
  23. data/lib/esi/client/fleets.rb +469 -49
  24. data/lib/esi/client/incursions.rb +23 -1
  25. data/lib/esi/client/industry.rb +250 -23
  26. data/lib/esi/client/insurance.rb +23 -1
  27. data/lib/esi/client/killmails.rb +95 -10
  28. data/lib/esi/client/location.rb +98 -9
  29. data/lib/esi/client/loyalty.rb +57 -6
  30. data/lib/esi/client/mail.rb +262 -28
  31. data/lib/esi/client/market.rb +322 -34
  32. data/lib/esi/client/opportunities.rb +124 -13
  33. data/lib/esi/client/planetary_interaction.rb +124 -13
  34. data/lib/esi/client/routes.rb +34 -6
  35. data/lib/esi/client/search.rb +64 -7
  36. data/lib/esi/client/skills.rb +95 -9
  37. data/lib/esi/client/sovereignty.rb +69 -3
  38. data/lib/esi/client/status.rb +24 -1
  39. data/lib/esi/client/universe.rb +817 -194
  40. data/lib/esi/client/user_interface.rb +157 -14
  41. data/lib/esi/client/wallet.rb +199 -22
  42. data/lib/esi/client/wars.rb +81 -9
  43. data/lib/esi/client.rb +74 -82
  44. data/lib/esi/errors.rb +12 -1
  45. data/lib/esi/version.rb +1 -1
  46. data/package.json +19 -0
  47. data/release.config.js +2 -2
  48. data/yarn.lock +3695 -0
  49. metadata +10 -22
@@ -16,7 +16,7 @@ module ESI
16
16
  # @esi_version v3
17
17
  # @esi_version v4
18
18
  #
19
- # @param character_id [Integer,String] An EVE character ID
19
+ # @param character_id [Integer] An EVE character ID
20
20
  # @param params [Hash] Additional query string parameters
21
21
  # @param headers [Hash] Additional headers
22
22
  #
@@ -29,11 +29,40 @@ module ESI
29
29
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
30
30
  #
31
31
  # @see https://esi.evetech.net/ui/#/Clones/get_characters_character_id_clones
32
- def get_character_clones(character_id:, params: {}, headers: {})
33
- get("/characters/#{character_id}/clones/", headers: headers, params: params)
32
+ def get_character_clones(character_id:, headers: {}, params: {})
33
+ get_character_clones_raw(character_id: character_id, headers: headers, params: params).json
34
34
  end
35
35
  alias get_characters_character_id_clones get_character_clones
36
36
 
37
+ # A list of the character's clones.
38
+ #
39
+ # This endpoint is cached for up to 120 seconds.
40
+ #
41
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
42
+ #
43
+ # @esi_scope esi-clones.read_clones.v1
44
+ #
45
+ # @esi_version dev
46
+ # @esi_version v3
47
+ # @esi_version v4
48
+ #
49
+ # @param character_id [Integer] An EVE character ID
50
+ # @param params [Hash] Additional query string parameters
51
+ # @param headers [Hash] Additional headers
52
+ #
53
+ # @raise [ESI::Errors::BadRequestError] Bad request
54
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
55
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
56
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
57
+ # @raise [ESI::Errors::InternalServerError] Internal server error
58
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
59
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
60
+ #
61
+ # @see https://esi.evetech.net/ui/#/Clones/get_characters_character_id_clones
62
+ def get_character_clones_raw(character_id:, headers: {}, params: {})
63
+ get("/characters/#{character_id}/clones/", headers: headers, params: params)
64
+ end
65
+
37
66
  # Return implants on the active clone of a character.
38
67
  #
39
68
  # This endpoint is cached for up to 120 seconds.
@@ -47,7 +76,7 @@ module ESI
47
76
  # @esi_version v1
48
77
  # @esi_version v2
49
78
  #
50
- # @param character_id [Integer,String] An EVE character ID
79
+ # @param character_id [Integer] An EVE character ID
51
80
  # @param params [Hash] Additional query string parameters
52
81
  # @param headers [Hash] Additional headers
53
82
  #
@@ -60,10 +89,40 @@ module ESI
60
89
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
61
90
  #
62
91
  # @see https://esi.evetech.net/ui/#/Clones/get_characters_character_id_implants
63
- def get_character_implants(character_id:, params: {}, headers: {})
64
- get("/characters/#{character_id}/implants/", headers: headers, params: params)
92
+ def get_character_implants(character_id:, headers: {}, params: {})
93
+ get_character_implants_raw(character_id: character_id, headers: headers, params: params).json
65
94
  end
66
95
  alias get_characters_character_id_implants get_character_implants
96
+
97
+ # Return implants on the active clone of a character.
98
+ #
99
+ # This endpoint is cached for up to 120 seconds.
100
+ #
101
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
102
+ #
103
+ # @esi_scope esi-clones.read_implants.v1
104
+ #
105
+ # @esi_version dev
106
+ # @esi_version legacy
107
+ # @esi_version v1
108
+ # @esi_version v2
109
+ #
110
+ # @param character_id [Integer] An EVE character ID
111
+ # @param params [Hash] Additional query string parameters
112
+ # @param headers [Hash] Additional headers
113
+ #
114
+ # @raise [ESI::Errors::BadRequestError] Bad request
115
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
116
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
117
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
118
+ # @raise [ESI::Errors::InternalServerError] Internal server error
119
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
120
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
121
+ #
122
+ # @see https://esi.evetech.net/ui/#/Clones/get_characters_character_id_implants
123
+ def get_character_implants_raw(character_id:, headers: {}, params: {})
124
+ get("/characters/#{character_id}/implants/", headers: headers, params: params)
125
+ end
67
126
  end
68
127
  end
69
128
  end
@@ -13,7 +13,7 @@ module ESI
13
13
  # @esi_version dev
14
14
  # @esi_version v2
15
15
  #
16
- # @param character_id [Integer,String] An EVE character ID
16
+ # @param character_id [Integer] An EVE character ID
17
17
  # @param contact_ids [Array] A list of contacts to delete
18
18
  # @param params [Hash] Additional query string parameters
19
19
  # @param headers [Hash] Additional headers
@@ -27,12 +27,39 @@ module ESI
27
27
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
28
28
  #
29
29
  # @see https://esi.evetech.net/ui/#/Contacts/delete_characters_character_id_contacts
30
- def delete_character_contacts(character_id:, contact_ids:, params: {}, headers: {})
31
- query_string = URI.encode_www_form([["contact_ids", contact_ids]])
32
- delete("/characters/#{character_id}/contacts/?#{query_string}", headers: headers, params: params)
30
+ def delete_character_contacts(character_id:, contact_ids:, headers: {}, params: {})
31
+ delete_character_contacts_raw(character_id: character_id, contact_ids: contact_ids, headers: headers, params: params).json
33
32
  end
34
33
  alias delete_characters_character_id_contacts delete_character_contacts
35
34
 
35
+ # Bulk delete contacts.
36
+ #
37
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
38
+ #
39
+ # @esi_scope esi-characters.write_contacts.v1
40
+ #
41
+ # @esi_version dev
42
+ # @esi_version v2
43
+ #
44
+ # @param character_id [Integer] An EVE character ID
45
+ # @param contact_ids [Array] A list of contacts to delete
46
+ # @param params [Hash] Additional query string parameters
47
+ # @param headers [Hash] Additional headers
48
+ #
49
+ # @raise [ESI::Errors::BadRequestError] Bad request
50
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
51
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
52
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
53
+ # @raise [ESI::Errors::InternalServerError] Internal server error
54
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
55
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
56
+ #
57
+ # @see https://esi.evetech.net/ui/#/Contacts/delete_characters_character_id_contacts
58
+ def delete_character_contacts_raw(character_id:, contact_ids:, headers: {}, params: {})
59
+ params.merge!("contact_ids" => contact_ids)
60
+ delete("/characters/#{character_id}/contacts/", headers: headers, params: params)
61
+ end
62
+
36
63
  # Return custom labels for an alliance's contacts.
37
64
  #
38
65
  # This endpoint is cached for up to 300 seconds.
@@ -45,7 +72,7 @@ module ESI
45
72
  # @esi_version legacy
46
73
  # @esi_version v1
47
74
  #
48
- # @param alliance_id [Integer,String] An EVE alliance ID
75
+ # @param alliance_id [Integer] An EVE alliance ID
49
76
  # @param params [Hash] Additional query string parameters
50
77
  # @param headers [Hash] Additional headers
51
78
  #
@@ -58,11 +85,40 @@ module ESI
58
85
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
59
86
  #
60
87
  # @see https://esi.evetech.net/ui/#/Contacts/get_alliances_alliance_id_contacts_labels
61
- def get_alliance_contact_labels(alliance_id:, params: {}, headers: {})
62
- get("/alliances/#{alliance_id}/contacts/labels/", headers: headers, params: params)
88
+ def get_alliance_contact_labels(alliance_id:, headers: {}, params: {})
89
+ get_alliance_contact_labels_raw(alliance_id: alliance_id, headers: headers, params: params).json
63
90
  end
64
91
  alias get_alliances_alliance_id_contacts_labels get_alliance_contact_labels
65
92
 
93
+ # Return custom labels for an alliance's contacts.
94
+ #
95
+ # This endpoint is cached for up to 300 seconds.
96
+ #
97
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
98
+ #
99
+ # @esi_scope esi-alliances.read_contacts.v1
100
+ #
101
+ # @esi_version dev
102
+ # @esi_version legacy
103
+ # @esi_version v1
104
+ #
105
+ # @param alliance_id [Integer] An EVE alliance ID
106
+ # @param params [Hash] Additional query string parameters
107
+ # @param headers [Hash] Additional headers
108
+ #
109
+ # @raise [ESI::Errors::BadRequestError] Bad request
110
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
111
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
112
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
113
+ # @raise [ESI::Errors::InternalServerError] Internal server error
114
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
115
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
116
+ #
117
+ # @see https://esi.evetech.net/ui/#/Contacts/get_alliances_alliance_id_contacts_labels
118
+ def get_alliance_contact_labels_raw(alliance_id:, headers: {}, params: {})
119
+ get("/alliances/#{alliance_id}/contacts/labels/", headers: headers, params: params)
120
+ end
121
+
66
122
  # Return contacts of an alliance.
67
123
  #
68
124
  # This endpoint is cached for up to 300 seconds.
@@ -74,7 +130,7 @@ module ESI
74
130
  # @esi_version dev
75
131
  # @esi_version v2
76
132
  #
77
- # @param alliance_id [Integer,String] An EVE alliance ID
133
+ # @param alliance_id [Integer] An EVE alliance ID
78
134
  # @param params [Hash] Additional query string parameters
79
135
  # @param headers [Hash] Additional headers
80
136
  #
@@ -87,11 +143,40 @@ module ESI
87
143
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
88
144
  #
89
145
  # @see https://esi.evetech.net/ui/#/Contacts/get_alliances_alliance_id_contacts
90
- def get_alliance_contacts(alliance_id:, params: {}, headers: {})
91
- get("/alliances/#{alliance_id}/contacts/", headers: headers, params: params)
146
+ def get_alliance_contacts(alliance_id:, headers: {}, params: {})
147
+ responses = get_alliance_contacts_raw(alliance_id: alliance_id, headers: headers, params: params)
148
+ responses.map(&:json).reduce([], :concat)
92
149
  end
93
150
  alias get_alliances_alliance_id_contacts get_alliance_contacts
94
151
 
152
+ # Return contacts of an alliance.
153
+ #
154
+ # This endpoint is cached for up to 300 seconds.
155
+ #
156
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
157
+ #
158
+ # @esi_scope esi-alliances.read_contacts.v1
159
+ #
160
+ # @esi_version dev
161
+ # @esi_version v2
162
+ #
163
+ # @param alliance_id [Integer] An EVE alliance ID
164
+ # @param params [Hash] Additional query string parameters
165
+ # @param headers [Hash] Additional headers
166
+ #
167
+ # @raise [ESI::Errors::BadRequestError] Bad request
168
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
169
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
170
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
171
+ # @raise [ESI::Errors::InternalServerError] Internal server error
172
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
173
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
174
+ #
175
+ # @see https://esi.evetech.net/ui/#/Contacts/get_alliances_alliance_id_contacts
176
+ def get_alliance_contacts_raw(alliance_id:, headers: {}, params: {})
177
+ get("/alliances/#{alliance_id}/contacts/", headers: headers, params: params)
178
+ end
179
+
95
180
  # Return custom labels for a character's contacts.
96
181
  #
97
182
  # This endpoint is cached for up to 300 seconds.
@@ -104,7 +189,7 @@ module ESI
104
189
  # @esi_version legacy
105
190
  # @esi_version v1
106
191
  #
107
- # @param character_id [Integer,String] An EVE character ID
192
+ # @param character_id [Integer] An EVE character ID
108
193
  # @param params [Hash] Additional query string parameters
109
194
  # @param headers [Hash] Additional headers
110
195
  #
@@ -117,11 +202,40 @@ module ESI
117
202
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
118
203
  #
119
204
  # @see https://esi.evetech.net/ui/#/Contacts/get_characters_character_id_contacts_labels
120
- def get_character_contact_labels(character_id:, params: {}, headers: {})
121
- get("/characters/#{character_id}/contacts/labels/", headers: headers, params: params)
205
+ def get_character_contact_labels(character_id:, headers: {}, params: {})
206
+ get_character_contact_labels_raw(character_id: character_id, headers: headers, params: params).json
122
207
  end
123
208
  alias get_characters_character_id_contacts_labels get_character_contact_labels
124
209
 
210
+ # Return custom labels for a character's contacts.
211
+ #
212
+ # This endpoint is cached for up to 300 seconds.
213
+ #
214
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
215
+ #
216
+ # @esi_scope esi-characters.read_contacts.v1
217
+ #
218
+ # @esi_version dev
219
+ # @esi_version legacy
220
+ # @esi_version v1
221
+ #
222
+ # @param character_id [Integer] An EVE character ID
223
+ # @param params [Hash] Additional query string parameters
224
+ # @param headers [Hash] Additional headers
225
+ #
226
+ # @raise [ESI::Errors::BadRequestError] Bad request
227
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
228
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
229
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
230
+ # @raise [ESI::Errors::InternalServerError] Internal server error
231
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
232
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
233
+ #
234
+ # @see https://esi.evetech.net/ui/#/Contacts/get_characters_character_id_contacts_labels
235
+ def get_character_contact_labels_raw(character_id:, headers: {}, params: {})
236
+ get("/characters/#{character_id}/contacts/labels/", headers: headers, params: params)
237
+ end
238
+
125
239
  # Return contacts of a character.
126
240
  #
127
241
  # This endpoint is cached for up to 300 seconds.
@@ -133,7 +247,7 @@ module ESI
133
247
  # @esi_version dev
134
248
  # @esi_version v2
135
249
  #
136
- # @param character_id [Integer,String] An EVE character ID
250
+ # @param character_id [Integer] An EVE character ID
137
251
  # @param params [Hash] Additional query string parameters
138
252
  # @param headers [Hash] Additional headers
139
253
  #
@@ -146,11 +260,40 @@ module ESI
146
260
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
147
261
  #
148
262
  # @see https://esi.evetech.net/ui/#/Contacts/get_characters_character_id_contacts
149
- def get_character_contacts(character_id:, params: {}, headers: {})
150
- get("/characters/#{character_id}/contacts/", headers: headers, params: params)
263
+ def get_character_contacts(character_id:, headers: {}, params: {})
264
+ responses = get_character_contacts_raw(character_id: character_id, headers: headers, params: params)
265
+ responses.map(&:json).reduce([], :concat)
151
266
  end
152
267
  alias get_characters_character_id_contacts get_character_contacts
153
268
 
269
+ # Return contacts of a character.
270
+ #
271
+ # This endpoint is cached for up to 300 seconds.
272
+ #
273
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
274
+ #
275
+ # @esi_scope esi-characters.read_contacts.v1
276
+ #
277
+ # @esi_version dev
278
+ # @esi_version v2
279
+ #
280
+ # @param character_id [Integer] An EVE character ID
281
+ # @param params [Hash] Additional query string parameters
282
+ # @param headers [Hash] Additional headers
283
+ #
284
+ # @raise [ESI::Errors::BadRequestError] Bad request
285
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
286
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
287
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
288
+ # @raise [ESI::Errors::InternalServerError] Internal server error
289
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
290
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
291
+ #
292
+ # @see https://esi.evetech.net/ui/#/Contacts/get_characters_character_id_contacts
293
+ def get_character_contacts_raw(character_id:, headers: {}, params: {})
294
+ get("/characters/#{character_id}/contacts/", headers: headers, params: params)
295
+ end
296
+
154
297
  # Return custom labels for a corporation's contacts.
155
298
  #
156
299
  # This endpoint is cached for up to 300 seconds.
@@ -163,7 +306,7 @@ module ESI
163
306
  # @esi_version legacy
164
307
  # @esi_version v1
165
308
  #
166
- # @param corporation_id [Integer,String] An EVE corporation ID
309
+ # @param corporation_id [Integer] An EVE corporation ID
167
310
  # @param params [Hash] Additional query string parameters
168
311
  # @param headers [Hash] Additional headers
169
312
  #
@@ -176,11 +319,40 @@ module ESI
176
319
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
177
320
  #
178
321
  # @see https://esi.evetech.net/ui/#/Contacts/get_corporations_corporation_id_contacts_labels
179
- def get_corporation_contact_labels(corporation_id:, params: {}, headers: {})
180
- get("/corporations/#{corporation_id}/contacts/labels/", headers: headers, params: params)
322
+ def get_corporation_contact_labels(corporation_id:, headers: {}, params: {})
323
+ get_corporation_contact_labels_raw(corporation_id: corporation_id, headers: headers, params: params).json
181
324
  end
182
325
  alias get_corporations_corporation_id_contacts_labels get_corporation_contact_labels
183
326
 
327
+ # Return custom labels for a corporation's contacts.
328
+ #
329
+ # This endpoint is cached for up to 300 seconds.
330
+ #
331
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
332
+ #
333
+ # @esi_scope esi-corporations.read_contacts.v1
334
+ #
335
+ # @esi_version dev
336
+ # @esi_version legacy
337
+ # @esi_version v1
338
+ #
339
+ # @param corporation_id [Integer] An EVE corporation ID
340
+ # @param params [Hash] Additional query string parameters
341
+ # @param headers [Hash] Additional headers
342
+ #
343
+ # @raise [ESI::Errors::BadRequestError] Bad request
344
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
345
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
346
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
347
+ # @raise [ESI::Errors::InternalServerError] Internal server error
348
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
349
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
350
+ #
351
+ # @see https://esi.evetech.net/ui/#/Contacts/get_corporations_corporation_id_contacts_labels
352
+ def get_corporation_contact_labels_raw(corporation_id:, headers: {}, params: {})
353
+ get("/corporations/#{corporation_id}/contacts/labels/", headers: headers, params: params)
354
+ end
355
+
184
356
  # Return contacts of a corporation.
185
357
  #
186
358
  # This endpoint is cached for up to 300 seconds.
@@ -192,7 +364,7 @@ module ESI
192
364
  # @esi_version dev
193
365
  # @esi_version v2
194
366
  #
195
- # @param corporation_id [Integer,String] An EVE corporation ID
367
+ # @param corporation_id [Integer] An EVE corporation ID
196
368
  # @param params [Hash] Additional query string parameters
197
369
  # @param headers [Hash] Additional headers
198
370
  #
@@ -205,11 +377,40 @@ module ESI
205
377
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
206
378
  #
207
379
  # @see https://esi.evetech.net/ui/#/Contacts/get_corporations_corporation_id_contacts
208
- def get_corporation_contacts(corporation_id:, params: {}, headers: {})
209
- get("/corporations/#{corporation_id}/contacts/", headers: headers, params: params)
380
+ def get_corporation_contacts(corporation_id:, headers: {}, params: {})
381
+ responses = get_corporation_contacts_raw(corporation_id: corporation_id, headers: headers, params: params)
382
+ responses.map(&:json).reduce([], :concat)
210
383
  end
211
384
  alias get_corporations_corporation_id_contacts get_corporation_contacts
212
385
 
386
+ # Return contacts of a corporation.
387
+ #
388
+ # This endpoint is cached for up to 300 seconds.
389
+ #
390
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
391
+ #
392
+ # @esi_scope esi-corporations.read_contacts.v1
393
+ #
394
+ # @esi_version dev
395
+ # @esi_version v2
396
+ #
397
+ # @param corporation_id [Integer] An EVE corporation ID
398
+ # @param params [Hash] Additional query string parameters
399
+ # @param headers [Hash] Additional headers
400
+ #
401
+ # @raise [ESI::Errors::BadRequestError] Bad request
402
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
403
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
404
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
405
+ # @raise [ESI::Errors::InternalServerError] Internal server error
406
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
407
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
408
+ #
409
+ # @see https://esi.evetech.net/ui/#/Contacts/get_corporations_corporation_id_contacts
410
+ def get_corporation_contacts_raw(corporation_id:, headers: {}, params: {})
411
+ get("/corporations/#{corporation_id}/contacts/", headers: headers, params: params)
412
+ end
413
+
213
414
  # Bulk add contacts with same settings.
214
415
  #
215
416
  # This endpoint requires authorization (see {ESI::Client#authorize}).
@@ -219,11 +420,12 @@ module ESI
219
420
  # @esi_version dev
220
421
  # @esi_version v2
221
422
  #
222
- # @param character_id [Integer,String] An EVE character ID
423
+ # @param character_id [Integer] An EVE character ID
223
424
  # @param contact_ids [Array] A list of contacts
224
425
  # @param label_ids [Array] Add custom labels to the new contact
225
426
  # @param standing [Number] Standing for the contact
226
427
  # @param watched [Boolean] Whether the contact should be watched, note this is only effective on characters
428
+ # @param params [Hash] Additional query string parameters
227
429
  # @param headers [Hash] Additional headers
228
430
  #
229
431
  # @raise [ESI::Errors::BadRequestError] Bad request
@@ -236,12 +438,43 @@ module ESI
236
438
  # @raise [ESI::Errors::EveServerError] Internal error thrown from the EVE server
237
439
  #
238
440
  # @see https://esi.evetech.net/ui/#/Contacts/post_characters_character_id_contacts
239
- def post_character_contacts(character_id:, contact_ids:, label_ids:, standing:, watched:, headers: {})
240
- query_string = URI.encode_www_form([["label_ids", label_ids], ["standing", standing], ["watched", watched]])
241
- post("/characters/#{character_id}/contacts/?#{query_string}", headers: headers, payload: contact_ids)
441
+ def post_character_contacts(character_id:, contact_ids:, standing:, label_ids: nil, watched: nil, headers: {}, params: {})
442
+ post_character_contacts_raw(character_id: character_id, contact_ids: contact_ids, label_ids: label_ids, standing: standing, watched: watched, headers: headers, params: params).json
242
443
  end
243
444
  alias post_characters_character_id_contacts post_character_contacts
244
445
 
446
+ # Bulk add contacts with same settings.
447
+ #
448
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
449
+ #
450
+ # @esi_scope esi-characters.write_contacts.v1
451
+ #
452
+ # @esi_version dev
453
+ # @esi_version v2
454
+ #
455
+ # @param character_id [Integer] An EVE character ID
456
+ # @param contact_ids [Array] A list of contacts
457
+ # @param label_ids [Array] Add custom labels to the new contact
458
+ # @param standing [Number] Standing for the contact
459
+ # @param watched [Boolean] Whether the contact should be watched, note this is only effective on characters
460
+ # @param params [Hash] Additional query string parameters
461
+ # @param headers [Hash] Additional headers
462
+ #
463
+ # @raise [ESI::Errors::BadRequestError] Bad request
464
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
465
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
466
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
467
+ # @raise [ESI::Errors::InternalServerError] Internal server error
468
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
469
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
470
+ # @raise [ESI::Errors::EveServerError] Internal error thrown from the EVE server
471
+ #
472
+ # @see https://esi.evetech.net/ui/#/Contacts/post_characters_character_id_contacts
473
+ def post_character_contacts_raw(character_id:, contact_ids:, standing:, label_ids: nil, watched: nil, headers: {}, params: {})
474
+ params.merge!("label_ids" => label_ids, "standing" => standing, "watched" => watched)
475
+ post("/characters/#{character_id}/contacts/", headers: headers, params: params, payload: contact_ids)
476
+ end
477
+
245
478
  # Bulk edit contacts with same settings.
246
479
  #
247
480
  # This endpoint requires authorization (see {ESI::Client#authorize}).
@@ -251,11 +484,12 @@ module ESI
251
484
  # @esi_version dev
252
485
  # @esi_version v2
253
486
  #
254
- # @param character_id [Integer,String] An EVE character ID
487
+ # @param character_id [Integer] An EVE character ID
255
488
  # @param contact_ids [Array] A list of contacts
256
489
  # @param label_ids [Array] Add custom labels to the contact
257
490
  # @param standing [Number] Standing for the contact
258
491
  # @param watched [Boolean] Whether the contact should be watched, note this is only effective on characters
492
+ # @param params [Hash] Additional query string parameters
259
493
  # @param headers [Hash] Additional headers
260
494
  #
261
495
  # @raise [ESI::Errors::BadRequestError] Bad request
@@ -267,11 +501,41 @@ module ESI
267
501
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
268
502
  #
269
503
  # @see https://esi.evetech.net/ui/#/Contacts/put_characters_character_id_contacts
270
- def put_character_contacts(character_id:, contact_ids:, label_ids:, standing:, watched:, headers: {})
271
- query_string = URI.encode_www_form([["label_ids", label_ids], ["standing", standing], ["watched", watched]])
272
- put("/characters/#{character_id}/contacts/?#{query_string}", headers: headers, payload: contact_ids)
504
+ def put_character_contacts(character_id:, contact_ids:, standing:, label_ids: nil, watched: nil, headers: {}, params: {})
505
+ put_character_contacts_raw(character_id: character_id, contact_ids: contact_ids, label_ids: label_ids, standing: standing, watched: watched, headers: headers, params: params).json
273
506
  end
274
507
  alias put_characters_character_id_contacts put_character_contacts
508
+
509
+ # Bulk edit contacts with same settings.
510
+ #
511
+ # This endpoint requires authorization (see {ESI::Client#authorize}).
512
+ #
513
+ # @esi_scope esi-characters.write_contacts.v1
514
+ #
515
+ # @esi_version dev
516
+ # @esi_version v2
517
+ #
518
+ # @param character_id [Integer] An EVE character ID
519
+ # @param contact_ids [Array] A list of contacts
520
+ # @param label_ids [Array] Add custom labels to the contact
521
+ # @param standing [Number] Standing for the contact
522
+ # @param watched [Boolean] Whether the contact should be watched, note this is only effective on characters
523
+ # @param params [Hash] Additional query string parameters
524
+ # @param headers [Hash] Additional headers
525
+ #
526
+ # @raise [ESI::Errors::BadRequestError] Bad request
527
+ # @raise [ESI::Errors::UnauthorizedError] Unauthorized
528
+ # @raise [ESI::Errors::ForbiddenError] Forbidden
529
+ # @raise [ESI::Errors::ErrorLimitedError] Error limited
530
+ # @raise [ESI::Errors::InternalServerError] Internal server error
531
+ # @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
532
+ # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
533
+ #
534
+ # @see https://esi.evetech.net/ui/#/Contacts/put_characters_character_id_contacts
535
+ def put_character_contacts_raw(character_id:, contact_ids:, standing:, label_ids: nil, watched: nil, headers: {}, params: {})
536
+ params.merge!("label_ids" => label_ids, "standing" => standing, "watched" => watched)
537
+ put("/characters/#{character_id}/contacts/", headers: headers, params: params, payload: contact_ids)
538
+ end
275
539
  end
276
540
  end
277
541
  end