Class: BlueprintClient::HierarchyApi
- Inherits:
-
Object
- Object
- BlueprintClient::HierarchyApi
- Defined in:
- lib/blueprint_ruby_client/api/hierarchy_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_node(namespace_inc_global, body, opts = {}) ⇒ NodeBody
Add a node.
-
#add_node_with_http_info(namespace_inc_global, body, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Add a node.
-
#bulk_upload(namespace, opts = {}) ⇒ nil
Send operations to modify nodes in bulk, to be applied/rejected as a single transaction.
-
#bulk_upload_with_http_info(namespace, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Send operations to modify nodes in bulk, to be applied/rejected as a single transaction.
-
#delete_node(namespace, id, type, opts = {}) ⇒ nil
Delete a node.
-
#delete_node_with_http_info(namespace, id, type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a node.
-
#export_hierarchy(namespace, opts = {}) ⇒ nil
Download the blueprint’s nodes in CSV format Format will be: OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS OLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importer.
-
#export_hierarchy_with_http_info(namespace, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Download the blueprint's nodes in CSV format Format will be: OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS OLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importer.
-
#get_ancestors(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get ancestor nodes A proxy for finding ancestors of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`.
-
#get_ancestors_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get ancestor nodes A proxy for finding ancestors of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`.
-
#get_children(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get child nodes A proxy for finding children of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`.
-
#get_children_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get child nodes A proxy for finding children of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`.
-
#get_descendants(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get descendant nodes A proxy for finding descendants of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`.
-
#get_descendants_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get descendant nodes A proxy for finding descendants of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`.
-
#get_node(namespace, id, type, opts = {}) ⇒ NodeBody
Get details of a given node.
-
#get_node_with_http_info(namespace, id, type, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Get details of a given node.
-
#get_parents(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get parent nodes A proxy for finding parents of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`.
-
#get_parents_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get parent nodes A proxy for finding parents of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`.
-
#initialize(api_client = ApiClient.default) ⇒ HierarchyApi
constructor
A new instance of HierarchyApi.
-
#replace_node(namespace, id, body, type, opts = {}) ⇒ NodeBody
Replaces the node with the data sent in the body.
-
#replace_node_with_http_info(namespace, id, body, type, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Replaces the node with the data sent in the body.
-
#search_nodes(namespace_inc_global, opts = {}) ⇒ NodeResultSet
Search nodes This endpoint is a really flexible way to ask questions about the hierarchy.
-
#search_nodes_with_http_info(namespace_inc_global, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Search nodes This endpoint is a really flexible way to ask questions about the hierarchy.
-
#update_node(namespace, id, body, type, opts = {}) ⇒ NodeBody
Perform a partial update of a node.
-
#update_node_with_http_info(namespace, id, body, type, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Perform a partial update of a node.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ HierarchyApi
Returns a new instance of HierarchyApi.
19 20 21 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_node(namespace_inc_global, body, opts = {}) ⇒ NodeBody
Add a node
29 30 31 32 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 29 def add_node(namespace_inc_global, body, opts = {}) data, _status_code, _headers = add_node_with_http_info(namespace_inc_global, body, opts) return data end |
#add_node_with_http_info(namespace_inc_global, body, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Add a node
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 40 def add_node_with_http_info(namespace_inc_global, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.add_node ..." end # verify the required parameter 'namespace_inc_global' is set fail ArgumentError, "Missing the required parameter 'namespace_inc_global' when calling HierarchyApi.add_node" if namespace_inc_global.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling HierarchyApi.add_node" if body.nil? # resource path local_var_path = "/{namespaceIncGlobal}/nodes".sub('{format}','json').sub('{' + 'namespaceIncGlobal' + '}', namespace_inc_global.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] 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 => 'NodeBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#add_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#bulk_upload(namespace, opts = {}) ⇒ nil
Send operations to modify nodes in bulk, to be applied/rejected as a single transaction. Format will be: OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS
89 90 91 92 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 89 def bulk_upload(namespace, opts = {}) bulk_upload_with_http_info(namespace, opts) return nil end |
#bulk_upload_with_http_info(namespace, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Send operations to modify nodes in bulk, to be applied/rejected as a single transaction. Format will be: OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS
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 132 133 134 135 136 137 138 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 99 def bulk_upload_with_http_info(namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.bulk_upload ..." end # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.bulk_upload" if namespace.nil? # resource path local_var_path = "/{namespace}/nodes.csv".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['text/plain', 'application/octet-stream'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#bulk_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_node(namespace, id, type, opts = {}) ⇒ nil
Delete a node
147 148 149 150 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 147 def delete_node(namespace, id, type, opts = {}) delete_node_with_http_info(namespace, id, type, opts) return nil end |
#delete_node_with_http_info(namespace, id, type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a node
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 159 def delete_node_with_http_info(namespace, id, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.delete_node ..." end # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.delete_node" if namespace.nil? # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.delete_node" if id.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.delete_node" if type.nil? # resource path 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) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, 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: HierarchyApi#delete_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#export_hierarchy(namespace, opts = {}) ⇒ nil
Download the blueprint’s nodes in CSV format Format will be: OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS OLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importer
209 210 211 212 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 209 def export_hierarchy(namespace, opts = {}) export_hierarchy_with_http_info(namespace, opts) return nil end |
#export_hierarchy_with_http_info(namespace, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Download the blueprint's nodes in CSV format Format will be: OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERS OLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importer
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 219 def export_hierarchy_with_http_info(namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.export_hierarchy ..." end # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.export_hierarchy" if namespace.nil? # resource path local_var_path = "/{namespace}/nodes.csv".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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: HierarchyApi#export_hierarchy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ancestors(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get ancestor nodes A proxy for finding ancestors of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`
269 270 271 272 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 269 def get_ancestors(id, namespace, type, opts = {}) data, _status_code, _headers = get_ancestors_with_http_info(id, namespace, type, opts) return data end |
#get_ancestors_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get ancestor nodes A proxy for finding ancestors of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 283 def get_ancestors_with_http_info(id, namespace, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.get_ancestors ..." end # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_ancestors" if id.nil? # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_ancestors" if namespace.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_ancestors" if type.nil? # resource path 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) # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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 => 'NodeResultSet') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#get_ancestors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_children(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get child nodes A proxy for finding children of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`
340 341 342 343 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 340 def get_children(id, namespace, type, opts = {}) data, _status_code, _headers = get_children_with_http_info(id, namespace, type, opts) return data end |
#get_children_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get child nodes A proxy for finding children of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`
354 355 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 399 400 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 354 def get_children_with_http_info(id, namespace, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.get_children ..." end # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_children" if id.nil? # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_children" if namespace.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_children" if type.nil? # resource path 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) # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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 => 'NodeResultSet') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#get_children\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_descendants(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get descendant nodes A proxy for finding descendants of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`
411 412 413 414 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 411 def get_descendants(id, namespace, type, opts = {}) data, _status_code, _headers = get_descendants_with_http_info(id, namespace, type, opts) return data end |
#get_descendants_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get descendant nodes A proxy for finding descendants of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`
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 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 425 def get_descendants_with_http_info(id, namespace, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.get_descendants ..." end # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_descendants" if id.nil? # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_descendants" if namespace.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_descendants" if type.nil? # resource path 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) # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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 => 'NodeResultSet') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#get_descendants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_node(namespace, id, type, opts = {}) ⇒ NodeBody
Get details of a given node
481 482 483 484 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 481 def get_node(namespace, id, type, opts = {}) data, _status_code, _headers = get_node_with_http_info(namespace, id, type, opts) return data end |
#get_node_with_http_info(namespace, id, type, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Get details of a given node
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 535 536 537 538 539 540 541 542 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 494 def get_node_with_http_info(namespace, id, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.get_node ..." end # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_node" if namespace.nil? # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_node" if id.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_node" if type.nil? if opts[:'include'] && !['children', 'parents', 'assets'].include?(opts[:'include']) fail ArgumentError, 'invalid value for "include", must be one of children, parents, assets' end # resource path 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) # query parameters query_params = {} query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if opts[:'include'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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 => 'NodeBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#get_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_parents(id, namespace, type, opts = {}) ⇒ NodeResultSet
Get parent nodes A proxy for finding parents of a given node, equivalent to ‘/1/abc/nodes?filter=department%2Fdep101`
553 554 555 556 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 553 def get_parents(id, namespace, type, opts = {}) data, _status_code, _headers = get_parents_with_http_info(id, namespace, type, opts) return data end |
#get_parents_with_http_info(id, namespace, type, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Get parent nodes A proxy for finding parents of a given node, equivalent to `/1/abc/nodes?filter=department%2Fdep101`
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 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 567 def get_parents_with_http_info(id, namespace, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.get_parents ..." end # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.get_parents" if id.nil? # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.get_parents" if namespace.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.get_parents" if type.nil? # resource path 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) # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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 => 'NodeResultSet') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#get_parents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#replace_node(namespace, id, body, type, opts = {}) ⇒ NodeBody
Replaces the node with the data sent in the body
623 624 625 626 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 623 def replace_node(namespace, id, body, type, opts = {}) data, _status_code, _headers = replace_node_with_http_info(namespace, id, body, type, opts) return data end |
#replace_node_with_http_info(namespace, id, body, type, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Replaces the node with the data sent in the body
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 636 def replace_node_with_http_info(namespace, id, body, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.replace_node ..." end # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.replace_node" if namespace.nil? # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.replace_node" if id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling HierarchyApi.replace_node" if body.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.replace_node" if type.nil? # resource path 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) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#replace_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search_nodes(namespace_inc_global, opts = {}) ⇒ NodeResultSet
Search nodes This endpoint is a really flexible way to ask questions about the hierarchy. for example: ###### Find all nodes for abc: ‘/1/abc/nodes` ###### Find all modules for abc: `/1/abc/nodes?filter=Modules` ###### Find all nodes that are descendants of DEP101: `/1/abc/nodes?filter=departments%2Fdep101` ###### Find all Departments that are ancestors of ABF203: `/1/abc/nodes?filter=modules%2Fabf203&filter=Departments` # <= case insensitive ###### Find all nodes with list assets that are descendants of DEP101 for abc: `/1/abc/nodes?filter=Modules&filter=departments%2FDEP101&filter=true&filter=Lists` ###### Globally, find all modules that have no list assets `/1/global/nodes?filter=Modules&filter=false&filter=Lists` ###### Find all nodes of type modules during 2015 that have no assets. Note a node’s valid_from/valid_to just need to overlap from/to to qualify ‘/1/global/nodes?filter=Modules&filter=false&filter=20150101&filter=20151231`
706 707 708 709 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 706 def search_nodes(namespace_inc_global, opts = {}) data, _status_code, _headers = search_nodes_with_http_info(namespace_inc_global, opts) return data end |
#search_nodes_with_http_info(namespace_inc_global, opts = {}) ⇒ Array<(NodeResultSet, Fixnum, Hash)>
Search nodes This endpoint is a really flexible way to ask questions about the hierarchy. for example: ###### Find all nodes for abc: `/1/abc/nodes` ###### Find all modules for abc: `/1/abc/nodes?filter=Modules` ###### Find all nodes that are descendants of DEP101: `/1/abc/nodes?filter=departments%2Fdep101` ###### Find all Departments that are ancestors of ABF203: `/1/abc/nodes?filter=modules%2Fabf203&filter=Departments` # <= case insensitive ###### Find all nodes with list assets that are descendants of DEP101 for abc: `/1/abc/nodes?filter=Modules&filter=departments%2FDEP101&filter=true&filter=Lists` ###### Globally, find all modules that have no list assets `/1/global/nodes?filter=Modules&filter=false&filter=Lists` ###### Find all nodes of type modules during 2015 that have no assets. Note a node's valid_from/valid_to just need to overlap from/to to qualify `/1/global/nodes?filter=Modules&filter=false&filter=20150101&filter=20151231`
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 733 def search_nodes_with_http_info(namespace_inc_global, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.search_nodes ..." end # verify the required parameter 'namespace_inc_global' is set fail ArgumentError, "Missing the required parameter 'namespace_inc_global' when calling HierarchyApi.search_nodes" if namespace_inc_global.nil? if opts[:'include'] && !['children', 'parents', 'assets'].include?(opts[:'include']) fail ArgumentError, 'invalid value for "include", must be one of children, parents, assets' end # resource path local_var_path = "/{namespaceIncGlobal}/nodes".sub('{format}','json').sub('{' + 'namespaceIncGlobal' + '}', namespace_inc_global.to_s) # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if opts[:'include'] query_params[:'filter[nodeType]'] = @api_client.build_collection_param(opts[:'filter_node_type'], :csv) if opts[:'filter_node_type'] query_params[:'filter[child]'] = @api_client.build_collection_param(opts[:'filter_child'], :csv) if opts[:'filter_child'] query_params[:'filter[parent]'] = @api_client.build_collection_param(opts[:'filter_parent'], :csv) if opts[:'filter_parent'] query_params[:'filter[ancestor]'] = @api_client.build_collection_param(opts[:'filter_ancestor'], :csv) if opts[:'filter_ancestor'] query_params[:'filter[descendant]'] = @api_client.build_collection_param(opts[:'filter_descendant'], :csv) if opts[:'filter_descendant'] query_params[:'filter[hasAssets]'] = opts[:'filter_has_assets'] if opts[:'filter_has_assets'] query_params[:'filter[assetType]'] = @api_client.build_collection_param(opts[:'filter_asset_type'], :csv) if opts[:'filter_asset_type'] query_params[:'filter[from]'] = opts[:'filter_from'] if opts[:'filter_from'] query_params[:'filter[to]'] = opts[:'filter_to'] if opts[:'filter_to'] query_params[:'q[node]'] = opts[:'q_node'] if opts[:'q_node'] query_params[:'q[child]'] = opts[:'q_child'] if opts[:'q_child'] query_params[:'q[parent]'] = opts[:'q_parent'] if opts[:'q_parent'] query_params[:'q[descendant]'] = opts[:'q_descendant'] if opts[:'q_descendant'] query_params[:'q[ancestor]'] = opts[:'q_ancestor'] if opts[:'q_ancestor'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] 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 => 'NodeResultSet') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#search_nodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_node(namespace, id, body, type, opts = {}) ⇒ NodeBody
Perform a partial update of a node
803 804 805 806 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 803 def update_node(namespace, id, body, type, opts = {}) data, _status_code, _headers = update_node_with_http_info(namespace, id, body, type, opts) return data end |
#update_node_with_http_info(namespace, id, body, type, opts = {}) ⇒ Array<(NodeBody, Fixnum, Hash)>
Perform a partial update of a node
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 |
# File 'lib/blueprint_ruby_client/api/hierarchy_api.rb', line 816 def update_node_with_http_info(namespace, id, body, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.update_node ..." end # verify the required parameter 'namespace' is set fail ArgumentError, "Missing the required parameter 'namespace' when calling HierarchyApi.update_node" if namespace.nil? # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling HierarchyApi.update_node" if id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling HierarchyApi.update_node" if body.nil? # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling HierarchyApi.update_node" if type.nil? # resource path 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) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/vnd.api+json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NodeBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: HierarchyApi#update_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |