Class: SamplifyAPIClient::ProjectsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/samplify_api_client/api/projects_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProjectsApi

Returns a new instance of ProjectsApi.



19
20
21
# File 'lib/samplify_api_client/api/projects_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/samplify_api_client/api/projects_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#projects_buy(ext_project_id, payload, opts = {}) ⇒ BuyProject

buy projects

Parameters:

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/samplify_api_client/api/projects_api.rb', line 27

def projects_buy(ext_project_id, payload, opts = {})
  data, _status_code, _headers = projects_buy_with_http_info(ext_project_id, payload, opts)
  data
end

#projects_buy_with_http_info(ext_project_id, payload, opts = {}) ⇒ Array<(BuyProject, Fixnum, Hash)>

buy projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(BuyProject, Fixnum, Hash)>)

    BuyProject data, response status code and response headers



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
# File 'lib/samplify_api_client/api/projects_api.rb', line 37

def projects_buy_with_http_info(ext_project_id, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_buy ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_buy"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling ProjectsApi.projects_buy"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/buy'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.buyproject+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'BuyProject')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_buy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_close(ext_project_id, opts = {}) ⇒ ProjectAction

close projects

Parameters:

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

    the optional parameters

Returns:



84
85
86
87
# File 'lib/samplify_api_client/api/projects_api.rb', line 84

def projects_close(ext_project_id, opts = {})
  data, _status_code, _headers = projects_close_with_http_info(ext_project_id, opts)
  data
end

#projects_close_with_http_info(ext_project_id, opts = {}) ⇒ Array<(ProjectAction, Fixnum, Hash)>

close projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ProjectAction, Fixnum, Hash)>)

    ProjectAction data, response status code and response headers



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
# File 'lib/samplify_api_client/api/projects_api.rb', line 93

def projects_close_with_http_info(ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_close ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_close"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/close'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.project.action+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectAction')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_close\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_create(payload, opts = {}) ⇒ ProjectResponse

create projects

Parameters:

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

    the optional parameters

Returns:



136
137
138
139
# File 'lib/samplify_api_client/api/projects_api.rb', line 136

def projects_create(payload, opts = {})
  data, _status_code, _headers = projects_create_with_http_info(payload, opts)
  data
end

#projects_create_with_http_info(payload, opts = {}) ⇒ Array<(ProjectResponse, Fixnum, Hash)>

create projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ProjectResponse, Fixnum, Hash)>)

    ProjectResponse data, response status code and response headers



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
# File 'lib/samplify_api_client/api/projects_api.rb', line 145

def projects_create_with_http_info(payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_create ...'
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling ProjectsApi.projects_create"
  end
  # resource path
  local_var_path = '/sample/v1/projects'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.create+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_get(ext_project_id, opts = {}) ⇒ ProjectResponse

get projects

Parameters:

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

    the optional parameters

Returns:



188
189
190
191
# File 'lib/samplify_api_client/api/projects_api.rb', line 188

def projects_get(ext_project_id, opts = {})
  data, _status_code, _headers = projects_get_with_http_info(ext_project_id, opts)
  data
end

#projects_get_report(ext_project_id, opts = {}) ⇒ ProjectReport

getReport projects

Parameters:

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

    the optional parameters

Returns:



240
241
242
243
# File 'lib/samplify_api_client/api/projects_api.rb', line 240

def projects_get_report(ext_project_id, opts = {})
  data, _status_code, _headers = projects_get_report_with_http_info(ext_project_id, opts)
  data
end

#projects_get_report_with_http_info(ext_project_id, opts = {}) ⇒ Array<(ProjectReport, Fixnum, Hash)>

getReport projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ProjectReport, Fixnum, Hash)>)

    ProjectReport data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/samplify_api_client/api/projects_api.rb', line 249

