blueprint_ruby_client 0.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 (83) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +65 -0
  4. data/README.md +152 -0
  5. data/blueprint_ruby_client.gemspec +31 -0
  6. data/config.json +13 -0
  7. data/docs/Asset.md +9 -0
  8. data/docs/AssetBody.md +9 -0
  9. data/docs/AssetResultSet.md +9 -0
  10. data/docs/AssetsApi.md +376 -0
  11. data/docs/Error.md +10 -0
  12. data/docs/Errors.md +8 -0
  13. data/docs/HierarchyApi.md +745 -0
  14. data/docs/Links.md +10 -0
  15. data/docs/Meta.md +10 -0
  16. data/docs/Namespace.md +9 -0
  17. data/docs/NamespaceRelationship.md +8 -0
  18. data/docs/Node.md +11 -0
  19. data/docs/NodeAttributes.md +13 -0
  20. data/docs/NodeBody.md +9 -0
  21. data/docs/NodeRelationship.md +10 -0
  22. data/docs/NodeRelationships.md +10 -0
  23. data/docs/NodeResultSet.md +10 -0
  24. data/generate.sh +7 -0
  25. data/git_push.sh +52 -0
  26. data/lib/blueprint_ruby_client/api/assets_api.rb +598 -0
  27. data/lib/blueprint_ruby_client/api/hierarchy_api.rb +1174 -0
  28. data/lib/blueprint_ruby_client/api_client.rb +365 -0
  29. data/lib/blueprint_ruby_client/api_error.rb +36 -0
  30. data/lib/blueprint_ruby_client/configuration.rb +170 -0
  31. data/lib/blueprint_ruby_client/models/asset.rb +242 -0
  32. data/lib/blueprint_ruby_client/models/asset_body.rb +237 -0
  33. data/lib/blueprint_ruby_client/models/asset_result_set.rb +234 -0
  34. data/lib/blueprint_ruby_client/models/error.rb +267 -0
  35. data/lib/blueprint_ruby_client/models/errors.rb +209 -0
  36. data/lib/blueprint_ruby_client/models/links.rb +257 -0
  37. data/lib/blueprint_ruby_client/models/meta.rb +260 -0
  38. data/lib/blueprint_ruby_client/models/namespace.rb +242 -0
  39. data/lib/blueprint_ruby_client/models/namespace_relationship.rb +207 -0
  40. data/lib/blueprint_ruby_client/models/node.rb +293 -0
  41. data/lib/blueprint_ruby_client/models/node_attributes.rb +338 -0
  42. data/lib/blueprint_ruby_client/models/node_body.rb +237 -0
  43. data/lib/blueprint_ruby_client/models/node_relationship.rb +259 -0
  44. data/lib/blueprint_ruby_client/models/node_relationships.rb +257 -0
  45. data/lib/blueprint_ruby_client/models/node_result_set.rb +261 -0
  46. data/lib/blueprint_ruby_client/version.rb +15 -0
  47. data/lib/blueprint_ruby_client.rb +56 -0
  48. data/spec/api/assets_api_spec.rb +150 -0
  49. data/spec/api/hierarchy_api_spec.rb +266 -0
  50. data/spec/models/asset_body_spec.rb +56 -0
  51. data/spec/models/asset_result_set_spec.rb +56 -0
  52. data/spec/models/asset_spec.rb +56 -0
  53. data/spec/models/error_spec.rb +66 -0
  54. data/spec/models/errors_spec.rb +46 -0
  55. data/spec/models/links_spec.rb +66 -0
  56. data/spec/models/meta_spec.rb +66 -0
  57. data/spec/models/namespace_relationship_spec.rb +46 -0
  58. data/spec/models/namespace_spec.rb +56 -0
  59. data/spec/models/node_attributes_spec.rb +96 -0
  60. data/spec/models/node_body_spec.rb +56 -0
  61. data/spec/models/node_relationship_spec.rb +66 -0
  62. data/spec/models/node_relationships_spec.rb +66 -0
  63. data/spec/models/node_result_set_spec.rb +66 -0
  64. data/spec/models/node_spec.rb +76 -0
  65. data/swagger-codegen-cli.jar +0 -0
  66. data/templates/Gemfile.mustache +4 -0
  67. data/templates/README.mustache +139 -0
  68. data/templates/api.mustache +135 -0
  69. data/templates/api_client.mustache +357 -0
  70. data/templates/api_doc.mustache +79 -0
  71. data/templates/api_error.mustache +28 -0
  72. data/templates/api_info.mustache +18 -0
  73. data/templates/api_test.mustache +47 -0
  74. data/templates/base_object.mustache +103 -0
  75. data/templates/configuration.mustache +192 -0
  76. data/templates/gem.mustache +40 -0
  77. data/templates/gemspec.mustache +31 -0
  78. data/templates/gitignore.mustache +40 -0
  79. data/templates/model.mustache +242 -0
  80. data/templates/model_doc.mustache +9 -0
  81. data/templates/model_test.mustache +40 -0
  82. data/templates/version.mustache +7 -0
  83. metadata +322 -0
