Class: ChinoAPI

Inherits:
CheckValues show all
Defined in:
lib/chino_ruby.rb

Overview

Class which contains every Chino.io resource as objects. In this way if you create a ‘client’ variable of this class, it will contain every function for the creation, update, retrieval… of every resource. Every function is easily accessible as follow:

name_of_the_client_variable.name_of_the_resource.name_of_the_function()

Example of the creation of a Repository

@client = ChinoAPI.new(...)
@client.repositories.create_repository(...)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CheckValues

#check_boolean, #check_int, #check_json, #check_string

Constructor Details

#initialize(customer_id, customer_key, host_url) ⇒ ChinoAPI

Use this function to initialize your client variable

  • customer_id: your customer id value

  • customer_key: your customer key value

  • host_url: the url of the server, use ‘api.test.chino.io/v1’ for development and ‘api.chino.io/v1’ for the production



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/chino_ruby.rb', line 60

def initialize(customer_id, customer_key, host_url)
    check_string(customer_id)
    check_string(customer_key)
    check_string(host_url)
    @customer_id = customer_id
    @customer_key = customer_key
    @host_url = host_url
    @applications = Applications.new(@customer_id, @customer_key, @host_url)
    @auth = Auth.new(@customer_id, @customer_key, @host_url)
    @repositories = Repositories.new(@customer_id, @customer_key, @host_url)
    @schemas = Schemas.new(@customer_id, @customer_key, @host_url)
    @documents = Documents.new(@customer_id, @customer_key, @host_url)
    @user_schemas = UserSchemas.new(@customer_id, @customer_key, @host_url)
    @users = Users.new(@customer_id, @customer_key, @host_url)
    @groups = Groups.new(@customer_id, @customer_key, @host_url)
    @collections = Collections.new(@customer_id, @customer_key, @host_url)
    @permissions = Permissions.new(@customer_id, @customer_key, @host_url)
    @search = Search.new(@customer_id, @customer_key, @host_url)
    @blobs = Blobs.new(@customer_id, @customer_key, @host_url)
end

Instance Attribute Details

#applicationsObject

Returns the value of attribute applications.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def applications
  @applications
end

#authObject

Returns the value of attribute auth.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def auth
  @auth
end

#blobsObject

Returns the value of attribute blobs.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def blobs
  @blobs
end

#collectionsObject

Returns the value of attribute collections.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def collections
  @collections
end

#documentsObject

Returns the value of attribute documents.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def documents
  @documents
end

#groupsObject

Returns the value of attribute groups.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def groups
  @groups
end

#permissionsObject

Returns the value of attribute permissions.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def permissions
  @permissions
end

#repositoriesObject

Returns the value of attribute repositories.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def repositories
  @repositories
end

#schemasObject

Returns the value of attribute schemas.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def schemas
  @schemas
end

#searchObject

Returns the value of attribute search.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def search
  @search
end

#user_schemasObject

Returns the value of attribute user_schemas.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def user_schemas
  @user_schemas
end

#usersObject

Returns the value of attribute users.



54
55
56
# File 'lib/chino_ruby.rb', line 54

def users
  @users
end