def projects_get_report_with_http_info(ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_get_report ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_get_report"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/report'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.projects.report+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectReport')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_get_reports(ext_project_id, opts = {}) ⇒ ProjectReports

getReports projects

Parameters:

  • ext_project_id

    Only return project with the given external project ID

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

    the optional parameters

Returns:



292
293
294
295
# File 'lib/samplify_api_client/api/projects_api.rb', line 292

def projects_get_reports(ext_project_id, opts = {})
  data, _status_code, _headers = projects_get_reports_with_http_info(ext_project_id, opts)
  data
end

#projects_get_reports_with_http_info(ext_project_id, opts = {}) ⇒ Array<(ProjectReports, Fixnum, Hash)>

getReports projects

Parameters:

  • ext_project_id

    Only return project with the given external project ID

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

    the optional parameters

Returns:

  • (Array<(ProjectReports, Fixnum, Hash)>)

    ProjectReports data, response status code and response headers



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/samplify_api_client/api/projects_api.rb', line 301

def projects_get_reports_with_http_info(ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_get_reports ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_get_reports"
  end
  # resource path
  local_var_path = '/sample/v1/projects/report'

  # query parameters
  query_params = {}
  query_params[:'extProjectId'] = ext_project_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.projects.reports+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectReports')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_get_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

getSurveyEndLinks projects

Parameters:

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

    the optional parameters

Returns:



346
347
348
349
# File 'lib/samplify_api_client/api/projects_api.rb', line 346

def projects_get_survey_end_links(ext_project_id, survey_id, opts = {})
  data, _status_code, _headers = projects_get_survey_end_links_with_http_info(ext_project_id, survey_id, opts)
  data
end

getSurveyEndLinks projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ProjectSurveyEndLinks, Fixnum, Hash)>)

    ProjectSurveyEndLinks data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/samplify_api_client/api/projects_api.rb', line 356

def projects_get_survey_end_links_with_http_info(ext_project_id, survey_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_get_survey_end_links ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_get_survey_end_links"
  end
  # verify the required parameter 'survey_id' is set
  if @api_client.config.client_side_validation && survey_id.nil?
    fail ArgumentError, "Missing the required parameter 'survey_id' when calling ProjectsApi.projects_get_survey_end_links"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/surveys/{surveyId}/links'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s).sub('{' + 'surveyId' + '}', survey_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.projects.survey.endlinks+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectSurveyEndLinks')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_get_survey_end_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_get_with_http_info(ext_project_id, opts = {}) ⇒ Array<(ProjectResponse, Fixnum, Hash)>

get projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ProjectResponse, Fixnum, Hash)>)

    ProjectResponse data, response status code and response headers



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
# File 'lib/samplify_api_client/api/projects_api.rb', line 197

def projects_get_with_http_info(ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_get ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_get"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.create+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_invoices(ext_project_id, opts = {}) ⇒ nil

invoices projects

Parameters:

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

    the optional parameters

Returns:

  • (nil)


403
404
405
406
# File 'lib/samplify_api_client/api/projects_api.rb', line 403

def projects_invoices(ext_project_id, opts = {})
  projects_invoices_with_http_info(ext_project_id, opts)
  nil
end

#projects_invoices_with_http_info(ext_project_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

invoices projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/samplify_api_client/api/projects_api.rb', line 412

def projects_invoices_with_http_info(ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_invoices ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_invoices"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/invoices'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.app.error+json', 'text/plain'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_list(opts = {}) ⇒ Projects

list projects

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :created_at (String)

    return projects with createdAt start date

  • :ext_project_id (String)

    Only return project with the given external project id

  • :limit (Integer)

    Maximum number of projects to return (default to 10)

  • :offset (Integer)

    The first zero-based offset project to return (default to 0)

  • :scope (String)

    Only return projects within the given scope

  • :sort (Array<String>)

    Sort the projects by the given key(s)

  • :state (String)

    Only return projects with the given state

  • :title (String)

    Only return projects with the given title

Returns:



461
462
463
464
# File 'lib/samplify_api_client/api/projects_api.rb', line 461

def projects_list(opts = {})
  data, _status_code, _headers = projects_list_with_http_info(opts)
  data
end

#projects_list_with_http_info(opts = {}) ⇒ Array<(Projects, Fixnum, Hash)>

list projects

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :created_at (String)

    return projects with createdAt start date

  • :ext_project_id (String)

    Only return project with the given external project id

  • :limit (Integer)

    Maximum number of projects to return

  • :offset (Integer)

    The first zero-based offset project to return

  • :scope (String)

    Only return projects within the given scope

  • :sort (Array<String>)

    Sort the projects by the given key(s)

  • :state (String)

    Only return projects with the given state

  • :title (String)

    Only return projects with the given title

Returns:

  • (Array<(Projects, Fixnum, Hash)>)

    Projects data, response status code and response headers



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# File 'lib/samplify_api_client/api/projects_api.rb', line 477

def projects_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_list ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.projects_list, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.projects_list, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProjectsApi.projects_list, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && opts[:'scope'] && !['application', 'user'].include?(opts[:'scope'])
    fail ArgumentError, 'invalid value for "scope", must be one of application, user'
  end
  # resource path
  local_var_path = '/sample/v1/projects'

  # query parameters
  query_params = {}
  query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'extProjectId'] = opts[:'ext_project_id'] if !opts[:'ext_project_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
  query_params[:'title'] = opts[:'title'] if !opts[:'title'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.projects+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Projects')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_reconcile(ext_project_id, file, message, opts = {}) ⇒ Reconcile

reconcile projects

Parameters:

  • ext_project_id
  • file

    File

  • message

    Message

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

    the optional parameters

Returns:



541
542
543
544
# File 'lib/samplify_api_client/api/projects_api.rb', line 541

def projects_reconcile(ext_project_id, file, message, opts = {})
  data, _status_code, _headers = projects_reconcile_with_http_info(ext_project_id, file, message, opts)
  data
end

#projects_reconcile_with_http_info(ext_project_id, file, message, opts = {}) ⇒ Array<(Reconcile, Fixnum, Hash)>

reconcile projects

Parameters:

  • ext_project_id
  • file

    File

  • message

    Message

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

    the optional parameters

Returns:

  • (Array<(Reconcile, Fixnum, Hash)>)

    Reconcile data, response status code and response headers



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/samplify_api_client/api/projects_api.rb', line 552

def projects_reconcile_with_http_info(ext_project_id, file, message, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_reconcile ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_reconcile"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling ProjectsApi.projects_reconcile"
  end
  # verify the required parameter 'message' is set
  if @api_client.config.client_side_validation && message.nil?
    fail ArgumentError, "Missing the required parameter 'message' when calling ProjectsApi.projects_reconcile"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/reconcile'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.app.error+json', 'application/vnd.projects.reconcile+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file
  form_params['message'] = message

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Reconcile')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_reconcile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#projects_update(ext_project_id, payload, opts = {}) ⇒ ProjectResponse

update projects

Parameters:

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

    the optional parameters

Returns:



606
607
608
609
# File 'lib/samplify_api_client/api/projects_api.rb', line 606

def projects_update(ext_project_id, payload, opts = {})
  data, _status_code, _headers = projects_update_with_http_info(ext_project_id, payload, opts)
  data
end

#projects_update_with_http_info(ext_project_id, payload, opts = {}) ⇒ Array<(ProjectResponse, Fixnum, Hash)>

update projects

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ProjectResponse, Fixnum, Hash)>)

    ProjectResponse data, response status code and response headers



616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/samplify_api_client/api/projects_api.rb', line 616

def projects_update_with_http_info(ext_project_id, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectsApi.projects_update ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling ProjectsApi.projects_update"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling ProjectsApi.projects_update"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.create+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProjectResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectsApi#projects_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end