kleister 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +18 -0
  3. data/CONTRIBUTING.md +121 -0
  4. data/DCO +34 -0
  5. data/LICENSE +202 -0
  6. data/README.md +67 -0
  7. data/lib/kleister/api/auth_api.rb +331 -0
  8. data/lib/kleister/api/fabric_api.rb +367 -0
  9. data/lib/kleister/api/forge_api.rb +367 -0
  10. data/lib/kleister/api/minecraft_api.rb +367 -0
  11. data/lib/kleister/api/mod_api.rb +1603 -0
  12. data/lib/kleister/api/neoforge_api.rb +367 -0
  13. data/lib/kleister/api/pack_api.rb +1603 -0
  14. data/lib/kleister/api/profile_api.rb +198 -0
  15. data/lib/kleister/api/quilt_api.rb +367 -0
  16. data/lib/kleister/api/team_api.rb +1283 -0
  17. data/lib/kleister/api/user_api.rb +1283 -0
  18. data/lib/kleister/api_client.rb +429 -0
  19. data/lib/kleister/api_error.rb +56 -0
  20. data/lib/kleister/configuration.rb +397 -0
  21. data/lib/kleister/models/auth_login.rb +231 -0
  22. data/lib/kleister/models/auth_token.rb +227 -0
  23. data/lib/kleister/models/auth_verify.rb +227 -0
  24. data/lib/kleister/models/build.rb +365 -0
  25. data/lib/kleister/models/build_version.rb +261 -0
  26. data/lib/kleister/models/build_version_params.rb +233 -0
  27. data/lib/kleister/models/build_versions.rb +235 -0
  28. data/lib/kleister/models/builds.rb +227 -0
  29. data/lib/kleister/models/fabric.rb +235 -0
  30. data/lib/kleister/models/fabric_build_params.rb +233 -0
  31. data/lib/kleister/models/fabric_builds.rb +228 -0
  32. data/lib/kleister/models/fabrics.rb +220 -0
  33. data/lib/kleister/models/forge.rb +243 -0
  34. data/lib/kleister/models/forge_build_params.rb +233 -0
  35. data/lib/kleister/models/forge_builds.rb +227 -0
  36. data/lib/kleister/models/forges.rb +220 -0
  37. data/lib/kleister/models/minecraft.rb +243 -0
  38. data/lib/kleister/models/minecraft_build_params.rb +233 -0
  39. data/lib/kleister/models/minecraft_builds.rb +228 -0
  40. data/lib/kleister/models/minecrafts.rb +220 -0
  41. data/lib/kleister/models/mod.rb +350 -0
  42. data/lib/kleister/models/mod_team_params.rb +265 -0
  43. data/lib/kleister/models/mod_teams.rb +227 -0
  44. data/lib/kleister/models/mod_user_params.rb +265 -0
  45. data/lib/kleister/models/mod_users.rb +227 -0
  46. data/lib/kleister/models/mods.rb +220 -0
  47. data/lib/kleister/models/neoforge.rb +243 -0
  48. data/lib/kleister/models/neoforge_build_params.rb +233 -0
  49. data/lib/kleister/models/neoforge_builds.rb +228 -0
  50. data/lib/kleister/models/neoforges.rb +220 -0
  51. data/lib/kleister/models/notification.rb +228 -0
  52. data/lib/kleister/models/pack.rb +334 -0
  53. data/lib/kleister/models/pack_back.rb +289 -0
  54. data/lib/kleister/models/pack_icon.rb +289 -0
  55. data/lib/kleister/models/pack_logo.rb +289 -0
  56. data/lib/kleister/models/pack_team_params.rb +265 -0
  57. data/lib/kleister/models/pack_teams.rb +227 -0
  58. data/lib/kleister/models/pack_user_params.rb +265 -0
  59. data/lib/kleister/models/pack_users.rb +227 -0
  60. data/lib/kleister/models/packs.rb +220 -0
  61. data/lib/kleister/models/profile.rb +313 -0
  62. data/lib/kleister/models/quilt.rb +235 -0
  63. data/lib/kleister/models/quilt_build_params.rb +233 -0
  64. data/lib/kleister/models/quilt_builds.rb +227 -0
  65. data/lib/kleister/models/quilts.rb +220 -0
  66. data/lib/kleister/models/team.rb +267 -0
  67. data/lib/kleister/models/team_mod.rb +304 -0
  68. data/lib/kleister/models/team_mod_params.rb +265 -0
  69. data/lib/kleister/models/team_mods.rb +227 -0
  70. data/lib/kleister/models/team_pack.rb +304 -0
  71. data/lib/kleister/models/team_pack_params.rb +265 -0
  72. data/lib/kleister/models/team_packs.rb +227 -0
  73. data/lib/kleister/models/team_user_params.rb +265 -0
  74. data/lib/kleister/models/team_users.rb +227 -0
  75. data/lib/kleister/models/teams.rb +220 -0
  76. data/lib/kleister/models/user.rb +315 -0
  77. data/lib/kleister/models/user_auth.rb +234 -0
  78. data/lib/kleister/models/user_mod.rb +304 -0
  79. data/lib/kleister/models/user_mod_params.rb +265 -0
  80. data/lib/kleister/models/user_mods.rb +227 -0
  81. data/lib/kleister/models/user_pack.rb +304 -0
  82. data/lib/kleister/models/user_pack_params.rb +265 -0
  83. data/lib/kleister/models/user_packs.rb +227 -0
  84. data/lib/kleister/models/user_team.rb +304 -0
  85. data/lib/kleister/models/user_team_params.rb +265 -0
  86. data/lib/kleister/models/user_teams.rb +227 -0
  87. data/lib/kleister/models/users.rb +220 -0
  88. data/lib/kleister/models/validation.rb +220 -0
  89. data/lib/kleister/models/version.rb +280 -0
  90. data/lib/kleister/models/version_build_params.rb +233 -0
  91. data/lib/kleister/models/version_builds.rb +235 -0
  92. data/lib/kleister/models/version_file.rb +289 -0
  93. data/lib/kleister/models/versions.rb +227 -0
  94. data/lib/kleister/version.rb +13 -0
  95. data/lib/kleister.rb +121 -0
  96. metadata +180 -0
