blueprint_ruby_client

BlueprintClient - the Ruby gem for the Talis Blueprint API

This is the API documentation for Blueprint, a primitive for institutional structure and time periods

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 0.4.1
  • Build date: 2016-06-03T14:12:48.656-04:00
  • Build package: class io.swagger.codegen.languages.RubyClientCodegen

Installation

Generating the code

To update the gem code to the latest API specification:

sh generate.sh

Customise the code generation by modifying the template files.

Build a gem

To build the Ruby code into a gem:

gem build blueprint_ruby_client.gemspec

Then either install the gem locally:

gem install ./blueprint_ruby_client-0.4.1.gem

(for development, run gem install --dev ./blueprint_ruby_client-0.4.1.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'blueprint_ruby_client', '~> 0.4.1'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/talis/blueprint_rb, then add the following in the Gemfile:

gem 'blueprint_ruby_client', :git => 'https://github.com/talis/blueprint_rb.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'blueprint_ruby_client'

# Setup authorization
BlueprintClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = BlueprintClient::AssetsApi.new

namespace = "namespace_example" # String | identifier namespacing the blueprint.

type = "type_example" # String | Plural form of node type (adds an 's' to the end of the type) todo - allow configuration of plurals

id = "id_example" # String | id identifying a domain model

asset_type = "asset_type_example" # String | Plural form of asset type (adds an 's' to the end of the type) todo - allow configuration of plurals

asset_id = "asset_id_example" # String | id of an asset


begin
  result = api_instance.add_asset_to_node(namespace, typeid, asset_type, asset_id)
  p result
rescue BlueprintClient::ApiError => e
  puts "Exception when calling AssetsApi->add_asset_to_node: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost:10010/1

Class Method HTTP request Description
BlueprintClient::AssetsApi add_asset_to_node PUT /namespace/nodes/type/id/assets/assetType/assetId
BlueprintClient::AssetsApi delete_asset DELETE /namespace/assets/assetType/assetId
BlueprintClient::AssetsApi get_asset GET /namespace/assets/assetType/assetId
BlueprintClient::AssetsApi get_assets_in_node GET /namespace/nodes/type/id/assets
BlueprintClient::AssetsApi remove_asset_from_node DELETE /namespace/nodes/type/id/assets/assetType/assetId
BlueprintClient::AssetsApi replace_asset PUT /namespace/assets/assetType/assetId Replaces the Asset with the data sent in the body
BlueprintClient::HierarchyApi add_node POST /namespaceIncGlobal/nodes
BlueprintClient::HierarchyApi bulk_upload POST /namespace/nodes.csv
BlueprintClient::HierarchyApi delete_node DELETE /namespace/nodes/type/id
BlueprintClient::HierarchyApi export_hierarchy GET /namespace/nodes.csv
BlueprintClient::HierarchyApi get_ancestors GET /namespace/nodes/type/id/ancestors Get ancestor nodes
BlueprintClient::HierarchyApi get_children GET /namespace/nodes/type/id/children Get child nodes
BlueprintClient::HierarchyApi get_descendants GET /namespace/nodes/type/id/descendants Get descendant nodes
BlueprintClient::HierarchyApi get_node GET /namespace/nodes/type/id
BlueprintClient::HierarchyApi get_parents GET /namespace/nodes/type/id/parents Get parent nodes
BlueprintClient::HierarchyApi replace_node PUT /namespace/nodes/type/id
BlueprintClient::HierarchyApi search_nodes GET /namespaceIncGlobal/nodes Search nodes
BlueprintClient::HierarchyApi update_node PATCH /namespace/nodes/type/id

Documentation for Models

Documentation for Authorization

oauth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • su: Talis super user
    • su@namespace: Super user for a specific blueprint