Class: Kleister::ForgeApi

Inherits:
Object
  • Object
show all
Defined in:
lib/kleister/api/forge_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ForgeApi

Returns a new instance of ForgeApi.



17
18
19
# File 'lib/kleister/api/forge_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/kleister/api/forge_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#attach_forge_to_build(forge_id, forge_build_params, opts = {}) ⇒ Notification

Attach a build to a Forge version

Parameters:

  • forge_id (String)

    A forge identifier or slug

  • forge_build_params (ForgeBuildParams)

    The build data to attach

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



26
27
28
29
# File 'lib/kleister/api/forge_api.rb', line 26

def attach_forge_to_build(forge_id, forge_build_params, opts = {})
  data, _status_code, _headers = attach_forge_to_build_with_http_info(forge_id, forge_build_params, opts)
  data
end

#attach_forge_to_build_with_http_info(forge_id, forge_build_params, opts = {}) ⇒ Array<(Notification, Integer, Hash)>

Attach a build to a Forge version

Parameters:

  • forge_id (String)

    A forge identifier or slug

  • forge_build_params (ForgeBuildParams)

    The build data to attach

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Notification, Integer, Hash)>)

    Notification data, response status code and response headers



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
# File 'lib/kleister/api/forge_api.rb', line 36

def attach_forge_to_build_with_http_info(forge_id, forge_build_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ForgeApi.attach_forge_to_build ...'
  end
  # verify the required parameter 'forge_id' is set
  if @api_client.config.client_side_validation && forge_id.nil?
    raise ArgumentError, "Missing the required parameter 'forge_id' when calling ForgeApi.attach_forge_to_build"
  end
  # verify the required parameter 'forge_build_params' is set
  if @api_client.config.client_side_validation && forge_build_params.nil?
    raise ArgumentError, "Missing the required parameter 'forge_build_params' when calling ForgeApi.attach_forge_to_build"
  end

  # resource path
  local_var_path = '/forge/{forge_id}/builds'.sub('{' + 'forge_id' + '}', CGI.escape(forge_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(forge_build_params)

  # return_type
  return_type = opts[:debug_return_type] || 'Notification'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ForgeApi.attach_forge_to_build',
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ForgeApi#attach_forge_to_build\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#delete_forge_from_build(forge_id, forge_build_params, opts = {}) ⇒ Notification

Unlink a build from a Forge version

Parameters:

  • forge_id (String)

    A forge identifier or slug

  • forge_build_params (ForgeBuildParams)

    The build data to unlink

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



99
100
101
102
# File 'lib/kleister/api/forge_api.rb', line 99

def delete_forge_from_build(forge_id, forge_build_params, opts = {})
  data, _status_code, _headers = delete_forge_from_build_with_http_info(forge_id, forge_build_params, opts)
  data
end

#delete_forge_from_build_with_http_info(forge_id, forge_build_params, opts = {}) ⇒ Array<(Notification, Integer, Hash)>

Unlink a build from a Forge version

Parameters:

  • forge_id (String)

    A forge identifier or slug

  • forge_build_params (ForgeBuildParams)

    The build data to unlink

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Notification, Integer, Hash)>)

    Notification data, response status code and response headers



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
# File 'lib/kleister/api/forge_api.rb', line 109

def delete_forge_from_build_with_http_info(forge_id, forge_build_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ForgeApi.delete_forge_from_build ...'
  end
  # verify the required parameter 'forge_id' is set
  if @api_client.config.client_side_validation && forge_id.nil?
    raise ArgumentError, "Missing the required parameter 'forge_id' when calling ForgeApi.delete_forge_from_build"
  end
  # verify the required parameter 'forge_build_params' is set
  if @api_client.config.client_side_validation && forge_build_params.nil?
    raise ArgumentError, "Missing the required parameter 'forge_build_params' when calling ForgeApi.delete_forge_from_build"
  end

  # resource path
  local_var_path = '/forge/{forge_id}/builds'.sub('{' + 'forge_id' + '}', CGI.escape(forge_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(forge_build_params)

  # return_type
  return_type = opts[:debug_return_type] || 'Notification'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ForgeApi.delete_forge_from_build',
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ForgeApi#delete_forge_from_build\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#list_forge_builds(forge_id, opts = {}) ⇒ ForgeBuilds

Fetch the builds attached to a Forge version

Parameters:

  • forge_id (String)

    A forge identifier or slug

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search query

  • :sort (String)

    Sorting column (default to ‘build_name’)

  • :order (String)

    Sorting order (default to ‘asc’)

  • :limit (Integer)

    Paging limit (default to 100)

  • :offset (Integer)

    Paging offset (default to 0)

Returns:



176
177
178
179
# File 'lib/kleister/api/forge_api.rb', line 176

def list_forge_builds(forge_id, opts = {})
  data, _status_code, _headers = list_forge_builds_with_http_info(forge_id, opts)
  data
end

#list_forge_builds_with_http_info(forge_id, opts = {}) ⇒ Array<(ForgeBuilds, Integer, Hash)>

Fetch the builds attached to a Forge version

Parameters:

  • forge_id (String)

    A forge identifier or slug

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search query

  • :sort (String)

    Sorting column (default to ‘build_name’)

  • :order (String)

    Sorting order (default to ‘asc’)

  • :limit (Integer)

    Paging limit (default to 100)

  • :offset (Integer)

    Paging offset (default to 0)

Returns:

  • (Array<(ForgeBuilds, Integer, Hash)>)

    ForgeBuilds data, response status code and response headers



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
# File 'lib/kleister/api/forge_api.rb', line 190

def list_forge_builds_with_http_info(forge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ForgeApi.list_forge_builds ...'
  end
  # verify the required parameter 'forge_id' is set
  if @api_client.config.client_side_validation && forge_id.nil?
    raise ArgumentError, "Missing the required parameter 'forge_id' when calling ForgeApi.list_forge_builds"
  end

  allowable_values = %w[build_name build_public pack_slug pack_name]
  if @api_client.config.client_side_validation && opts[:sort] && !allowable_values.include?(opts[:sort])
    raise ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end

  allowable_values = %w[asc desc]
  if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
    raise ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end

  # resource path
  local_var_path = '/forge/{forge_id}/builds'.sub('{' + 'forge_id' + '}', CGI.escape(forge_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:search] = opts[:search] unless opts[:search].nil?
  query_params[:sort] = opts[:sort] unless opts[:sort].nil?
  query_params[:order] = opts[:order] unless opts[:order].nil?
  query_params[:limit] = opts[:limit] unless opts[:limit].nil?
  query_params[:offset] = opts[:offset] unless opts[:offset].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ForgeBuilds'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ForgeApi.list_forge_builds',
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ForgeApi#list_forge_builds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#list_forges(opts = {}) ⇒ Forges

Fetch the available Forge versions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search query

Returns:



258
259
260
261
# File 'lib/kleister/api/forge_api.rb', line 258

def list_forges(opts = {})
  data, _status_code, _headers = list_forges_with_http_info(opts)
  data
end

#list_forges_with_http_info(opts = {}) ⇒ Array<(Forges, Integer, Hash)>

Fetch the available Forge versions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search query

Returns:

  • (Array<(Forges, Integer, Hash)>)

    Forges data, response status code and response headers



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/kleister/api/forge_api.rb', line 267

def list_forges_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ForgeApi.list_forges ...'
  end
  # resource path
  local_var_path = '/forge'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:search] = opts[:search] unless opts[:search].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Forges'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ForgeApi.list_forges',
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ForgeApi#list_forges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#update_forge(opts = {}) ⇒ Notification

Update the available Forge versions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



315
316
317
318
# File 'lib/kleister/api/forge_api.rb', line 315

def update_forge(opts = {})
  data, _status_code, _headers = update_forge_with_http_info(opts)
  data
end

#update_forge_with_http_info(opts = {}) ⇒ Array<(Notification, Integer, Hash)>

Update the available Forge versions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Notification, Integer, Hash)>)

    Notification data, response status code and response headers



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/kleister/api/forge_api.rb', line 323

def update_forge_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ForgeApi.update_forge ...'
  end
  # resource path
  local_var_path = '/forge'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Notification'

  # auth_names
  auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header Bearer]

  new_options = opts.merge(
    operation: :'ForgeApi.update_forge',
    header_params: header_params,
    query_params: query_params,
    form_params: form_params,
    body: post_body,
    auth_names: auth_names,
    return_type: return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ForgeApi#update_forge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end