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
data/docs/Error.md ADDED
@@ -0,0 +1,10 @@
1
+ # BlueprintClient::Error
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **Float** | |
7
+ **title** | **String** | |
8
+ **detail** | **String** | | [optional]
9
+
10
+
data/docs/Errors.md ADDED
@@ -0,0 +1,8 @@
1
+ # BlueprintClient::Errors
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **errors** | [**Array<Error>**](Error.md) | | [optional]
7
+
8
+
@@ -0,0 +1,745 @@
1
+ # BlueprintClient::HierarchyApi
2
+
3
+ All URIs are relative to *http://localhost:10010/1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**add_node**](HierarchyApi.md#add_node) | **POST** /{namespaceIncGlobal}/nodes |
8
+ [**bulk_upload**](HierarchyApi.md#bulk_upload) | **POST** /{namespace}/nodes.csv |
9
+ [**delete_node**](HierarchyApi.md#delete_node) | **DELETE** /{namespace}/nodes/{type}/{id} |
10
+ [**export_hierarchy**](HierarchyApi.md#export_hierarchy) | **GET** /{namespace}/nodes.csv |
11
+ [**get_ancestors**](HierarchyApi.md#get_ancestors) | **GET** /{namespace}/nodes/{type}/{id}/ancestors | Get ancestor nodes
12
+ [**get_children**](HierarchyApi.md#get_children) | **GET** /{namespace}/nodes/{type}/{id}/children | Get child nodes
13
+ [**get_descendants**](HierarchyApi.md#get_descendants) | **GET** /{namespace}/nodes/{type}/{id}/descendants | Get descendant nodes
14
+ [**get_node**](HierarchyApi.md#get_node) | **GET** /{namespace}/nodes/{type}/{id} |
15
+ [**get_parents**](HierarchyApi.md#get_parents) | **GET** /{namespace}/nodes/{type}/{id}/parents | Get parent nodes
16
+ [**replace_node**](HierarchyApi.md#replace_node) | **PUT** /{namespace}/nodes/{type}/{id} |
17
+ [**search_nodes**](HierarchyApi.md#search_nodes) | **GET** /{namespaceIncGlobal}/nodes | Search nodes
18
+ [**update_node**](HierarchyApi.md#update_node) | **PATCH** /{namespace}/nodes/{type}/{id} |
19
+
20
+
21
+ # **add_node**
22
+ > NodeBody add_node(namespace_inc_global, body, )
23
+
24
+
25
+
26
+ Add a node
27
+
28
+ ### Example
29
+ ```ruby
30
+ # load the gem
31
+ require 'blueprint_ruby_client'
32
+ # setup authorization
33
+ BlueprintClient.configure do |config|
34
+ # Configure OAuth2 access token for authorization: oauth2
35
+ config.access_token = 'YOUR ACCESS TOKEN'
36
+ end
37
+
38
+ api_instance = BlueprintClient::HierarchyApi.new
39
+
40
+ namespace_inc_global = "namespace_inc_global_example" # String | identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
41
+
42
+ body = BlueprintClient::NodeBody.new # NodeBody | node
43
+
44
+
45
+ begin
46
+ result = api_instance.add_node(namespace_inc_global, body, )
47
+ p result
48
+ rescue BlueprintClient::ApiError => e
49
+ puts "Exception when calling HierarchyApi->add_node: #{e}"
50
+ end
51
+ ```
52
+
53
+ ### Parameters
54
+
55
+ Name | Type | Description | Notes
56
+ ------------- | ------------- | ------------- | -------------
57
+ **namespace_inc_global** | **String**| identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. |
58
+ **body** | [**NodeBody**](NodeBody.md)| node |
59
+
60
+ ### Return type
61
+
62
+ [**NodeBody**](NodeBody.md)
63
+
64
+ ### Authorization
65
+
66
+ [oauth2](../README.md#oauth2)
67
+
68
+ ### HTTP request headers
69
+
70
+ - **Content-Type**: application/json
71
+ - **Accept**: application/vnd.api+json
72
+
73
+
74
+
75
+ # **bulk_upload**
76
+ > bulk_upload(namespace, )
77
+
78
+
79
+
80
+ 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
81
+
82
+ ### Example
83
+ ```ruby
84
+ # load the gem
85
+ require 'blueprint_ruby_client'
86
+ # setup authorization
87
+ BlueprintClient.configure do |config|
88
+ # Configure OAuth2 access token for authorization: oauth2
89
+ config.access_token = 'YOUR ACCESS TOKEN'
90
+ end
91
+
92
+ api_instance = BlueprintClient::HierarchyApi.new
93
+
94
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
95
+
96
+
97
+ begin
98
+ api_instance.bulk_upload(namespace, )
99
+ rescue BlueprintClient::ApiError => e
100
+ puts "Exception when calling HierarchyApi->bulk_upload: #{e}"
101
+ end
102
+ ```
103
+
104
+ ### Parameters
105
+
106
+ Name | Type | Description | Notes
107
+ ------------- | ------------- | ------------- | -------------
108
+ **namespace** | **String**| identifier namespacing the blueprint. |
109
+
110
+ ### Return type
111
+
112
+ nil (empty response body)
113
+
114
+ ### Authorization
115
+
116
+ [oauth2](../README.md#oauth2)
117
+
118
+ ### HTTP request headers
119
+
120
+ - **Content-Type**: text/plain, application/octet-stream
121
+ - **Accept**: application/vnd.api+json
122
+
123
+
124
+
125
+ # **delete_node**
126
+ > delete_node(namespace, id, type)
127
+
128
+
129
+
130
+ Delete a node
131
+
132
+ ### Example
133
+ ```ruby
134
+ # load the gem
135
+ require 'blueprint_ruby_client'
136
+ # setup authorization
137
+ BlueprintClient.configure do |config|
138
+ # Configure OAuth2 access token for authorization: oauth2
139
+ config.access_token = 'YOUR ACCESS TOKEN'
140
+ end
141
+
142
+ api_instance = BlueprintClient::HierarchyApi.new
143
+
144
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
145
+
146
+ id = "id_example" # String | id identifying a domain model
147
+
148
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
149
+
150
+
151
+ begin
152
+ api_instance.delete_node(namespace, id, type)
153
+ rescue BlueprintClient::ApiError => e
154
+ puts "Exception when calling HierarchyApi->delete_node: #{e}"
155
+ end
156
+ ```
157
+
158
+ ### Parameters
159
+
160
+ Name | Type | Description | Notes
161
+ ------------- | ------------- | ------------- | -------------
162
+ **namespace** | **String**| identifier namespacing the blueprint. |
163
+ **id** | **String**| id identifying a domain model |
164
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
165
+
166
+ ### Return type
167
+
168
+ nil (empty response body)
169
+
170
+ ### Authorization
171
+
172
+ [oauth2](../README.md#oauth2)
173
+
174
+ ### HTTP request headers
175
+
176
+ - **Content-Type**: application/json
177
+ - **Accept**: application/vnd.api+json
178
+
179
+
180
+
181
+ # **export_hierarchy**
182
+ > export_hierarchy(namespace, )
183
+
184
+
185
+
186
+ 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
187
+
188
+ ### Example
189
+ ```ruby
190
+ # load the gem
191
+ require 'blueprint_ruby_client'
192
+ # setup authorization
193
+ BlueprintClient.configure do |config|
194
+ # Configure OAuth2 access token for authorization: oauth2
195
+ config.access_token = 'YOUR ACCESS TOKEN'
196
+ end
197
+
198
+ api_instance = BlueprintClient::HierarchyApi.new
199
+
200
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
201
+
202
+
203
+ begin
204
+ api_instance.export_hierarchy(namespace, )
205
+ rescue BlueprintClient::ApiError => e
206
+ puts "Exception when calling HierarchyApi->export_hierarchy: #{e}"
207
+ end
208
+ ```
209
+
210
+ ### Parameters
211
+
212
+ Name | Type | Description | Notes
213
+ ------------- | ------------- | ------------- | -------------
214
+ **namespace** | **String**| identifier namespacing the blueprint. |
215
+
216
+ ### Return type
217
+
218
+ nil (empty response body)
219
+
220
+ ### Authorization
221
+
222
+ [oauth2](../README.md#oauth2)
223
+
224
+ ### HTTP request headers
225
+
226
+ - **Content-Type**: application/json
227
+ - **Accept**: application/vnd.api+json
228
+
229
+
230
+
231
+ # **get_ancestors**
232
+ > NodeResultSet get_ancestors(id, namespace, type, opts)
233
+
234
+ Get ancestor nodes
235
+
236
+ A proxy for finding ancestors of a given node, equivalent to\n`/1/abc/nodes?filter[descendant]=department%2Fdep101`\n
237
+
238
+ ### Example
239
+ ```ruby
240
+ # load the gem
241
+ require 'blueprint_ruby_client'
242
+ # setup authorization
243
+ BlueprintClient.configure do |config|
244
+ # Configure OAuth2 access token for authorization: oauth2
245
+ config.access_token = 'YOUR ACCESS TOKEN'
246
+ end
247
+
248
+ api_instance = BlueprintClient::HierarchyApi.new
249
+
250
+ id = "id_example" # String | id identifying a domain model
251
+
252
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
253
+
254
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
255
+
256
+ opts = {
257
+ offset: 3.4, # Float | index to start result set from
258
+ limit: 3.4 # Float | number of records to return
259
+ }
260
+
261
+ begin
262
+ #Get ancestor nodes
263
+ result = api_instance.get_ancestors(id, namespace, type, opts)
264
+ p result
265
+ rescue BlueprintClient::ApiError => e
266
+ puts "Exception when calling HierarchyApi->get_ancestors: #{e}"
267
+ end
268
+ ```
269
+
270
+ ### Parameters
271
+
272
+ Name | Type | Description | Notes
273
+ ------------- | ------------- | ------------- | -------------
274
+ **id** | **String**| id identifying a domain model |
275
+ **namespace** | **String**| identifier namespacing the blueprint. |
276
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
277
+ **offset** | [**Float**](.md)| index to start result set from | [optional]
278
+ **limit** | [**Float**](.md)| number of records to return | [optional]
279
+
280
+ ### Return type
281
+
282
+ [**NodeResultSet**](NodeResultSet.md)
283
+
284
+ ### Authorization
285
+
286
+ [oauth2](../README.md#oauth2)
287
+
288
+ ### HTTP request headers
289
+
290
+ - **Content-Type**: application/json
291
+ - **Accept**: application/vnd.api+json
292
+
293
+
294
+
295
+ # **get_children**
296
+ > NodeResultSet get_children(id, namespace, type, opts)
297
+
298
+ Get child nodes
299
+
300
+ A proxy for finding children of a given node, equivalent to\n`/1/abc/nodes?filter[parent]=department%2Fdep101`\n
301
+
302
+ ### Example
303
+ ```ruby
304
+ # load the gem
305
+ require 'blueprint_ruby_client'
306
+ # setup authorization
307
+ BlueprintClient.configure do |config|
308
+ # Configure OAuth2 access token for authorization: oauth2
309
+ config.access_token = 'YOUR ACCESS TOKEN'
310
+ end
311
+
312
+ api_instance = BlueprintClient::HierarchyApi.new
313
+
314
+ id = "id_example" # String | id identifying a domain model
315
+
316
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
317
+
318
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
319
+
320
+ opts = {
321
+ offset: 3.4, # Float | index to start result set from
322
+ limit: 3.4 # Float | number of records to return
323
+ }
324
+
325
+ begin
326
+ #Get child nodes
327
+ result = api_instance.get_children(id, namespace, type, opts)
328
+ p result
329
+ rescue BlueprintClient::ApiError => e
330
+ puts "Exception when calling HierarchyApi->get_children: #{e}"
331
+ end
332
+ ```
333
+
334
+ ### Parameters
335
+
336
+ Name | Type | Description | Notes
337
+ ------------- | ------------- | ------------- | -------------
338
+ **id** | **String**| id identifying a domain model |
339
+ **namespace** | **String**| identifier namespacing the blueprint. |
340
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
341
+ **offset** | [**Float**](.md)| index to start result set from | [optional]
342
+ **limit** | [**Float**](.md)| number of records to return | [optional]
343
+
344
+ ### Return type
345
+
346
+ [**NodeResultSet**](NodeResultSet.md)
347
+
348
+ ### Authorization
349
+
350
+ [oauth2](../README.md#oauth2)
351
+
352
+ ### HTTP request headers
353
+
354
+ - **Content-Type**: application/json
355
+ - **Accept**: application/vnd.api+json
356
+
357
+
358
+
359
+ # **get_descendants**
360
+ > NodeResultSet get_descendants(id, namespace, type, opts)
361
+
362
+ Get descendant nodes
363
+
364
+ A proxy for finding descendants of a given node, equivalent to\n`/1/abc/nodes?filter[ancestor]=department%2Fdep101`\n
365
+
366
+ ### Example
367
+ ```ruby
368
+ # load the gem
369
+ require 'blueprint_ruby_client'
370
+ # setup authorization
371
+ BlueprintClient.configure do |config|
372
+ # Configure OAuth2 access token for authorization: oauth2
373
+ config.access_token = 'YOUR ACCESS TOKEN'
374
+ end
375
+
376
+ api_instance = BlueprintClient::HierarchyApi.new
377
+
378
+ id = "id_example" # String | id identifying a domain model
379
+
380
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
381
+
382
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
383
+
384
+ opts = {
385
+ offset: 3.4, # Float | index to start result set from
386
+ limit: 3.4 # Float | number of records to return
387
+ }
388
+
389
+ begin
390
+ #Get descendant nodes
391
+ result = api_instance.get_descendants(id, namespace, type, opts)
392
+ p result
393
+ rescue BlueprintClient::ApiError => e
394
+ puts "Exception when calling HierarchyApi->get_descendants: #{e}"
395
+ end
396
+ ```
397
+
398
+ ### Parameters
399
+
400
+ Name | Type | Description | Notes
401
+ ------------- | ------------- | ------------- | -------------
402
+ **id** | **String**| id identifying a domain model |
403
+ **namespace** | **String**| identifier namespacing the blueprint. |
404
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
405
+ **offset** | [**Float**](.md)| index to start result set from | [optional]
406
+ **limit** | [**Float**](.md)| number of records to return | [optional]
407
+
408
+ ### Return type
409
+
410
+ [**NodeResultSet**](NodeResultSet.md)
411
+
412
+ ### Authorization
413
+
414
+ [oauth2](../README.md#oauth2)
415
+
416
+ ### HTTP request headers
417
+
418
+ - **Content-Type**: application/json
419
+ - **Accept**: application/vnd.api+json
420
+
421
+
422
+
423
+ # **get_node**
424
+ > NodeBody get_node(namespace, id, type, opts)
425
+
426
+
427
+
428
+ Get details of a given node
429
+
430
+ ### Example
431
+ ```ruby
432
+ # load the gem
433
+ require 'blueprint_ruby_client'
434
+ # setup authorization
435
+ BlueprintClient.configure do |config|
436
+ # Configure OAuth2 access token for authorization: oauth2
437
+ config.access_token = 'YOUR ACCESS TOKEN'
438
+ end
439
+
440
+ api_instance = BlueprintClient::HierarchyApi.new
441
+
442
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
443
+
444
+ id = "id_example" # String | id identifying a domain model
445
+
446
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
447
+
448
+ opts = {
449
+ includes: "includes_example" # String | comma separated list of elements to hydrate. Can include children, ancestors or both
450
+ }
451
+
452
+ begin
453
+ #
454
+ result = api_instance.get_node(namespace, id, type, opts)
455
+ p result
456
+ rescue BlueprintClient::ApiError => e
457
+ puts "Exception when calling HierarchyApi->get_node: #{e}"
458
+ end
459
+ ```
460
+
461
+ ### Parameters
462
+
463
+ Name | Type | Description | Notes
464
+ ------------- | ------------- | ------------- | -------------
465
+ **namespace** | **String**| identifier namespacing the blueprint. |
466
+ **id** | **String**| id identifying a domain model |
467
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
468
+ **includes** | **String**| comma separated list of elements to hydrate. Can include children, ancestors or both | [optional]
469
+
470
+ ### Return type
471
+
472
+ [**NodeBody**](NodeBody.md)
473
+
474
+ ### Authorization
475
+
476
+ [oauth2](../README.md#oauth2)
477
+
478
+ ### HTTP request headers
479
+
480
+ - **Content-Type**: application/json
481
+ - **Accept**: application/vnd.api+json
482
+
483
+
484
+
485
+ # **get_parents**
486
+ > NodeResultSet get_parents(id, namespace, type, opts)
487
+
488
+ Get parent nodes
489
+
490
+ A proxy for finding parents of a given node, equivalent to\n`/1/abc/nodes?filter[child]=department%2Fdep101`\n
491
+
492
+ ### Example
493
+ ```ruby
494
+ # load the gem
495
+ require 'blueprint_ruby_client'
496
+ # setup authorization
497
+ BlueprintClient.configure do |config|
498
+ # Configure OAuth2 access token for authorization: oauth2
499
+ config.access_token = 'YOUR ACCESS TOKEN'
500
+ end
501
+
502
+ api_instance = BlueprintClient::HierarchyApi.new
503
+
504
+ id = "id_example" # String | id identifying a domain model
505
+
506
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
507
+
508
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
509
+
510
+ opts = {
511
+ offset: 3.4, # Float | index to start result set from
512
+ limit: 3.4 # Float | number of records to return
513
+ }
514
+
515
+ begin
516
+ #Get parent nodes
517
+ result = api_instance.get_parents(id, namespace, type, opts)
518
+ p result
519
+ rescue BlueprintClient::ApiError => e
520
+ puts "Exception when calling HierarchyApi->get_parents: #{e}"
521
+ end
522
+ ```
523
+
524
+ ### Parameters
525
+
526
+ Name | Type | Description | Notes
527
+ ------------- | ------------- | ------------- | -------------
528
+ **id** | **String**| id identifying a domain model |
529
+ **namespace** | **String**| identifier namespacing the blueprint. |
530
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
531
+ **offset** | [**Float**](.md)| index to start result set from | [optional]
532
+ **limit** | [**Float**](.md)| number of records to return | [optional]
533
+
534
+ ### Return type
535
+
536
+ [**NodeResultSet**](NodeResultSet.md)
537
+
538
+ ### Authorization
539
+
540
+ [oauth2](../README.md#oauth2)
541
+
542
+ ### HTTP request headers
543
+
544
+ - **Content-Type**: application/json
545
+ - **Accept**: application/vnd.api+json
546
+
547
+
548
+
549
+ # **replace_node**
550
+ > NodeBody replace_node(namespace, id, body, type)
551
+
552
+
553
+
554
+ Replaces the node with the data sent in the body
555
+
556
+ ### Example
557
+ ```ruby
558
+ # load the gem
559
+ require 'blueprint_ruby_client'
560
+ # setup authorization
561
+ BlueprintClient.configure do |config|
562
+ # Configure OAuth2 access token for authorization: oauth2
563
+ config.access_token = 'YOUR ACCESS TOKEN'
564
+ end
565
+
566
+ api_instance = BlueprintClient::HierarchyApi.new
567
+
568
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
569
+
570
+ id = "id_example" # String | id identifying a domain model
571
+
572
+ body = BlueprintClient::NodeBody.new # NodeBody | node
573
+
574
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
575
+
576
+
577
+ begin
578
+ #
579
+ result = api_instance.replace_node(namespace, id, body, type)
580
+ p result
581
+ rescue BlueprintClient::ApiError => e
582
+ puts "Exception when calling HierarchyApi->replace_node: #{e}"
583
+ end
584
+ ```
585
+
586
+ ### Parameters
587
+
588
+ Name | Type | Description | Notes
589
+ ------------- | ------------- | ------------- | -------------
590
+ **namespace** | **String**| identifier namespacing the blueprint. |
591
+ **id** | **String**| id identifying a domain model |
592
+ **body** | [**NodeBody**](NodeBody.md)| node |
593
+ **type** | **String**| Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals |
594
+
595
+ ### Return type
596
+
597
+ [**NodeBody**](NodeBody.md)
598
+
599
+ ### Authorization
600
+
601
+ [oauth2](../README.md#oauth2)
602
+
603
+ ### HTTP request headers
604
+
605
+ - **Content-Type**: application/json
606
+ - **Accept**: application/vnd.api+json
607
+
608
+
609
+
610
+ # **search_nodes**
611
+ > NodeResultSet search_nodes(namespace_inc_global, , opts)
612
+
613
+ Search nodes
614
+
615
+ 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
616
+
617
+ ### Example
618
+ ```ruby
619
+ # load the gem
620
+ require 'blueprint_ruby_client'
621
+ # setup authorization
622
+ BlueprintClient.configure do |config|
623
+ # Configure OAuth2 access token for authorization: oauth2
624
+ config.access_token = 'YOUR ACCESS TOKEN'
625
+ end
626
+
627
+ api_instance = BlueprintClient::HierarchyApi.new
628
+
629
+ namespace_inc_global = "namespace_inc_global_example" # String | identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
630
+
631
+ opts = {
632
+ offset: 3.4, # Float | index to start result set from
633
+ limit: 3.4 # Float | number of records to return
634
+ filter_node_type: "filter_node_type_example", # String | type of nodes to return
635
+ filter_child: "filter_child_example", # String | limit to nodes with children matching code
636
+ filter_parent: "filter_parent_example", # String | limit to nodes with parent matching code
637
+ filter_ancestor: "filter_ancestor_example", # String | limit to nodes with ancestor matching code
638
+ filter_descendant: "filter_descendant_example", # String | limit to nodes with descendant matching code
639
+ filter_has_assets: true, # BOOLEAN | limit to either nodes that have assets (true) nodes that have no assets (false) or omit to consider both nodes with and without assets
640
+ filter_asset_type: "filter_asset_type_example", # String | type of asset to return
641
+ filter_from: Date.parse("2013-10-20"), # Date | limit to results valid after this date, format is ISO8601 date
642
+ filter_to: Date.parse("2013-10-20") # Date | limit to results valid before this date, format is ISO8601
643
+ }
644
+
645
+ begin
646
+ #Search nodes
647
+ result = api_instance.search_nodes(namespace_inc_global, , opts)
648
+ p result
649
+ rescue BlueprintClient::ApiError => e
650
+ puts "Exception when calling HierarchyApi->search_nodes: #{e}"
651
+ end
652
+ ```
653
+
654
+ ### Parameters
655
+
656
+ Name | Type | Description | Notes
657
+ ------------- | ------------- | ------------- | -------------
658
+ **namespace_inc_global** | **String**| identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. |
659
+ **offset** | [**Float**](.md)| index to start result set from | [optional]
660
+ **limit** | [**Float**](.md)| number of records to return | [optional]
661
+ **filter_node_type** | **String**| type of nodes to return | [optional]
662
+ **filter_child** | **String**| limit to nodes with children matching code | [optional]
663
+ **filter_parent** | **String**| limit to nodes with parent matching code | [optional]
664
+ **filter_ancestor** | **String**| limit to nodes with ancestor matching code | [optional]
665
+ **filter_descendant** | **String**| limit to nodes with descendant matching code | [optional]
666
+ **filter_has_assets** | **BOOLEAN**| limit to either nodes that have assets (true) nodes that have no assets (false) or omit to consider both nodes with and without assets | [optional]
667
+ **filter_asset_type** | **String**| type of asset to return | [optional]
668
+ **filter_from** | **Date**| limit to results valid after this date, format is ISO8601 date | [optional]
669
+ **filter_to** | **Date**| limit to results valid before this date, format is ISO8601 | [optional]
670
+
671
+ ### Return type
672
+
673
+ [**NodeResultSet**](NodeResultSet.md)
674
+
675
+ ### Authorization
676
+
677
+ [oauth2](../README.md#oauth2)
678
+
679
+ ### HTTP request headers
680
+
681
+ - **Content-Type**: application/json
682
+ - **Accept**: application/vnd.api+json
683
+
684
+
685
+
686
+ # **update_node**
687
+ > NodeBody update_node(namespace, id, body, type)
688
+
689
+
690
+
691
+ Perform a partial update of a node
692
+
693
+ ### Example
694
+ ```ruby
695
+ # load the gem
696
+ require 'blueprint_ruby_client'
697
+ # setup authorization
698
+ BlueprintClient.configure do |config|
699
+ # Configure OAuth2 access token for authorization: oauth2
700
+ config.access_token = 'YOUR ACCESS TOKEN'
701
+ end
702
+
703
+ api_instance = BlueprintClient::HierarchyApi.new
704
+
705
+ namespace = "namespace_example" # String | identifier namespacing the blueprint.
706
+
707
+ id = "id_example" # String | id identifying a domain model
708
+
709
+ body = BlueprintClient::NodeBody.new # NodeBody | node
710
+
711
+ type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals
712
+
713
+
714
+ begin
715
+ result = api_instance.update_node(namespace, id, body, type)
716
+ p result
717
+ rescue BlueprintClient::ApiError => e
718
+ puts "Exception when calling HierarchyApi->update_node: #{e}"
719
+ end
720
+ ```
721
+
722
+ ### Parameters
723
+
724
+ Name | Type | Description | Notes
725
+ ------------- | ------------- | ------------- | -------------
726
+ **namespace** | **String**| identifier namespacing the blueprint. |
727
+ **id** | **String**| id identifying a domain model |
728
+ **body** | [**NodeBody**](NodeBody.md)| node |
729
+ **type** | **String**| Plural form of node type (adds an &#39;s&#39; to the end of the type) todo - allow configuration of plurals |
730
+
731
+ ### Return type
732
+
733
+ [**NodeBody**](NodeBody.md)
734
+
735
+ ### Authorization
736
+
737
+ [oauth2](../README.md#oauth2)
738
+
739
+ ### HTTP request headers
740
+
741
+ - **Content-Type**: application/json
742
+ - **Accept**: application/vnd.api+json
743
+
744
+
745
+