class BlueprintClient::HierarchyApi
Attributes
Public Class Methods
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add a node @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. @param body node @param [Hash] opts the optional parameters @return [NodeBody]
# 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 a node @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. @param body node @param [Hash] opts the optional parameters @return [Array<(NodeBody
, Fixnum, Hash)>] NodeBody
data, response status code and response headers
# 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
Send operations to modify nodes in bulk, to be applied/rejected as a single transaction.nFormat will be:nn OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERSn @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @return [nil]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 103 def bulk_upload(namespace, opts = {}) bulk_upload_with_http_info(namespace, opts) return nil end
Send operations to modify nodes in bulk, to be applied/rejected as a single transaction.nFormat will be:nn OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERSn @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 113 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 a node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @return [nil]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 169 def delete_node(namespace, id, type, opts = {}) delete_node_with_http_info(namespace, id, type, opts) return nil end
Delete a node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 181 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
Delete nodes Delete all nodes belonging to the given namespace. @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. @param [Hash] opts the optional parameters @return [nil]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 251 def delete_nodes(namespace_inc_global, opts = {}) delete_nodes_with_http_info(namespace_inc_global, opts) return nil end
Delete nodes Delete all nodes belonging to the given namespace. @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 261 def delete_nodes_with_http_info(namespace_inc_global, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HierarchyApi.delete_nodes ..." end # verify the required parameter 'namespace_inc_global' is set fail ArgumentError, "Missing the required parameter 'namespace_inc_global' when calling HierarchyApi.delete_nodes" if namespace_inc_global.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 = 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_nodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Download the blueprint's nodes in CSV formatnFormat will be:nn OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERSnnOLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importern @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @return [nil]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 315 def export_hierarchy(namespace, opts = {}) export_hierarchy_with_http_info(namespace, opts) return nil end
Download the blueprint's nodes in CSV formatnFormat will be:nn OLD NODE TYPE, OLD NODE ID, NEW NODE TYPE, NEW NODE ID, PARENTS, TITLE, DESCRIPTION, DOMAIN IDS, STUDENT NUMBERSnnOLD NODE TYPE and OLD NODE ID are left intentionally blank to allow direct upload of the output back into the bulk importern @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 325 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 ancestor nodes A proxy for finding ancestors of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [NodeResultSet]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 383 def get_ancestors(id, namespace, type, opts = {}) data, _status_code, _headers = get_ancestors_with_http_info(id, namespace, type, opts) return data end
Get ancestor nodes A proxy for finding ancestors of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [Array<(NodeResultSet
, Fixnum, Hash)>] NodeResultSet
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 397 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 child nodes A proxy for finding children of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [NodeResultSet]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 486 def get_children(id, namespace, type, opts = {}) data, _status_code, _headers = get_children_with_http_info(id, namespace, type, opts) return data end
Get child nodes A proxy for finding children of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [Array<(NodeResultSet
, Fixnum, Hash)>] NodeResultSet
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 500 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 descendant nodes A proxy for finding descendants of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [NodeResultSet]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 589 def get_descendants(id, namespace, type, opts = {}) data, _status_code, _headers = get_descendants_with_http_info(id, namespace, type, opts) return data end
Get descendant nodes A proxy for finding descendants of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [Array<(NodeResultSet
, Fixnum, Hash)>] NodeResultSet
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 603 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 details of a given node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets @return [NodeBody]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 691 def get_node(namespace, id, type, opts = {}) data, _status_code, _headers = get_node_with_http_info(namespace, id, type, opts) return data end
Get details of a given node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets @return [Array<(NodeBody
, Fixnum, Hash)>] NodeBody
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 704 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? # 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 parent nodes A proxy for finding parents of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [NodeResultSet]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 786 def get_parents(id, namespace, type, opts = {}) data, _status_code, _headers = get_parents_with_http_info(id, namespace, type, opts) return data end
Get parent nodes A proxy for finding parents of a given node, equivalent ton`/1/abc/nodes?filter=department%2Fdep101`n @param id id identifying a domain model @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [Array<(NodeResultSet
, Fixnum, Hash)>] NodeResultSet
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 800 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
Replaces the node with the data sent in the body @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param body node @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @return [NodeBody]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 888 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
Replaces the node with the data sent in the body @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param body node @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @return [Array<(NodeBody
, Fixnum, Hash)>] NodeBody
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 901 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 This endpoint is a really flexible way to ask questions about the hierarchy.nThe includes parameter can be set to either parents, children, assets.nnExamples:nn###### Find all nodes for abc:n`/1/abc/nodes`nn###### Find all modules for abc:n`/1/abc/nodes?filter=Modules`nn###### Find all nodes that are descendants of DEP101:n`/1/abc/nodes?filter=departments%2Fdep101`nn###### Find all nodes that are descendants of DEP101 or DEP102:n`/1/abc/nodes?filter=departments%2Fdep101,departments%2Fdep102`nn###### Find all nodes that are descendants of DEP101 and DEP102:n`/1/abc/nodes?filter=departments%2Fdep101&filter=departments%2Fdep102“nn###### Find all Departments that are ancestors of ABF203:n`/1/abc/nodes?filter=modules%2Fabf203&filter=Departments` # <= case insensitivenn###### Find all nodes with list assets that are descendants of DEP101 for abc:n`/1/abc/nodes?filter=Modules&filter=departments%2FDEP101&filter=true&filter=Lists`nn###### Globally, find all modules that have no list assetsn`/1/global/nodes?filter=Modules&filter=false&filter=Lists`nn###### 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 qualifyn`/1/global/nodes?filter=Modules&filter=false&filter=20150101&filter=20151231`nn###### Find all nodes of type modules with assets which are also related to DEP101.n`/1/global/nodes?filter=Modules&filter=departments%2Fdep101`n @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets @option opts [Array<String>] :filter_asset limit to nodes that have an asset matching type/code @option opts [Array<String>] :filter_node_type type of nodes to return @option opts [Array<String>] :filter_child limit to nodes with children matching type/code @option opts [Array<String>] :filter_parent limit to nodes with parent matching type/code @option opts [Array<String>] :filter_ancestor limit to nodes with ancestor matching type/code @option opts [Array<String>] :filter_descendant limit to nodes with descendant matching type/code @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 @option opts [Array<String>] :filter_asset_type type of asset to return. This filters the results by asset type, but returns all the assets associated with the result. @option opts [Date] :filter_from limit to results valid after this date, format is ISO8601 date @option opts [Date] :filter_to limit to results valid before this date, format is ISO8601 @option opts [String] :q_node query term(s) to search for nodes. Allows wildcard searching with '*' @option opts [String] :q_child query id/title terms to search for child nodes. Allows wildcard searching with '*' @option opts [String] :q_parent query id/title terms to search for parent nodes. Allows wildcard searching with '*' @option opts [String] :q_descendant query id/title terms to search for descendant nodes. Allows wildcard searching with '*' @option opts [String] :q_ancestor query id/title terms to search for ancestor nodes. Allows wildcard searching with '*' @option opts [Array<String>] :filter_asset_node limit to nodes that have an asset related to another node matching type/code @return [NodeResultSet]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 999 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 This endpoint is a really flexible way to ask questions about the hierarchy.nThe includes parameter can be set to either parents, children, assets.nnExamples:nn###### Find all nodes for abc:n`/1/abc/nodes`nn###### Find all modules for abc:n`/1/abc/nodes?filter=Modules`nn###### Find all nodes that are descendants of DEP101:n`/1/abc/nodes?filter=departments%2Fdep101`nn###### Find all nodes that are descendants of DEP101 or DEP102:n`/1/abc/nodes?filter=departments%2Fdep101,departments%2Fdep102`nn###### Find all nodes that are descendants of DEP101 and DEP102:n`/1/abc/nodes?filter=departments%2Fdep101&filter=departments%2Fdep102“nn###### Find all Departments that are ancestors of ABF203:n`/1/abc/nodes?filter=modules%2Fabf203&filter=Departments` # <= case insensitivenn###### Find all nodes with list assets that are descendants of DEP101 for abc:n`/1/abc/nodes?filter=Modules&filter=departments%2FDEP101&filter=true&filter=Lists`nn###### Globally, find all modules that have no list assetsn`/1/global/nodes?filter=Modules&filter=false&filter=Lists`nn###### 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 qualifyn`/1/global/nodes?filter=Modules&filter=false&filter=20150101&filter=20151231`nn###### Find all nodes of type modules with assets which are also related to DEP101.n`/1/global/nodes?filter=Modules&filter=departments%2Fdep101`n @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets @option opts [Array<String>] :filter_asset limit to nodes that have an asset matching type/code @option opts [Array<String>] :filter_node_type type of nodes to return @option opts [Array<String>] :filter_child limit to nodes with children matching type/code @option opts [Array<String>] :filter_parent limit to nodes with parent matching type/code @option opts [Array<String>] :filter_ancestor limit to nodes with ancestor matching type/code @option opts [Array<String>] :filter_descendant limit to nodes with descendant matching type/code @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 @option opts [Array<String>] :filter_asset_type type of asset to return. This filters the results by asset type, but returns all the assets associated with the result. @option opts [Date] :filter_from limit to results valid after this date, format is ISO8601 date @option opts [Date] :filter_to limit to results valid before this date, format is ISO8601 @option opts [String] :q_node query term(s) to search for nodes. Allows wildcard searching with '*' @option opts [String] :q_child query id/title terms to search for child nodes. Allows wildcard searching with '*' @option opts [String] :q_parent query id/title terms to search for parent nodes. Allows wildcard searching with '*' @option opts [String] :q_descendant query id/title terms to search for descendant nodes. Allows wildcard searching with '*' @option opts [String] :q_ancestor query id/title terms to search for ancestor nodes. Allows wildcard searching with '*' @option opts [Array<String>] :filter_asset_node limit to nodes that have an asset related to another node matching type/code @return [Array<(NodeResultSet
, Fixnum, Hash)>] NodeResultSet
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 1028 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? # 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[asset]'] = @api_client.build_collection_param(opts[:'filter_asset'], :csv) if opts[:'filter_asset'] 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'] query_params[:'filter[asset.node]'] = @api_client.build_collection_param(opts[:'filter_asset_node'], :csv) if opts[:'filter_asset_node'] # 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
Perform a partial update of a node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param body node @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @return [NodeBody]
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 1219 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
Perform a partial update of a node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param id id identifying a domain model @param body node @param type subtype of Node
, e.g. 'modules', 'departments', etc. @param [Hash] opts the optional parameters @return [Array<(NodeBody
, Fixnum, Hash)>] NodeBody
data, response status code and response headers
# File lib/blueprint_ruby_client/api/hierarchy_api.rb, line 1232 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