@@ -0,0 +1,1174 @@
1
+ =begin
2
+ Talis Blueprint API
3
+
4
+ This is the API documentation for [Blueprint](https://github.com/talis/blueprint-server), a primitive for institutional structure and time periods
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module BlueprintClient
16
+ class HierarchyApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ #
24
+ # Add a node
25
+ # @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
26
+ # @param body node
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [NodeBody]
29
+ def add_node(namespace_inc_global, body, opts = {})
30
+ data, _status_code, _headers = add_node_with_http_info(namespace_inc_global, body, opts)
31
+ return data
32
+ end
33
+
34
+ #
35
+ # Add a node
36
+ # @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
37
+ # @param body node
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(NodeBody, Fixnum, Hash)>] NodeBody data, response status code and response headers
40
+ def add_node_with_http_info(namespace_inc_global, body, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug "Calling API: HierarchyApi.add_node ..."
43
+ end
44
+
45
+
46
+ # verify the required parameter 'namespace_inc_global' is set
47
+ fail ArgumentError, "Missing the required parameter 'namespace_inc_global' when calling HierarchyApi.add_node" if namespace_inc_global.nil?
48
+
49
+
50
+
51
+
52
+
53
+
54
+ # verify the required parameter 'body' is set
55
+ fail ArgumentError, "Missing the required parameter 'body' when calling HierarchyApi.add_node" if body.nil?
56
+
57
+
58
+
59
+
60
+
61
+ # resource path
62
+ local_var_path = "/{namespaceIncGlobal}/nodes".sub('{format}','json').sub('{' + 'namespaceIncGlobal' + '}', namespace_inc_global.to_s)
63
+
64
+ # query parameters
65
+ query_params = {}
66
+
67
+ # header parameters
68
+ header_params = {}
69
+
70
+ # HTTP header 'Accept' (if needed)
71
+ local_header_accept = ['application/vnd.api+json']
72
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
73
+
74
+ # HTTP header 'Content-Type'
75
+ local_header_content_type = ['application/json']
76
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
77
+
78
+ # form parameters
79
+ form_params = {}
80
+
81
+ # http body (model)
82
+ post_body = @api_client.object_to_http_body(body)
83
+
84
+ auth_names = ['oauth2']
85
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
86
+ :header_params => header_params,
87
+ :query_params => query_params,
88
+ :form_params => form_params,
89
+ :body => post_body,
90
+ :auth_names => auth_names,
91
+ :return_type => 'NodeBody')
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug "API called: HierarchyApi#add_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
94
+ end
95
+ return data, status_code, headers
96
+ end
97
+
98
+ #
99
+ # Send operations to modify nodes in bulk, to be applied/rejected as a single transaction.\nFormat will be:\n\n OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS\n
100
+ # @param namespace identifier namespacing the blueprint.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [nil]
103
+ def bulk_upload(namespace, opts = {})
104
+ bulk_upload_with_http_info(namespace, opts)
105
+ return nil
106
+ end
107
+
108
+ #
109
+ # Send operations to modify nodes in bulk, to be applied/rejected as a single transaction.\nFormat will be:\n\n OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS\n
110
+ # @param namespace identifier namespacing the blueprint.
111
+ # @param [Hash] opts the optional parameters
112
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
113
+ def bulk_upload_with_http_info(namespace, opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug "Calling API: HierarchyApi.bulk_upload ..."
116
+ end
117
+
118
+
119
+ # verify the required parameter 'namespace' is set
120
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.bulk_upload" if namespace.nil?
121
+
122
+
123
+
124
+
125
+
126
+ # resource path
127
+ local_var_path = "/{namespace}/nodes.csv".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s)
128
+
129
+ # query parameters
130
+ query_params = {}
131
+
132
+ # header parameters
133
+ header_params = {}
134
+
135
+ # HTTP header 'Accept' (if needed)
136
+ local_header_accept = ['application/vnd.api+json']
137
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
138
+
139
+ # HTTP header 'Content-Type'
140
+ local_header_content_type = ['text/plain', 'application/octet-stream']
141
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
142
+
143
+ # form parameters
144
+ form_params = {}
145
+
146
+ # http body (model)
147
+ post_body = nil
148
+
149
+ auth_names = ['oauth2']
150
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
151
+ :header_params => header_params,
152
+ :query_params => query_params,
153
+ :form_params => form_params,
154
+ :body => post_body,
155
+ :auth_names => auth_names)
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug "API called: HierarchyApi#bulk_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
158
+ end
159
+ return data, status_code, headers
160
+ end
161
+
162
+ #
163
+ # Delete a node
164
+ # @param namespace identifier namespacing the blueprint.
165
+ # @param id id identifying a domain model
166
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
167
+ # @param [Hash] opts the optional parameters
168
+ # @return [nil]
169
+ def delete_node(namespace, id, type, opts = {})
170
+ delete_node_with_http_info(namespace, id, type, opts)
171
+ return nil
172
+ end
173
+
174
+ #
175
+ # Delete a node
176
+ # @param namespace identifier namespacing the blueprint.
177
+ # @param id id identifying a domain model
178
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
179
+ # @param [Hash] opts the optional parameters
180
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
181
+ def delete_node_with_http_info(namespace, id, type, opts = {})
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "Calling API: HierarchyApi.delete_node ..."
184
+ end
185
+
186
+
187
+ # verify the required parameter 'namespace' is set
188
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.delete_node" if namespace.nil?
189
+
190
+
191
+
192
+
193
+
194
+
195
+ # verify the required parameter 'id' is set
196
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.delete_node" if id.nil?
197
+
198
+
199
+
200
+
201
+
202
+
203
+ # verify the required parameter 'type' is set
204
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.delete_node" if type.nil?
205
+
206
+
207
+
208
+
209
+
210
+ # resource path
211
+ local_var_path = "/{namespace}/nodes/{type}/{id}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'id' + '}', id.to_s).sub('{' + 'type' + '}', type.to_s)
212
+
213
+ # query parameters
214
+ query_params = {}
215
+
216
+ # header parameters
217
+ header_params = {}
218
+
219
+ # HTTP header 'Accept' (if needed)
220
+ local_header_accept = ['application/vnd.api+json']
221
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
222
+
223
+ # HTTP header 'Content-Type'
224
+ local_header_content_type = ['application/json']
225
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
226
+
227
+ # form parameters
228
+ form_params = {}
229
+
230
+ # http body (model)
231
+ post_body = nil
232
+
233
+ auth_names = ['oauth2']
234
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names)
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug "API called: HierarchyApi#delete_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
242
+ end
243
+ return data, status_code, headers
244
+ end
245
+
246
+ #
247
+ # Download the blueprint's nodes in CSV format\nFormat will be:\n\n OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS\n\nOLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importer\n
248
+ # @param namespace identifier namespacing the blueprint.
249
+ # @param [Hash] opts the optional parameters
250
+ # @return [nil]
251
+ def export_hierarchy(namespace, opts = {})
252
+ export_hierarchy_with_http_info(namespace, opts)
253
+ return nil
254
+ end
255
+
256
+ #
257
+ # Download the blueprint&#39;s nodes in CSV format\nFormat will be:\n\n OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS\n\nOLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importer\n
258
+ # @param namespace identifier namespacing the blueprint.
259
+ # @param [Hash] opts the optional parameters
260
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
261
+ def export_hierarchy_with_http_info(namespace, opts = {})
262
+ if @api_client.config.debugging
263
+ @api_client.config.logger.debug "Calling API: HierarchyApi.export_hierarchy ..."
264
+ end
265
+
266
+
267
+ # verify the required parameter 'namespace' is set
268
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.export_hierarchy" if namespace.nil?
269
+
270
+
271
+
272
+
273
+
274
+ # resource path
275
+ local_var_path = "/{namespace}/nodes.csv".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s)
276
+
277
+ # query parameters
278
+ query_params = {}
279
+
280
+ # header parameters
281
+ header_params = {}
282
+
283
+ # HTTP header 'Accept' (if needed)
284
+ local_header_accept = ['application/vnd.api+json']
285
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
286
+
287
+ # HTTP header 'Content-Type'
288
+ local_header_content_type = ['application/json']
289
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
290
+
291
+ # form parameters
292
+ form_params = {}
293
+
294
+ # http body (model)
295
+ post_body = nil
296
+
297
+ auth_names = ['oauth2']
298
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
299
+ :header_params => header_params,
300
+ :query_params => query_params,
301
+ :form_params => form_params,
302
+ :body => post_body,
303
+ :auth_names => auth_names)
304
+ if @api_client.config.debugging
305
+ @api_client.config.logger.debug "API called: HierarchyApi#export_hierarchy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
306
+ end
307
+ return data, status_code, headers
308
+ end
309
+
310
+ # Get ancestor nodes
311
+ # A proxy for finding ancestors of a given node, equivalent to\n`/1/abc/nodes?filter[descendant]=department%2Fdep101`\n
312
+ # @param id id identifying a domain model
313
+ # @param namespace identifier namespacing the blueprint.
314
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
315
+ # @param [Hash] opts the optional parameters
316
+ # @option opts [Float] :offset index to start result set from
317
+ # @option opts [Float] :limit number of records to return
318
+ # @return [NodeResultSet]
319
+ def get_ancestors(id, namespace, type, opts = {})
320
+ data, _status_code, _headers = get_ancestors_with_http_info(id, namespace, type, opts)
321
+ return data
322
+ end
323
+
324
+ # Get ancestor nodes
325
+ # A proxy for finding ancestors of a given node, equivalent to\n`/1/abc/nodes?filter[descendant]=department%2Fdep101`\n
326
+ # @param id id identifying a domain model
327
+ # @param namespace identifier namespacing the blueprint.
328
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
329
+ # @param [Hash] opts the optional parameters
330
+ # @option opts [Float] :offset index to start result set from
331
+ # @option opts [Float] :limit number of records to return
332
+ # @return [Array<(NodeResultSet, Fixnum, Hash)>] NodeResultSet data, response status code and response headers
333
+ def get_ancestors_with_http_info(id, namespace, type, opts = {})
334
+ if @api_client.config.debugging
335
+ @api_client.config.logger.debug "Calling API: HierarchyApi.get_ancestors ..."
336
+ end
337
+
338
+
339
+ # verify the required parameter 'id' is set
340
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_ancestors" if id.nil?
341
+
342
+
343
+
344
+
345
+
346
+
347
+ # verify the required parameter 'namespace' is set
348
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_ancestors" if namespace.nil?
349
+
350
+
351
+
352
+
353
+
354
+
355
+ # verify the required parameter 'type' is set
356
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_ancestors" if type.nil?
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+ # resource path
375
+ local_var_path = "/{namespace}/nodes/{type}/{id}/ancestors".sub('{format}','json').sub('{' + 'id' + '}', id.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s)
376
+
377
+ # query parameters
378
+ query_params = {}
379
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
380
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
381
+
382
+ # header parameters
383
+ header_params = {}
384
+
385
+ # HTTP header 'Accept' (if needed)
386
+ local_header_accept = ['application/vnd.api+json']
387
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
388
+
389
+ # HTTP header 'Content-Type'
390
+ local_header_content_type = ['application/json']
391
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
392
+
393
+ # form parameters
394
+ form_params = {}
395
+
396
+ # http body (model)
397
+ post_body = nil
398
+
399
+ auth_names = ['oauth2']
400
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
401
+ :header_params => header_params,
402
+ :query_params => query_params,
403
+ :form_params => form_params,
404
+ :body => post_body,
405
+ :auth_names => auth_names,
406
+ :return_type => 'NodeResultSet')
407
+ if @api_client.config.debugging
408
+ @api_client.config.logger.debug "API called: HierarchyApi#get_ancestors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
409
+ end
410
+ return data, status_code, headers
411
+ end
412
+
413
+ # Get child nodes
414
+ # A proxy for finding children of a given node, equivalent to\n`/1/abc/nodes?filter[parent]=department%2Fdep101`\n
415
+ # @param id id identifying a domain model
416
+ # @param namespace identifier namespacing the blueprint.
417
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
418
+ # @param [Hash] opts the optional parameters
419
+ # @option opts [Float] :offset index to start result set from
420
+ # @option opts [Float] :limit number of records to return
421
+ # @return [NodeResultSet]
422
+ def get_children(id, namespace, type, opts = {})
423
+ data, _status_code, _headers = get_children_with_http_info(id, namespace, type, opts)
424
+ return data
425
+ end
426
+
427
+ # Get child nodes
428
+ # A proxy for finding children of a given node, equivalent to\n`/1/abc/nodes?filter[parent]=department%2Fdep101`\n
429
+ # @param id id identifying a domain model
430
+ # @param namespace identifier namespacing the blueprint.
431
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
432
+ # @param [Hash] opts the optional parameters
433
+ # @option opts [Float] :offset index to start result set from
434
+ # @option opts [Float] :limit number of records to return
435
+ # @return [Array<(NodeResultSet, Fixnum, Hash)>] NodeResultSet data, response status code and response headers
436
+ def get_children_with_http_info(id, namespace, type, opts = {})
437
+ if @api_client.config.debugging
438
+ @api_client.config.logger.debug "Calling API: HierarchyApi.get_children ..."
439
+ end
440
+
441
+
442
+ # verify the required parameter 'id' is set
443
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_children" if id.nil?
444
+
445
+
446
+
447
+
448
+
449
+
450
+ # verify the required parameter 'namespace' is set
451
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_children" if namespace.nil?
452
+
453
+
454
+
455
+
456
+
457
+
458
+ # verify the required parameter 'type' is set
459
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_children" if type.nil?
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+ # resource path
478
+ local_var_path = "/{namespace}/nodes/{type}/{id}/children".sub('{format}','json').sub('{' + 'id' + '}', id.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s)
479
+
480
+ # query parameters
481
+ query_params = {}
482
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
483
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
484
+
485
+ # header parameters
486
+ header_params = {}
487
+
488
+ # HTTP header 'Accept' (if needed)
489
+ local_header_accept = ['application/vnd.api+json']
490
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
491
+
492
+ # HTTP header 'Content-Type'
493
+ local_header_content_type = ['application/json']
494
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
495
+
496
+ # form parameters
497
+ form_params = {}
498
+
499
+ # http body (model)
500
+ post_body = nil
501
+
502
+ auth_names = ['oauth2']
503
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
504
+ :header_params => header_params,
505
+ :query_params => query_params,
506
+ :form_params => form_params,
507
+ :body => post_body,
508
+ :auth_names => auth_names,
509
+ :return_type => 'NodeResultSet')
510
+ if @api_client.config.debugging
511
+ @api_client.config.logger.debug "API called: HierarchyApi#get_children\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
512
+ end
513
+ return data, status_code, headers
514
+ end
515
+
516
+ # Get descendant nodes
517
+ # A proxy for finding descendants of a given node, equivalent to\n`/1/abc/nodes?filter[ancestor]=department%2Fdep101`\n
518
+ # @param id id identifying a domain model
519
+ # @param namespace identifier namespacing the blueprint.
520
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
521
+ # @param [Hash] opts the optional parameters
522
+ # @option opts [Float] :offset index to start result set from
523
+ # @option opts [Float] :limit number of records to return
524
+ # @return [NodeResultSet]
525
+ def get_descendants(id, namespace, type, opts = {})
526
+ data, _status_code, _headers = get_descendants_with_http_info(id, namespace, type, opts)
527
+ return data
528
+ end
529
+
530
+ # Get descendant nodes
531
+ # A proxy for finding descendants of a given node, equivalent to\n`/1/abc/nodes?filter[ancestor]=department%2Fdep101`\n
532
+ # @param id id identifying a domain model
533
+ # @param namespace identifier namespacing the blueprint.
534
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
535
+ # @param [Hash] opts the optional parameters
536
+ # @option opts [Float] :offset index to start result set from
537
+ # @option opts [Float] :limit number of records to return
538
+ # @return [Array<(NodeResultSet, Fixnum, Hash)>] NodeResultSet data, response status code and response headers
539
+ def get_descendants_with_http_info(id, namespace, type, opts = {})
540
+ if @api_client.config.debugging
541
+ @api_client.config.logger.debug "Calling API: HierarchyApi.get_descendants ..."
542
+ end
543
+
544
+
545
+ # verify the required parameter 'id' is set
546
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_descendants" if id.nil?
547
+
548
+
549
+
550
+
551
+
552
+
553
+ # verify the required parameter 'namespace' is set
554
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_descendants" if namespace.nil?
555
+
556
+
557
+
558
+
559
+
560
+
561
+ # verify the required parameter 'type' is set
562
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_descendants" if type.nil?
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+ # resource path
581
+ local_var_path = "/{namespace}/nodes/{type}/{id}/descendants".sub('{format}','json').sub('{' + 'id' + '}', id.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s)
582
+
583
+ # query parameters
584
+ query_params = {}
585
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
586
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
587
+
588
+ # header parameters
589
+ header_params = {}
590
+
591
+ # HTTP header 'Accept' (if needed)
592
+ local_header_accept = ['application/vnd.api+json']
593
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
594
+
595
+ # HTTP header 'Content-Type'
596
+ local_header_content_type = ['application/json']
597
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
598
+
599
+ # form parameters
600
+ form_params = {}
601
+
602
+ # http body (model)
603
+ post_body = nil
604
+
605
+ auth_names = ['oauth2']
606
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
607
+ :header_params => header_params,
608
+ :query_params => query_params,
609
+ :form_params => form_params,
610
+ :body => post_body,
611
+ :auth_names => auth_names,
612
+ :return_type => 'NodeResultSet')
613
+ if @api_client.config.debugging
614
+ @api_client.config.logger.debug "API called: HierarchyApi#get_descendants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
615
+ end
616
+ return data, status_code, headers
617
+ end
618
+
619
+ #
620
+ # Get details of a given node
621
+ # @param namespace identifier namespacing the blueprint.
622
+ # @param id id identifying a domain model
623
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
624
+ # @param [Hash] opts the optional parameters
625
+ # @option opts [String] :includes comma separated list of elements to hydrate. Can include children, ancestors or both
626
+ # @return [NodeBody]
627
+ def get_node(namespace, id, type, opts = {})
628
+ data, _status_code, _headers = get_node_with_http_info(namespace, id, type, opts)
629
+ return data
630
+ end
631
+
632
+ #
633
+ # Get details of a given node
634
+ # @param namespace identifier namespacing the blueprint.
635
+ # @param id id identifying a domain model
636
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
637
+ # @param [Hash] opts the optional parameters
638
+ # @option opts [String] :includes comma separated list of elements to hydrate. Can include children, ancestors or both
639
+ # @return [Array<(NodeBody, Fixnum, Hash)>] NodeBody data, response status code and response headers
640
+ def get_node_with_http_info(namespace, id, type, opts = {})
641
+ if @api_client.config.debugging
642
+ @api_client.config.logger.debug "Calling API: HierarchyApi.get_node ..."
643
+ end
644
+
645
+
646
+ # verify the required parameter 'namespace' is set
647
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_node" if namespace.nil?
648
+
649
+
650
+
651
+
652
+
653
+
654
+ # verify the required parameter 'id' is set
655
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_node" if id.nil?
656
+
657
+
658
+
659
+
660
+
661
+
662
+ # verify the required parameter 'type' is set
663
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_node" if type.nil?
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+ if opts[:'includes'] && !['children', 'ancestors', 'children,ancestors', 'ancestors,children'].include?(opts[:'includes'])
673
+ fail ArgumentError, 'invalid value for "includes", must be one of children, ancestors, children,ancestors, ancestors,children'
674
+ end
675
+
676
+
677
+
678
+
679
+ # resource path
680
+ local_var_path = "/{namespace}/nodes/{type}/{id}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'id' + '}', id.to_s).sub('{' + 'type' + '}', type.to_s)
681
+
682
+ # query parameters
683
+ query_params = {}
684
+ query_params[:'includes'] = opts[:'includes'] if opts[:'includes']
685
+
686
+ # header parameters
687
+ header_params = {}
688
+
689
+ # HTTP header 'Accept' (if needed)
690
+ local_header_accept = ['application/vnd.api+json']
691
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
692
+
693
+ # HTTP header 'Content-Type'
694
+ local_header_content_type = ['application/json']
695
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
696
+
697
+ # form parameters
698
+ form_params = {}
699
+
700
+ # http body (model)
701
+ post_body = nil
702
+
703
+ auth_names = ['oauth2']
704
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
705
+ :header_params => header_params,
706
+ :query_params => query_params,
707
+ :form_params => form_params,
708
+ :body => post_body,
709
+ :auth_names => auth_names,
710
+ :return_type => 'NodeBody')
711
+ if @api_client.config.debugging
712
+ @api_client.config.logger.debug "API called: HierarchyApi#get_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
713
+ end
714
+ return data, status_code, headers
715
+ end
716
+
717
+ # Get parent nodes
718
+ # A proxy for finding parents of a given node, equivalent to\n`/1/abc/nodes?filter[child]=department%2Fdep101`\n
719
+ # @param id id identifying a domain model
720
+ # @param namespace identifier namespacing the blueprint.
721
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
722
+ # @param [Hash] opts the optional parameters
723
+ # @option opts [Float] :offset index to start result set from
724
+ # @option opts [Float] :limit number of records to return
725
+ # @return [NodeResultSet]
726
+ def get_parents(id, namespace, type, opts = {})
727
+ data, _status_code, _headers = get_parents_with_http_info(id, namespace, type, opts)
728
+ return data
729
+ end
730
+
731
+ # Get parent nodes
732
+ # A proxy for finding parents of a given node, equivalent to\n`/1/abc/nodes?filter[child]=department%2Fdep101`\n
733
+ # @param id id identifying a domain model
734
+ # @param namespace identifier namespacing the blueprint.
735
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
736
+ # @param [Hash] opts the optional parameters
737
+ # @option opts [Float] :offset index to start result set from
738
+ # @option opts [Float] :limit number of records to return
739
+ # @return [Array<(NodeResultSet, Fixnum, Hash)>] NodeResultSet data, response status code and response headers
740
+ def get_parents_with_http_info(id, namespace, type, opts = {})
741
+ if @api_client.config.debugging
742
+ @api_client.config.logger.debug "Calling API: HierarchyApi.get_parents ..."
743
+ end
744
+
745
+
746
+ # verify the required parameter 'id' is set
747
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_parents" if id.nil?
748
+
749
+
750
+
751
+
752
+
753
+
754
+ # verify the required parameter 'namespace' is set
755
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_parents" if namespace.nil?
756
+
757
+
758
+
759
+
760
+
761
+
762
+ # verify the required parameter 'type' is set
763
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_parents" if type.nil?
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+ # resource path
782
+ local_var_path = "/{namespace}/nodes/{type}/{id}/parents".sub('{format}','json').sub('{' + 'id' + '}', id.to_s).sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s)
783
+
784
+ # query parameters
785
+ query_params = {}
786
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
787
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
788
+
789
+ # header parameters
790
+ header_params = {}
791
+
792
+ # HTTP header 'Accept' (if needed)
793
+ local_header_accept = ['application/vnd.api+json']
794
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
795
+
796
+ # HTTP header 'Content-Type'
797
+ local_header_content_type = ['application/json']
798
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
799
+
800
+ # form parameters
801
+ form_params = {}
802
+
803
+ # http body (model)
804
+ post_body = nil
805
+
806
+ auth_names = ['oauth2']
807
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
808
+ :header_params => header_params,
809
+ :query_params => query_params,
810
+ :form_params => form_params,
811
+ :body => post_body,
812
+ :auth_names => auth_names,
813
+ :return_type => 'NodeResultSet')
814
+ if @api_client.config.debugging
815
+ @api_client.config.logger.debug "API called: HierarchyApi#get_parents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
816
+ end
817
+ return data, status_code, headers
818
+ end
819
+
820
+ #
821
+ # Replaces the node with the data sent in the body
822
+ # @param namespace identifier namespacing the blueprint.
823
+ # @param id id identifying a domain model
824
+ # @param body node
825
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
826
+ # @param [Hash] opts the optional parameters
827
+ # @return [NodeBody]
828
+ def replace_node(namespace, id, body, type, opts = {})
829
+ data, _status_code, _headers = replace_node_with_http_info(namespace, id, body, type, opts)
830
+ return data
831
+ end
832
+
833
+ #
834
+ # Replaces the node with the data sent in the body
835
+ # @param namespace identifier namespacing the blueprint.
836
+ # @param id id identifying a domain model
837
+ # @param body node
838
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
839
+ # @param [Hash] opts the optional parameters
840
+ # @return [Array<(NodeBody, Fixnum, Hash)>] NodeBody data, response status code and response headers
841
+ def replace_node_with_http_info(namespace, id, body, type, opts = {})
842
+ if @api_client.config.debugging
843
+ @api_client.config.logger.debug "Calling API: HierarchyApi.replace_node ..."
844
+ end
845
+
846
+
847
+ # verify the required parameter 'namespace' is set
848
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.replace_node" if namespace.nil?
849
+
850
+
851
+
852
+
853
+
854
+
855
+ # verify the required parameter 'id' is set
856
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.replace_node" if id.nil?
857
+
858
+
859
+
860
+
861
+
862
+
863
+ # verify the required parameter 'body' is set
864
+ fail ArgumentError, "Missing the required parameter 'body' when calling HierarchyApi.replace_node" if body.nil?
865
+
866
+
867
+
868
+
869
+
870
+
871
+ # verify the required parameter 'type' is set
872
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.replace_node" if type.nil?
873
+
874
+
875
+
876
+
877
+
878
+ # resource path
879
+ local_var_path = "/{namespace}/nodes/{type}/{id}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'id' + '}', id.to_s).sub('{' + 'type' + '}', type.to_s)
880
+
881
+ # query parameters
882
+ query_params = {}
883
+
884
+ # header parameters
885
+ header_params = {}
886
+
887
+ # HTTP header 'Accept' (if needed)
888
+ local_header_accept = ['application/vnd.api+json']
889
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
890
+
891
+ # HTTP header 'Content-Type'
892
+ local_header_content_type = ['application/json']
893
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
894
+
895
+ # form parameters
896
+ form_params = {}
897
+
898
+ # http body (model)
899
+ post_body = @api_client.object_to_http_body(body)
900
+
901
+ auth_names = ['oauth2']
902
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
903
+ :header_params => header_params,
904
+ :query_params => query_params,
905
+ :form_params => form_params,
906
+ :body => post_body,
907
+ :auth_names => auth_names,
908
+ :return_type => 'NodeBody')
909
+ if @api_client.config.debugging
910
+ @api_client.config.logger.debug "API called: HierarchyApi#replace_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
911
+ end
912
+ return data, status_code, headers
913
+ end
914
+
915
+ # Search nodes
916
+ # This endpoint is a really flexible way to ask questions about the hierarchy. for example:\n\n###### Find all nodes for abc:\n`/1/abc/nodes`\n\n###### Find all modules for abc:\n`/1/abc/nodes?filter[nodeType]=Module`\n\n###### Find all nodes that are descendants of DEP101:\n`/1/abc/nodes?filter[descendant]=department%2Fdep101`\n\n###### Find all Departments that are ancestors of ABF203:\n`/1/abc/nodes?filter[descendant]=module%2Fabf203&filter[nodeType]=Department` # <= case insensitive\n\n###### Find all nodes with list assets that are descendants of DEP101 for abc:\n`/1/abc/nodes?filter[nodeType]=Module&filter[ancestor]=department%2FDEP101&filter[hasAssets]=true&filter[assetType]=List`\n\n###### Globally, find all modules that have no list assets\n`/1/global/nodes?filter[nodeType]=Module&filter[hasAssets]=false&filter[assetType]=List`\n\n###### Find all nodes of type time period valid during 2015 that have no list assets. Note a node's valid_from/valid_to just need to overlap from/to to qualify\n`/1/global/nodes?filter[nodeType]=TimePeriod&filter[hasAssets]=false&filter[assetType]=List&filter[from]=20150101&filter[to]=20151231`\n
917
+ # @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
918
+ # @param [Hash] opts the optional parameters
919
+ # @option opts [Float] :offset index to start result set from
920
+ # @option opts [Float] :limit number of records to return
921
+ # @option opts [String] :filter_node_type type of nodes to return
922
+ # @option opts [String] :filter_child limit to nodes with children matching code
923
+ # @option opts [String] :filter_parent limit to nodes with parent matching code
924
+ # @option opts [String] :filter_ancestor limit to nodes with ancestor matching code
925
+ # @option opts [String] :filter_descendant limit to nodes with descendant matching code
926
+ # @option opts [BOOLEAN] :filter_has_assets limit to either nodes that have assets (true) nodes that have no assets (false) or omit to consider both nodes with and without assets
927
+ # @option opts [String] :filter_asset_type type of asset to return
928
+ # @option opts [Date] :filter_from limit to results valid after this date, format is ISO8601 date
929
+ # @option opts [Date] :filter_to limit to results valid before this date, format is ISO8601
930
+ # @return [NodeResultSet]
931
+ def search_nodes(namespace_inc_global, opts = {})
932
+ data, _status_code, _headers = search_nodes_with_http_info(namespace_inc_global, opts)
933
+ return data
934
+ end
935
+
936
+ # Search nodes
937
+ # This endpoint is a really flexible way to ask questions about the hierarchy. for example:\n\n###### Find all nodes for abc:\n`/1/abc/nodes`\n\n###### Find all modules for abc:\n`/1/abc/nodes?filter[nodeType]=Module`\n\n###### Find all nodes that are descendants of DEP101:\n`/1/abc/nodes?filter[descendant]=department%2Fdep101`\n\n###### Find all Departments that are ancestors of ABF203:\n`/1/abc/nodes?filter[descendant]=module%2Fabf203&amp;filter[nodeType]=Department` # &lt;= case insensitive\n\n###### Find all nodes with list assets that are descendants of DEP101 for abc:\n`/1/abc/nodes?filter[nodeType]=Module&amp;filter[ancestor]=department%2FDEP101&amp;filter[hasAssets]=true&amp;filter[assetType]=List`\n\n###### Globally, find all modules that have no list assets\n`/1/global/nodes?filter[nodeType]=Module&amp;filter[hasAssets]=false&amp;filter[assetType]=List`\n\n###### Find all nodes of type time period valid during 2015 that have no list assets. Note a node&#39;s valid_from/valid_to just need to overlap from/to to qualify\n`/1/global/nodes?filter[nodeType]=TimePeriod&amp;filter[hasAssets]=false&amp;filter[assetType]=List&amp;filter[from]=20150101&amp;filter[to]=20151231`\n
938
+ # @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
939
+ # @param [Hash] opts the optional parameters
940
+ # @option opts [Float] :offset index to start result set from
941
+ # @option opts [Float] :limit number of records to return
942
+ # @option opts [String] :filter_node_type type of nodes to return
943
+ # @option opts [String] :filter_child limit to nodes with children matching code
944
+ # @option opts [String] :filter_parent limit to nodes with parent matching code
945
+ # @option opts [String] :filter_ancestor limit to nodes with ancestor matching code
946
+ # @option opts [String] :filter_descendant limit to nodes with descendant matching code
947
+ # @option opts [BOOLEAN] :filter_has_assets limit to either nodes that have assets (true) nodes that have no assets (false) or omit to consider both nodes with and without assets
948
+ # @option opts [String] :filter_asset_type type of asset to return
949
+ # @option opts [Date] :filter_from limit to results valid after this date, format is ISO8601 date
950
+ # @option opts [Date] :filter_to limit to results valid before this date, format is ISO8601
951
+ # @return [Array<(NodeResultSet, Fixnum, Hash)>] NodeResultSet data, response status code and response headers
952
+ def search_nodes_with_http_info(namespace_inc_global, opts = {})
953
+ if @api_client.config.debugging
954
+ @api_client.config.logger.debug "Calling API: HierarchyApi.search_nodes ..."
955
+ end
956
+
957
+
958
+ # verify the required parameter 'namespace_inc_global' is set
959
+ fail ArgumentError, "Missing the required parameter 'namespace_inc_global' when calling HierarchyApi.search_nodes" if namespace_inc_global.nil?
960
+
961
+
962
+
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+ # resource path
1032
+ local_var_path = "/{namespaceIncGlobal}/nodes".sub('{format}','json').sub('{' + 'namespaceIncGlobal' + '}', namespace_inc_global.to_s)
1033
+
1034
+ # query parameters
1035
+ query_params = {}
1036
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
1037
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1038
+ query_params[:'filter[nodeType]'] = opts[:'filter_node_type'] if opts[:'filter_node_type']
1039
+ query_params[:'filter[child]'] = opts[:'filter_child'] if opts[:'filter_child']
1040
+ query_params[:'filter[parent]'] = opts[:'filter_parent'] if opts[:'filter_parent']
1041
+ query_params[:'filter[ancestor]'] = opts[:'filter_ancestor'] if opts[:'filter_ancestor']
1042
+ query_params[:'filter[descendant]'] = opts[:'filter_descendant'] if opts[:'filter_descendant']
1043
+ query_params[:'filter[hasAssets]'] = opts[:'filter_has_assets'] if opts[:'filter_has_assets']
1044
+ query_params[:'filter[assetType]'] = opts[:'filter_asset_type'] if opts[:'filter_asset_type']
1045
+ query_params[:'filter[from]'] = opts[:'filter_from'] if opts[:'filter_from']
1046
+ query_params[:'filter[to]'] = opts[:'filter_to'] if opts[:'filter_to']
1047
+
1048
+ # header parameters
1049
+ header_params = {}
1050
+
1051
+ # HTTP header 'Accept' (if needed)
1052
+ local_header_accept = ['application/vnd.api+json']
1053
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1054
+
1055
+ # HTTP header 'Content-Type'
1056
+ local_header_content_type = ['application/json']
1057
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1058
+
1059
+ # form parameters
1060
+ form_params = {}
1061
+
1062
+ # http body (model)
1063
+ post_body = nil
1064
+
1065
+ auth_names = ['oauth2']
1066
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1067
+ :header_params => header_params,
1068
+ :query_params => query_params,
1069
+ :form_params => form_params,
1070
+ :body => post_body,
1071
+ :auth_names => auth_names,
1072
+ :return_type => 'NodeResultSet')
1073
+ if @api_client.config.debugging
1074
+ @api_client.config.logger.debug "API called: HierarchyApi#search_nodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1075
+ end
1076
+ return data, status_code, headers
1077
+ end
1078
+
1079
+ #
1080
+ # Perform a partial update of a node
1081
+ # @param namespace identifier namespacing the blueprint.
1082
+ # @param id id identifying a domain model
1083
+ # @param body node
1084
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
1085
+ # @param [Hash] opts the optional parameters
1086
+ # @return [NodeBody]
1087
+ def update_node(namespace, id, body, type, opts = {})
1088
+ data, _status_code, _headers = update_node_with_http_info(namespace, id, body, type, opts)
1089
+ return data
1090
+ end
1091
+
1092
+ #
1093
+ # Perform a partial update of a node
1094
+ # @param namespace identifier namespacing the blueprint.
1095
+ # @param id id identifying a domain model
1096
+ # @param body node
1097
+ # @param type Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals
1098
+ # @param [Hash] opts the optional parameters
1099
+ # @return [Array<(NodeBody, Fixnum, Hash)>] NodeBody data, response status code and response headers
1100
+ def update_node_with_http_info(namespace, id, body, type, opts = {})
1101
+ if @api_client.config.debugging
1102
+ @api_client.config.logger.debug "Calling API: HierarchyApi.update_node ..."
1103
+ end
1104
+
1105
+
1106
+ # verify the required parameter 'namespace' is set
1107
+ fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.update_node" if namespace.nil?
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+ # verify the required parameter 'id' is set
1115
+ fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.update_node" if id.nil?
1116
+
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+ # verify the required parameter 'body' is set
1123
+ fail ArgumentError, "Missing the required parameter 'body' when calling HierarchyApi.update_node" if body.nil?
1124
+
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+ # verify the required parameter 'type' is set
1131
+ fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.update_node" if type.nil?
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+ # resource path
1138
+ local_var_path = "/{namespace}/nodes/{type}/{id}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'id' + '}', id.to_s).sub('{' + 'type' + '}', type.to_s)
1139
+
1140
+ # query parameters
1141
+ query_params = {}
1142
+
1143
+ # header parameters
1144
+ header_params = {}
1145
+
1146
+ # HTTP header 'Accept' (if needed)
1147
+ local_header_accept = ['application/vnd.api+json']
1148
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1149
+
1150
+ # HTTP header 'Content-Type'
1151
+ local_header_content_type = ['application/json']
1152
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1153
+
1154
+ # form parameters
1155
+ form_params = {}
1156
+
1157
+ # http body (model)
1158
+ post_body = @api_client.object_to_http_body(body)
1159
+
1160
+ auth_names = ['oauth2']
1161
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
1162
+ :header_params => header_params,
1163
+ :query_params => query_params,
1164
+ :form_params => form_params,
1165
+ :body => post_body,
1166
+ :auth_names => auth_names,
1167
+ :return_type => 'NodeBody')
1168
+ if @api_client.config.debugging
1169
+ @api_client.config.logger.debug "API called: HierarchyApi#update_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1170
+ end
1171
+ return data, status_code, headers
1172
+ end
1173
+ end
1174
+ end