@@ -0,0 +1,331 @@
1
+ # Kleister OpenAPI
2
+ #
3
+ # API definition for Kleister, manage mod packs for Minecraft
4
+ #
5
+ # The version of the OpenAPI document: 1.0.0-alpha1
6
+ # Contact: kleister@webhippie.de
7
+ # Generated by: https://openapi-generator.tech
8
+ # Generator version: 7.6.0
9
+ #
10
+
11
+ require 'cgi'
12
+
13
+ module Kleister
14
+ class AuthApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+
21
+ # Callback for external authentication
22
+ # @param provider [String] An identifier for the auth provider
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [String] :state Auth state
25
+ # @option opts [String] :code Auth code
26
+ # @return [Notification]
27
+ def external_callback(provider, opts = {})
28
+ data, _status_code, _headers = external_callback_with_http_info(provider, opts)
29
+ data
30
+ end
31
+
32
+ # Callback for external authentication
33
+ # @param provider [String] An identifier for the auth provider
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :state Auth state
36
+ # @option opts [String] :code Auth code
37
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
38
+ def external_callback_with_http_info(provider, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug 'Calling API: AuthApi.external_callback ...'
41
+ end
42
+ # verify the required parameter 'provider' is set
43
+ if @api_client.config.client_side_validation && provider.nil?
44
+ raise ArgumentError, "Missing the required parameter 'provider' when calling AuthApi.external_callback"
45
+ end
46
+
47
+ # resource path
48
+ local_var_path = '/auth/{provider}/callback'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+ query_params[:state] = opts[:state] unless opts[:state].nil?
53
+ query_params[:code] = opts[:code] unless opts[:code].nil?
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body]
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'Notification'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || []
71
+
72
+ new_options = opts.merge(
73
+ operation: :'AuthApi.external_callback',
74
+ header_params: header_params,
75
+ query_params: query_params,
76
+ form_params: form_params,
77
+ body: post_body,
78
+ auth_names: auth_names,
79
+ return_type: return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: AuthApi#external_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ [data, status_code, headers]
87
+ end
88
+
89
+ # Initialize the external authentication
90
+ # @param provider [String] An identifier for the auth provider
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :state Auth state
93
+ # @return [Notification]
94
+ def external_initialize(provider, opts = {})
95
+ data, _status_code, _headers = external_initialize_with_http_info(provider, opts)
96
+ data
97
+ end
98
+
99
+ # Initialize the external authentication
100
+ # @param provider [String] An identifier for the auth provider
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [String] :state Auth state
103
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
104
+ def external_initialize_with_http_info(provider, opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: AuthApi.external_initialize ...'
107
+ end
108
+ # verify the required parameter 'provider' is set
109
+ if @api_client.config.client_side_validation && provider.nil?
110
+ raise ArgumentError, "Missing the required parameter 'provider' when calling AuthApi.external_initialize"
111
+ end
112
+
113
+ # resource path
114
+ local_var_path = '/auth/{provider}/initialize'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+ query_params[:state] = opts[:state] unless opts[:state].nil?
119
+
120
+ # header parameters
121
+ header_params = opts[:header_params] || {}
122
+ # HTTP header 'Accept' (if needed)
123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body]
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type] || 'Notification'
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || []
136
+
137
+ new_options = opts.merge(
138
+ operation: :'AuthApi.external_initialize',
139
+ header_params: header_params,
140
+ query_params: query_params,
141
+ form_params: form_params,
142
+ body: post_body,
143
+ auth_names: auth_names,
144
+ return_type: return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: AuthApi#external_initialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ [data, status_code, headers]
152
+ end
153
+
154
+ # Authenticate an user by credentials
155
+ # @param auth_login [AuthLogin] The credentials to authenticate
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [AuthToken]
158
+ def login_auth(auth_login, opts = {})
159
+ data, _status_code, _headers = login_auth_with_http_info(auth_login, opts)
160
+ data
161
+ end
162
+
163
+ # Authenticate an user by credentials
164
+ # @param auth_login [AuthLogin] The credentials to authenticate
165
+ # @param [Hash] opts the optional parameters
166
+ # @return [Array<(AuthToken, Integer, Hash)>] AuthToken data, response status code and response headers
167
+ def login_auth_with_http_info(auth_login, opts = {})
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug 'Calling API: AuthApi.login_auth ...'
170
+ end
171
+ # verify the required parameter 'auth_login' is set
172
+ if @api_client.config.client_side_validation && auth_login.nil?
173
+ raise ArgumentError, "Missing the required parameter 'auth_login' when calling AuthApi.login_auth"
174
+ end
175
+
176
+ # resource path
177
+ local_var_path = '/auth/login'
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
186
+ # HTTP header 'Content-Type'
187
+ content_type = @api_client.select_header_content_type(['application/json'])
188
+ unless content_type.nil?
189
+ header_params['Content-Type'] = content_type
190
+ end
191
+
192
+ # form parameters
193
+ form_params = opts[:form_params] || {}
194
+
195
+ # http body (model)
196
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(auth_login)
197
+
198
+ # return_type
199
+ return_type = opts[:debug_return_type] || 'AuthToken'
200
+
201
+ # auth_names
202
+ auth_names = opts[:debug_auth_names] || []
203
+
204
+ new_options = opts.merge(
205
+ operation: :'AuthApi.login_auth',
206
+ header_params: header_params,
207
+ query_params: query_params,
208
+ form_params: form_params,
209
+ body: post_body,
210
+ auth_names: auth_names,
211
+ return_type: return_type
212
+ )
213
+
214
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
215
+ if @api_client.config.debugging
216
+ @api_client.config.logger.debug "API called: AuthApi#login_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
+ end
218
+ [data, status_code, headers]
219
+ end
220
+
221
+ # Refresh an auth token before it expires
222
+ # @param [Hash] opts the optional parameters
223
+ # @return [AuthToken]
224
+ def refresh_auth(opts = {})
225
+ data, _status_code, _headers = refresh_auth_with_http_info(opts)
226
+ data
227
+ end
228
+
229
+ # Refresh an auth token before it expires
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [Array<(AuthToken, Integer, Hash)>] AuthToken data, response status code and response headers
232
+ def refresh_auth_with_http_info(opts = {})
233
+ if @api_client.config.debugging
234
+ @api_client.config.logger.debug 'Calling API: AuthApi.refresh_auth ...'
235
+ end
236
+ # resource path
237
+ local_var_path = '/auth/refresh'
238
+
239
+ # query parameters
240
+ query_params = opts[:query_params] || {}
241
+
242
+ # header parameters
243
+ header_params = opts[:header_params] || {}
244
+ # HTTP header 'Accept' (if needed)
245
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
246
+
247
+ # form parameters
248
+ form_params = opts[:form_params] || {}
249
+
250
+ # http body (model)
251
+ post_body = opts[:debug_body]
252
+
253
+ # return_type
254
+ return_type = opts[:debug_return_type] || 'AuthToken'
255
+
256
+ # auth_names
257
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
258
+
259
+ new_options = opts.merge(
260
+ operation: :'AuthApi.refresh_auth',
261
+ header_params: header_params,
262
+ query_params: query_params,
263
+ form_params: form_params,
264
+ body: post_body,
265
+ auth_names: auth_names,
266
+ return_type: return_type
267
+ )
268
+
269
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug "API called: AuthApi#refresh_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
+ end
273
+ [data, status_code, headers]
274
+ end
275
+
276
+ # Verify validity for an authentication token
277
+ # @param [Hash] opts the optional parameters
278
+ # @return [AuthVerify]
279
+ def verify_auth(opts = {})
280
+ data, _status_code, _headers = verify_auth_with_http_info(opts)
281
+ data
282
+ end
283
+
284
+ # Verify validity for an authentication token
285
+ # @param [Hash] opts the optional parameters
286
+ # @return [Array<(AuthVerify, Integer, Hash)>] AuthVerify data, response status code and response headers
287
+ def verify_auth_with_http_info(opts = {})
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug 'Calling API: AuthApi.verify_auth ...'
290
+ end
291
+ # resource path
292
+ local_var_path = '/auth/verify'
293
+
294
+ # query parameters
295
+ query_params = opts[:query_params] || {}
296
+
297
+ # header parameters
298
+ header_params = opts[:header_params] || {}
299
+ # HTTP header 'Accept' (if needed)
300
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
301
+
302
+ # form parameters
303
+ form_params = opts[:form_params] || {}
304
+
305
+ # http body (model)
306
+ post_body = opts[:debug_body]
307
+
308
+ # return_type
309
+ return_type = opts[:debug_return_type] || 'AuthVerify'
310
+
311
+ # auth_names
312
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
313
+
314
+ new_options = opts.merge(
315
+ operation: :'AuthApi.verify_auth',
316
+ header_params: header_params,
317
+ query_params: query_params,
318
+ form_params: form_params,
319
+ body: post_body,
320
+ auth_names: auth_names,
321
+ return_type: return_type
322
+ )
323
+
324
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
325
+ if @api_client.config.debugging
326
+ @api_client.config.logger.debug "API called: AuthApi#verify_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
327
+ end
328
+ [data, status_code, headers]
329
+ end
330
+ end
331
+ end
@@ -0,0 +1,367 @@
1
+ # Kleister OpenAPI
2
+ #
3
+ # API definition for Kleister, manage mod packs for Minecraft
4
+ #
5
+ # The version of the OpenAPI document: 1.0.0-alpha1
6
+ # Contact: kleister@webhippie.de
7
+ # Generated by: https://openapi-generator.tech
8
+ # Generator version: 7.6.0
9
+ #
10
+
11
+ require 'cgi'
12
+
13
+ module Kleister
14
+ class FabricApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+
21
+ # Attach a build to a Fabric version
22
+ # @param fabric_id [String] A fabric identifier or slug
23
+ # @param fabric_build_params [FabricBuildParams] The build data to attach
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Notification]
26
+ def attach_fabric_to_build(fabric_id, fabric_build_params, opts = {})
27
+ data, _status_code, _headers = attach_fabric_to_build_with_http_info(fabric_id, fabric_build_params, opts)
28
+ data
29
+ end
30
+
31
+ # Attach a build to a Fabric version
32
+ # @param fabric_id [String] A fabric identifier or slug
33
+ # @param fabric_build_params [FabricBuildParams] The build data to attach
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
36
+ def attach_fabric_to_build_with_http_info(fabric_id, fabric_build_params, opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: FabricApi.attach_fabric_to_build ...'
39
+ end
40
+ # verify the required parameter 'fabric_id' is set
41
+ if @api_client.config.client_side_validation && fabric_id.nil?
42
+ raise ArgumentError, "Missing the required parameter 'fabric_id' when calling FabricApi.attach_fabric_to_build"
43
+ end
44
+ # verify the required parameter 'fabric_build_params' is set
45
+ if @api_client.config.client_side_validation && fabric_build_params.nil?
46
+ raise ArgumentError, "Missing the required parameter 'fabric_build_params' when calling FabricApi.attach_fabric_to_build"
47
+ end
48
+
49
+ # resource path
50
+ local_var_path = '/fabric/{fabric_id}/builds'.sub('{' + 'fabric_id' + '}', CGI.escape(fabric_id.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ content_type = @api_client.select_header_content_type(['application/json'])
61
+ unless content_type.nil?
62
+ header_params['Content-Type'] = content_type
63
+ end
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(fabric_build_params)
70
+
71
+ # return_type
72
+ return_type = opts[:debug_return_type] || 'Notification'
73
+
74
+ # auth_names
75
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
76
+
77
+ new_options = opts.merge(
78
+ operation: :'FabricApi.attach_fabric_to_build',
79
+ header_params: header_params,
80
+ query_params: query_params,
81
+ form_params: form_params,
82
+ body: post_body,
83
+ auth_names: auth_names,
84
+ return_type: return_type
85
+ )
86
+
87
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: FabricApi#attach_fabric_to_build\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ [data, status_code, headers]
92
+ end
93
+
94
+ # Unlink a build from a Fabric version
95
+ # @param fabric_id [String] A fabric identifier or slug
96
+ # @param fabric_build_params [FabricBuildParams] The build data to unlink
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Notification]
99
+ def delete_fabric_from_build(fabric_id, fabric_build_params, opts = {})
100
+ data, _status_code, _headers = delete_fabric_from_build_with_http_info(fabric_id, fabric_build_params, opts)
101
+ data
102
+ end
103
+
104
+ # Unlink a build from a Fabric version
105
+ # @param fabric_id [String] A fabric identifier or slug
106
+ # @param fabric_build_params [FabricBuildParams] The build data to unlink
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
109
+ def delete_fabric_from_build_with_http_info(fabric_id, fabric_build_params, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: FabricApi.delete_fabric_from_build ...'
112
+ end
113
+ # verify the required parameter 'fabric_id' is set
114
+ if @api_client.config.client_side_validation && fabric_id.nil?
115
+ raise ArgumentError, "Missing the required parameter 'fabric_id' when calling FabricApi.delete_fabric_from_build"
116
+ end
117
+ # verify the required parameter 'fabric_build_params' is set
118
+ if @api_client.config.client_side_validation && fabric_build_params.nil?
119
+ raise ArgumentError, "Missing the required parameter 'fabric_build_params' when calling FabricApi.delete_fabric_from_build"
120
+ end
121
+
122
+ # resource path
123
+ local_var_path = '/fabric/{fabric_id}/builds'.sub('{' + 'fabric_id' + '}', CGI.escape(fabric_id.to_s))
124
+
125
+ # query parameters
126
+ query_params = opts[:query_params] || {}
127
+
128
+ # header parameters
129
+ header_params = opts[:header_params] || {}
130
+ # HTTP header 'Accept' (if needed)
131
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
132
+ # HTTP header 'Content-Type'
133
+ content_type = @api_client.select_header_content_type(['application/json'])
134
+ unless content_type.nil?
135
+ header_params['Content-Type'] = content_type
136
+ end
137
+
138
+ # form parameters
139
+ form_params = opts[:form_params] || {}
140
+
141
+ # http body (model)
142
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(fabric_build_params)
143
+
144
+ # return_type
145
+ return_type = opts[:debug_return_type] || 'Notification'
146
+
147
+ # auth_names
148
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
149
+
150
+ new_options = opts.merge(
151
+ operation: :'FabricApi.delete_fabric_from_build',
152
+ header_params: header_params,
153
+ query_params: query_params,
154
+ form_params: form_params,
155
+ body: post_body,
156
+ auth_names: auth_names,
157
+ return_type: return_type
158
+ )
159
+
160
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug "API called: FabricApi#delete_fabric_from_build\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
163
+ end
164
+ [data, status_code, headers]
165
+ end
166
+
167
+ # Fetch the builds attached to a Fabric version
168
+ # @param fabric_id [String] A fabric identifier or slug
169
+ # @param [Hash] opts the optional parameters
170
+ # @option opts [String] :search Search query
171
+ # @option opts [String] :sort Sorting column (default to 'name')
172
+ # @option opts [String] :order Sorting order (default to 'asc')
173
+ # @option opts [Integer] :limit Paging limit (default to 100)
174
+ # @option opts [Integer] :offset Paging offset (default to 0)
175
+ # @return [FabricBuilds]
176
+ def list_fabric_builds(fabric_id, opts = {})
177
+ data, _status_code, _headers = list_fabric_builds_with_http_info(fabric_id, opts)
178
+ data
179
+ end
180
+
181
+ # Fetch the builds attached to a Fabric version
182
+ # @param fabric_id [String] A fabric identifier or slug
183
+ # @param [Hash] opts the optional parameters
184
+ # @option opts [String] :search Search query
185
+ # @option opts [String] :sort Sorting column (default to 'name')
186
+ # @option opts [String] :order Sorting order (default to 'asc')
187
+ # @option opts [Integer] :limit Paging limit (default to 100)
188
+ # @option opts [Integer] :offset Paging offset (default to 0)
189
+ # @return [Array<(FabricBuilds, Integer, Hash)>] FabricBuilds data, response status code and response headers
190
+ def list_fabric_builds_with_http_info(fabric_id, opts = {})
191
+ if @api_client.config.debugging
192
+ @api_client.config.logger.debug 'Calling API: FabricApi.list_fabric_builds ...'
193
+ end
194
+ # verify the required parameter 'fabric_id' is set
195
+ if @api_client.config.client_side_validation && fabric_id.nil?
196
+ raise ArgumentError, "Missing the required parameter 'fabric_id' when calling FabricApi.list_fabric_builds"
197
+ end
198
+
199
+ allowable_values = %w[name public]
200
+ if @api_client.config.client_side_validation && opts[:sort] && !allowable_values.include?(opts[:sort])
201
+ raise ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
202
+ end
203
+
204
+ allowable_values = %w[asc desc]
205
+ if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
206
+ raise ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
207
+ end
208
+
209
+ # resource path
210
+ local_var_path = '/fabric/{fabric_id}/builds'.sub('{' + 'fabric_id' + '}', CGI.escape(fabric_id.to_s))
211
+
212
+ # query parameters
213
+ query_params = opts[:query_params] || {}
214
+ query_params[:search] = opts[:search] unless opts[:search].nil?
215
+ query_params[:sort] = opts[:sort] unless opts[:sort].nil?
216
+ query_params[:order] = opts[:order] unless opts[:order].nil?
217
+ query_params[:limit] = opts[:limit] unless opts[:limit].nil?
218
+ query_params[:offset] = opts[:offset] unless opts[:offset].nil?
219
+
220
+ # header parameters
221
+ header_params = opts[:header_params] || {}
222
+ # HTTP header 'Accept' (if needed)
223
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
224
+
225
+ # form parameters
226
+ form_params = opts[:form_params] || {}
227
+
228
+ # http body (model)
229
+ post_body = opts[:debug_body]
230
+
231
+ # return_type
232
+ return_type = opts[:debug_return_type] || 'FabricBuilds'
233
+
234
+ # auth_names
235
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
236
+
237
+ new_options = opts.merge(
238
+ operation: :'FabricApi.list_fabric_builds',
239
+ header_params: header_params,
240
+ query_params: query_params,
241
+ form_params: form_params,
242
+ body: post_body,
243
+ auth_names: auth_names,
244
+ return_type: return_type
245
+ )
246
+
247
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug "API called: FabricApi#list_fabric_builds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
250
+ end
251
+ [data, status_code, headers]
252
+ end
253
+
254
+ # Fetch the available Fabric versions
255
+ # @param [Hash] opts the optional parameters
256
+ # @option opts [String] :search Search query
257
+ # @return [Fabrics]
258
+ def list_fabrics(opts = {})
259
+ data, _status_code, _headers = list_fabrics_with_http_info(opts)
260
+ data
261
+ end
262
+
263
+ # Fetch the available Fabric versions
264
+ # @param [Hash] opts the optional parameters
265
+ # @option opts [String] :search Search query
266
+ # @return [Array<(Fabrics, Integer, Hash)>] Fabrics data, response status code and response headers
267
+ def list_fabrics_with_http_info(opts = {})
268
+ if @api_client.config.debugging
269
+ @api_client.config.logger.debug 'Calling API: FabricApi.list_fabrics ...'
270
+ end
271
+ # resource path
272
+ local_var_path = '/fabric'
273
+
274
+ # query parameters
275
+ query_params = opts[:query_params] || {}
276
+ query_params[:search] = opts[:search] unless opts[:search].nil?
277
+
278
+ # header parameters
279
+ header_params = opts[:header_params] || {}
280
+ # HTTP header 'Accept' (if needed)
281
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
282
+
283
+ # form parameters
284
+ form_params = opts[:form_params] || {}
285
+
286
+ # http body (model)
287
+ post_body = opts[:debug_body]
288
+
289
+ # return_type
290
+ return_type = opts[:debug_return_type] || 'Fabrics'
291
+
292
+ # auth_names
293
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
294
+
295
+ new_options = opts.merge(
296
+ operation: :'FabricApi.list_fabrics',
297
+ header_params: header_params,
298
+ query_params: query_params,
299
+ form_params: form_params,
300
+ body: post_body,
301
+ auth_names: auth_names,
302
+ return_type: return_type
303
+ )
304
+
305
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug "API called: FabricApi#list_fabrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
308
+ end
309
+ [data, status_code, headers]
310
+ end
311
+
312
+ # Update the available Fabric versions
313
+ # @param [Hash] opts the optional parameters
314
+ # @return [Notification]
315
+ def update_fabric(opts = {})
316
+ data, _status_code, _headers = update_fabric_with_http_info(opts)
317
+ data
318
+ end
319
+
320
+ # Update the available Fabric versions
321
+ # @param [Hash] opts the optional parameters
322
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
323
+ def update_fabric_with_http_info(opts = {})
324
+ if @api_client.config.debugging
325
+ @api_client.config.logger.debug 'Calling API: FabricApi.update_fabric ...'
326
+ end
327
+ # resource path
328
+ local_var_path = '/fabric'
329
+
330
+ # query parameters
331
+ query_params = opts[:query_params] || {}
332
+
333
+ # header parameters
334
+ header_params = opts[:header_params] || {}
335
+ # HTTP header 'Accept' (if needed)
336
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
337
+
338
+ # form parameters
339
+ form_params = opts[:form_params] || {}
340
+
341
+ # http body (model)
342
+ post_body = opts[:debug_body]
343
+
344
+ # return_type
345
+ return_type = opts[:debug_return_type] || 'Notification'
346
+
347
+ # auth_names
348
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]
349
+
350
+ new_options = opts.merge(
351
+ operation: :'FabricApi.update_fabric',
352
+ header_params: header_params,
353
+ query_params: query_params,
354
+ form_params: form_params,
355
+ body: post_body,
356
+ auth_names: auth_names,
357
+ return_type: return_type
358
+ )
359
+
360
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
361
+ if @api_client.config.debugging
362
+ @api_client.config.logger.debug "API called: FabricApi#update_fabric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
363
+ end
364
+ [data, status_code, headers]
365
+ end
366
+ end
367
+ end