mints 0.0.16 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/client.rb +97 -38
- data/lib/contact.rb +124 -21
- data/lib/mints/controllers/admin_base_controller.rb +2 -2
- data/lib/mints/controllers/base_api_controller.rb +12 -11
- data/lib/mints/controllers/base_controller.rb +38 -9
- data/lib/mints_helper.rb +47 -0
- data/lib/pub.rb +147 -61
- data/lib/user/config/api_keys.rb +65 -0
- data/lib/user/config/appointments.rb +221 -0
- data/lib/user/config/attribute_groups.rb +77 -0
- data/lib/user/config/attributes.rb +86 -0
- data/lib/user/config/calendars.rb +89 -0
- data/lib/user/config/config.rb +65 -0
- data/lib/user/config/importers.rb +184 -0
- data/lib/user/config/public_folders.rb +108 -0
- data/lib/user/config/relationships.rb +138 -0
- data/lib/user/config/roles.rb +84 -0
- data/lib/user/config/seeds.rb +14 -0
- data/lib/user/config/system_settings.rb +53 -0
- data/lib/user/config/tags.rb +63 -0
- data/lib/user/config/taxonomies.rb +124 -0
- data/lib/user/config/teams.rb +70 -0
- data/lib/user/config/users.rb +76 -0
- data/lib/user/contacts/contacts.rb +21 -0
- data/lib/user/content/assets.rb +98 -0
- data/lib/user/content/content.rb +235 -0
- data/lib/user/content/content_instances.rb +147 -0
- data/lib/user/content/content_templates.rb +111 -0
- data/lib/user/content/conversations.rb +174 -0
- data/lib/user/content/dam.rb +88 -0
- data/lib/user/content/forms.rb +168 -0
- data/lib/user/content/message_templates.rb +162 -0
- data/lib/user/content/messages.rb +90 -0
- data/lib/user/content/pages.rb +81 -0
- data/lib/user/content/stories.rb +164 -0
- data/lib/user/content/story_templates.rb +95 -0
- data/lib/user/crm/companies.rb +111 -0
- data/lib/user/crm/contacts.rb +312 -0
- data/lib/user/crm/crm.rb +21 -0
- data/lib/user/crm/deals.rb +111 -0
- data/lib/user/crm/favorites.rb +17 -0
- data/lib/user/crm/segments.rb +132 -0
- data/lib/user/crm/users.rb +22 -0
- data/lib/user/crm/workflow_step_objects.rb +89 -0
- data/lib/user/crm/workflow_steps.rb +49 -0
- data/lib/user/crm/workflows.rb +70 -0
- data/lib/user/ecommerce/ecommerce.rb +29 -0
- data/lib/user/ecommerce/item_prices.rb +86 -0
- data/lib/user/ecommerce/locations.rb +166 -0
- data/lib/user/ecommerce/order_items_groups.rb +109 -0
- data/lib/user/ecommerce/order_statuses.rb +26 -0
- data/lib/user/ecommerce/orders.rb +258 -0
- data/lib/user/ecommerce/price_lists.rb +73 -0
- data/lib/user/ecommerce/product_templates.rb +104 -0
- data/lib/user/ecommerce/product_variations.rb +129 -0
- data/lib/user/ecommerce/products.rb +169 -0
- data/lib/user/ecommerce/skus.rb +88 -0
- data/lib/user/ecommerce/taxes.rb +82 -0
- data/lib/user/ecommerce/variant_options.rb +69 -0
- data/lib/user/ecommerce/variant_values.rb +72 -0
- data/lib/user/helpers/helpers.rb +113 -0
- data/lib/user/helpers/object_activities.rb +83 -0
- data/lib/user/helpers/object_folders.rb +82 -0
- data/lib/user/helpers/user_folders.rb +83 -0
- data/lib/user/marketing/marketing.rb +120 -0
- data/lib/user/profile/profile.rb +111 -0
- data/lib/user.rb +24 -368
- metadata +63 -3
@@ -0,0 +1,124 @@
|
|
1
|
+
module Taxonomies
|
2
|
+
##
|
3
|
+
# == Taxonomies
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Sync taxonomies for object.
|
7
|
+
# Sync taxonomies for object.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# data:: (Hash) -- Data to be submited.
|
11
|
+
#
|
12
|
+
# ==== Example
|
13
|
+
# data = {
|
14
|
+
# "object_type": "contacts",
|
15
|
+
# "object_id": 1
|
16
|
+
# }
|
17
|
+
# @data = @mints_user.sync_taxonomies_for_object(data)
|
18
|
+
def sync_taxonomies_for_object(data)
|
19
|
+
return @client.raw("put", "/config/taxonomies/sync_taxonomies_for_object", nil, data_transform(data))
|
20
|
+
end
|
21
|
+
|
22
|
+
# === Get taxonomies for object.
|
23
|
+
# Get taxonomies for object.
|
24
|
+
#
|
25
|
+
# ==== Parameters
|
26
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
27
|
+
#
|
28
|
+
# ==== Example
|
29
|
+
# options = {
|
30
|
+
# "object_type": "contacts",
|
31
|
+
# "object_id": 1
|
32
|
+
# }
|
33
|
+
# @data = @mints_user.get_taxonomies_for_object(options)
|
34
|
+
def get_taxonomies_for_object(options)
|
35
|
+
return @client.raw("get", "/config/taxonomies/get_taxonomies_for_object", options)
|
36
|
+
end
|
37
|
+
|
38
|
+
# === Get taxonomies support data.
|
39
|
+
# Get support data used in taxonomies.
|
40
|
+
#
|
41
|
+
# ==== Example
|
42
|
+
# @data = @mints_user.get_taxonomies_support_data
|
43
|
+
def get_taxonomies_support_data
|
44
|
+
return @client.raw("get", "/config/taxonomies/support-data")
|
45
|
+
end
|
46
|
+
|
47
|
+
#FIXME: Method doesnt exist in TaxonomyController.getUISupportData
|
48
|
+
#def get_ui_taxonomy(id)
|
49
|
+
# return @client.raw("get", "/config/taxonomies/ui-taxonomies/#{id}")
|
50
|
+
#end
|
51
|
+
|
52
|
+
# === Get taxonomies.
|
53
|
+
# Get a collection of taxonomies.
|
54
|
+
#
|
55
|
+
# ==== Parameters
|
56
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
57
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
58
|
+
#
|
59
|
+
# ==== First Example
|
60
|
+
# @data = @mints_user.get_taxonomies
|
61
|
+
#
|
62
|
+
# ==== Second Example
|
63
|
+
# options = { "fields": "title" }
|
64
|
+
# @data = @mints_user.get_taxonomies(options)
|
65
|
+
#
|
66
|
+
# ==== Third Example
|
67
|
+
# options = { "fields": "title" }
|
68
|
+
# @data = @mints_user.get_taxonomies(options, false)
|
69
|
+
def get_taxonomies(options = nil, use_post = true)
|
70
|
+
return get_query_results("/config/taxonomies", options, use_post)
|
71
|
+
end
|
72
|
+
|
73
|
+
# === Get taxonomy.
|
74
|
+
# Get a taxonomy info.
|
75
|
+
#
|
76
|
+
# ==== Parameters
|
77
|
+
# id:: (Integer) -- Taxonomy id.
|
78
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
79
|
+
#
|
80
|
+
# ==== First Example
|
81
|
+
# @data = @mints_user.get_taxonomy(1)
|
82
|
+
#
|
83
|
+
# ==== Second Example
|
84
|
+
# options = { "fields": "title" }
|
85
|
+
# @data = @mints_user.get_taxonomy(1, options)
|
86
|
+
def get_taxonomy(id, options = nil)
|
87
|
+
return @client.raw("get", "/config/taxonomies/#{id}", options)
|
88
|
+
end
|
89
|
+
|
90
|
+
# === Create taxonomy.
|
91
|
+
# Create a taxonomy with data.
|
92
|
+
#
|
93
|
+
# ==== Parameters
|
94
|
+
# data:: (Hash) -- Data to be submited.
|
95
|
+
#
|
96
|
+
# ==== Example
|
97
|
+
# data = {
|
98
|
+
# "title": "New Taxonomy",
|
99
|
+
# "slug": "new-taxonomy",
|
100
|
+
# "object_type": "contacts"
|
101
|
+
# }
|
102
|
+
# @data = @mints_user.create_taxonomy(data)
|
103
|
+
def create_taxonomy(data)
|
104
|
+
return @client.raw("post", "/config/taxonomies", nil, data_transform(data))
|
105
|
+
end
|
106
|
+
|
107
|
+
# === Update taxonomy.
|
108
|
+
# Update a taxonomy info.
|
109
|
+
#
|
110
|
+
# ==== Parameters
|
111
|
+
# id:: (Integer) -- Taxonomy id.
|
112
|
+
# data:: (Hash) -- Data to be submited.
|
113
|
+
#
|
114
|
+
# ==== Example
|
115
|
+
# data = {
|
116
|
+
# "title": "New Taxomony Modified",
|
117
|
+
# "slug": "new-taxonomy",
|
118
|
+
# "object_type": "contacts"
|
119
|
+
# }
|
120
|
+
# @data = @mints_user.update_taxonomy(104, data)
|
121
|
+
def update_taxonomy(id, data)
|
122
|
+
return @client.raw("put", "/config/taxonomies/#{id}", nil, data_transform(data))
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Teams
|
2
|
+
##
|
3
|
+
# == Teams
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get team types.
|
7
|
+
# Get a collection of team types.
|
8
|
+
#
|
9
|
+
# ==== Example
|
10
|
+
# @data = @mints_user.get_team_types
|
11
|
+
def get_team_types
|
12
|
+
return @client.raw("get", "/config/teams/team-types")
|
13
|
+
end
|
14
|
+
|
15
|
+
# === Get teams.
|
16
|
+
# Get a collection of teams.
|
17
|
+
#
|
18
|
+
# ==== Example
|
19
|
+
# @data = @mints_user.get_teams
|
20
|
+
def get_teams
|
21
|
+
return @client.raw("get", "/config/teams")
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get team.
|
25
|
+
# Get a team info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Team id.
|
29
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
30
|
+
#
|
31
|
+
# ==== Example
|
32
|
+
# @data = @mints_user.get_team(1)
|
33
|
+
def get_team(id)
|
34
|
+
return @client.raw("get", "/config/teams/#{id}")
|
35
|
+
end
|
36
|
+
|
37
|
+
# === Create team.
|
38
|
+
# Create a team with data.
|
39
|
+
#
|
40
|
+
# ==== Parameters
|
41
|
+
# data:: (Hash) -- Data to be submited.
|
42
|
+
#
|
43
|
+
# ==== Example
|
44
|
+
# data = {
|
45
|
+
# "title": "New Team",
|
46
|
+
# "team_type_enum": 1
|
47
|
+
# }
|
48
|
+
# @data = @mints_user.create_team(data)
|
49
|
+
def create_team(data)
|
50
|
+
return @client.raw("post", "/config/teams", nil, data_transform(data))
|
51
|
+
end
|
52
|
+
|
53
|
+
# === Update team.
|
54
|
+
# Update a team info.
|
55
|
+
#
|
56
|
+
# ==== Parameters
|
57
|
+
# id:: (Integer) -- Team id.
|
58
|
+
# data:: (Hash) -- Data to be submited.
|
59
|
+
#
|
60
|
+
# ==== Example
|
61
|
+
# data = {
|
62
|
+
# "title": "New Team Modified",
|
63
|
+
# "team_type_enum": 1,
|
64
|
+
# "members": []
|
65
|
+
# }
|
66
|
+
# @data = @mints_user.update_team(5, data)
|
67
|
+
def update_team(id, data)
|
68
|
+
return @client.raw("put", "/config/teams/#{id}", nil, data_transform(data))
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Users
|
2
|
+
##
|
3
|
+
# == Users
|
4
|
+
#
|
5
|
+
|
6
|
+
##
|
7
|
+
# === Can Users Coach.
|
8
|
+
# Determine if users can coach.
|
9
|
+
#
|
10
|
+
# ==== Example
|
11
|
+
# @data = @mints_user.can_users_coach
|
12
|
+
def can_users_coach
|
13
|
+
return @client.raw("get", "/config/users/can_coach")
|
14
|
+
end
|
15
|
+
|
16
|
+
# === Get users.
|
17
|
+
# Get a collection of users.
|
18
|
+
#
|
19
|
+
# ==== Example
|
20
|
+
# @data = @mints_user.get_users
|
21
|
+
def get_users
|
22
|
+
return @client.raw("get", "/config/users")
|
23
|
+
end
|
24
|
+
|
25
|
+
# === Get user.
|
26
|
+
# Get an user info.
|
27
|
+
#
|
28
|
+
# ==== Parameters
|
29
|
+
# id:: (Integer) -- User id.
|
30
|
+
#
|
31
|
+
# ==== Example
|
32
|
+
# @data = @mints_user.get_user(8)
|
33
|
+
def get_user(id)
|
34
|
+
return @client.raw("get", "/config/users/#{id}")
|
35
|
+
end
|
36
|
+
|
37
|
+
# === Create user.
|
38
|
+
# Create an user with data.
|
39
|
+
#
|
40
|
+
# ==== Parameters
|
41
|
+
# data:: (Hash) -- Data to be submited.
|
42
|
+
#
|
43
|
+
# ==== Example
|
44
|
+
# data = {
|
45
|
+
# "name": "New User Name",
|
46
|
+
# "email": "new_user_email@example.com",
|
47
|
+
# "is_confirmed": false,
|
48
|
+
# "set_password": true,
|
49
|
+
# "password": "123456",
|
50
|
+
# "is_coach": false
|
51
|
+
# }
|
52
|
+
# @data = @mints_user.create_user(data)
|
53
|
+
def create_user(data)
|
54
|
+
return @client.raw("post", "/config/users", nil, data_transform(data))
|
55
|
+
end
|
56
|
+
|
57
|
+
# === Update user.
|
58
|
+
# Update an user info.
|
59
|
+
#
|
60
|
+
# ==== Parameters
|
61
|
+
# id:: (Integer) -- User id.
|
62
|
+
# data:: (Hash) -- Data to be submited.
|
63
|
+
#
|
64
|
+
# ==== Example
|
65
|
+
# data = {
|
66
|
+
# "name": "New User Name Modified",
|
67
|
+
# "email": "new_user_name@example.com",
|
68
|
+
# "is_active": true,
|
69
|
+
# "is_confirmed": false,
|
70
|
+
# "roles": ""
|
71
|
+
# }
|
72
|
+
# @data = @mints_user.update_user(14, data)
|
73
|
+
def update_user(id, data)
|
74
|
+
return @client.raw("put", "/config/users/#{id}", nil, data_transform(data))
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Contacts
|
2
|
+
##
|
3
|
+
# == Contact Auth
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Change password no auth.
|
7
|
+
# Change password to an email without auth.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# data:: (Hash) -- Data to be submited.
|
11
|
+
#
|
12
|
+
# ==== Example
|
13
|
+
# data = {
|
14
|
+
# "password": "12345678",
|
15
|
+
# "email": "email@example.com"
|
16
|
+
# }
|
17
|
+
# @data = @mints_user.change_password_no_auth(data)
|
18
|
+
def change_password_no_auth(data)
|
19
|
+
return @client.raw("post", "/contacts/change-password-no-auth", nil, data_transform(data))
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Assets
|
2
|
+
##
|
3
|
+
# == Assets
|
4
|
+
#
|
5
|
+
|
6
|
+
def upload_asset(data)
|
7
|
+
return @client.raw("post", "/content/assets/upload", nil, data)
|
8
|
+
end
|
9
|
+
|
10
|
+
# === Get asset link info.
|
11
|
+
# Get information of an asset by url.
|
12
|
+
#
|
13
|
+
# ==== Parameters
|
14
|
+
# data:: (Hash) -- Data to be submited.
|
15
|
+
#
|
16
|
+
# ==== Example
|
17
|
+
# data = {
|
18
|
+
# "link": "https://www.example.com/img/img.jpg"
|
19
|
+
# }
|
20
|
+
# @data = @mints_user.get_asset_link_info(data.to_json)
|
21
|
+
def get_asset_link_info(data)
|
22
|
+
return @client.raw("post", "/content/assets/getLinkInfo", nil, data)
|
23
|
+
end
|
24
|
+
|
25
|
+
# === Download asset.
|
26
|
+
# Get information of an asset.
|
27
|
+
#
|
28
|
+
# ==== Parameters
|
29
|
+
# * +id+ - [Integer] Asset id.
|
30
|
+
#
|
31
|
+
# ==== Example
|
32
|
+
# @data = @mints_user.download_asset(2)
|
33
|
+
def download_asset(id) #FIXME: File not found at path, error in result but method works
|
34
|
+
return @client.raw("get", "/content/assets/download/#{id}")
|
35
|
+
end
|
36
|
+
|
37
|
+
def edit_asset_size(data) #TODO: Not tested
|
38
|
+
return @client.raw("post", "/content/assets/editSize", nil, data)
|
39
|
+
end
|
40
|
+
|
41
|
+
def upload_asset_variation(data) #FIXME: Call to a member function guessClientExtension() on null
|
42
|
+
return @client.raw("post", "/content/assets/uploadVariation", nil, data)
|
43
|
+
end
|
44
|
+
|
45
|
+
def create_asset_size(data) #FIXME: Trying to get property 'path' of non-object
|
46
|
+
return @client.raw("post", "/content/assets/createSize", nil, data)
|
47
|
+
end
|
48
|
+
|
49
|
+
def update_asset_variation(id, data) #TODO:
|
50
|
+
return @client.raw("post", "/content/assets/updateVariation/#{id}", nil, data)
|
51
|
+
end
|
52
|
+
|
53
|
+
def get_asset_sizes(id) #FIXME: wrong number of arguments (given 1, expected 0)
|
54
|
+
return @client.raw("get", "/content/assets/sizes/#{id}")
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_original_asset(id) #FIXME: Doesn't return JSON
|
58
|
+
return @client.raw("get", "/content/assets/original/#{id}")
|
59
|
+
end
|
60
|
+
|
61
|
+
def get_asset_variation(id)
|
62
|
+
#FIXME: Id 1 and 4: Trying to get property 'path' of non-object
|
63
|
+
#FIXME: Id 2 and 3: File not found at path maybe doesnt exist
|
64
|
+
return @client.raw("get", "/content/assets/variation/#{id}")
|
65
|
+
end
|
66
|
+
|
67
|
+
def get_asset_sizes(options)
|
68
|
+
return @client.raw("get", "/content/assets/getSizes", options)
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_asset_usage(options)
|
72
|
+
return @client.raw("get", "/content/assets/usage", options)
|
73
|
+
end
|
74
|
+
|
75
|
+
def delete_asset_variation #TODO: Not tested
|
76
|
+
return @client.raw("get", "/content/assets/deleteVariation")
|
77
|
+
end
|
78
|
+
|
79
|
+
def delete_asset_size #TODO: Not tested
|
80
|
+
return @client.raw("get", "/content/assets/deleteSize")
|
81
|
+
end
|
82
|
+
|
83
|
+
def get_asset_info(options)
|
84
|
+
return @client.raw("get", "/content/assets/getAssetInfo", options)
|
85
|
+
end
|
86
|
+
|
87
|
+
def generate_asset_variation(data) #FIXME: Trying to get property 'width' of non-object
|
88
|
+
return @client.raw("post", "/content/assets/generateAssetVariations", nil, data)
|
89
|
+
end
|
90
|
+
|
91
|
+
def get_asset_doc_types
|
92
|
+
return @client.raw("get", "/content/assets/docTypes")
|
93
|
+
end
|
94
|
+
|
95
|
+
def get_asset_public_route
|
96
|
+
return @client.raw("get", "/content/assets/publicRoute")
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,235 @@
|
|
1
|
+
require_relative './assets.rb'
|
2
|
+
require_relative './content_instances.rb'
|
3
|
+
require_relative './content_templates.rb'
|
4
|
+
require_relative './conversations.rb'
|
5
|
+
require_relative './dam.rb'
|
6
|
+
require_relative './forms.rb'
|
7
|
+
require_relative './message_templates.rb'
|
8
|
+
require_relative './messages.rb'
|
9
|
+
require_relative './pages.rb'
|
10
|
+
require_relative './stories.rb'
|
11
|
+
require_relative './story_templates.rb'
|
12
|
+
|
13
|
+
module Content
|
14
|
+
include Assets
|
15
|
+
include ContentInstances
|
16
|
+
include ContentTemplates
|
17
|
+
include Conversations
|
18
|
+
include DAM
|
19
|
+
include Forms
|
20
|
+
include MessageTemplates
|
21
|
+
include Messages
|
22
|
+
include Pages
|
23
|
+
include Stories
|
24
|
+
include StoryTemplates
|
25
|
+
|
26
|
+
# === Get public images url.
|
27
|
+
# Get public images url.
|
28
|
+
#
|
29
|
+
# ==== Example
|
30
|
+
# @data = @mints_user.get_public_images_url
|
31
|
+
def get_public_images_url
|
32
|
+
return @client.raw("get", "/content/public-images-url")
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# == Authors
|
37
|
+
#
|
38
|
+
|
39
|
+
# === Get authors.
|
40
|
+
# Get authors.
|
41
|
+
#
|
42
|
+
# ==== Example
|
43
|
+
# @data = @mints_user.get_authors
|
44
|
+
def get_authors
|
45
|
+
return @client.raw("get", "/content/authors")
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
# === Get author.
|
50
|
+
# Get an author.
|
51
|
+
#
|
52
|
+
# ==== Parameters
|
53
|
+
# id:: (Integer) -- Author id.
|
54
|
+
#
|
55
|
+
# ==== Example
|
56
|
+
# @data = @mints_user.get_author(1)
|
57
|
+
def get_author(id)
|
58
|
+
return @client.raw("get", "/content/authors/#{id}")
|
59
|
+
end
|
60
|
+
|
61
|
+
# === Create author.
|
62
|
+
# Create an author with data.
|
63
|
+
#
|
64
|
+
# ==== Parameters
|
65
|
+
# data:: (Hash) -- Data to be submited.
|
66
|
+
#
|
67
|
+
# ==== Example
|
68
|
+
# data = {
|
69
|
+
# "title": "Howard Phillips Lovecraft",
|
70
|
+
# "slug": "howard-phillips-lovecraft"
|
71
|
+
# }
|
72
|
+
# @data = @mints_user.create_author(data.to_json)
|
73
|
+
def create_author(data)
|
74
|
+
return @client.raw("post", "/content/authors", nil, data)
|
75
|
+
end
|
76
|
+
|
77
|
+
# === Update author.
|
78
|
+
# Update an author info.
|
79
|
+
#
|
80
|
+
# ==== Parameters
|
81
|
+
# id:: (Integer) -- Author id.
|
82
|
+
# data:: (Hash) -- Data to be submited.
|
83
|
+
#
|
84
|
+
# ==== Example
|
85
|
+
#
|
86
|
+
def update_author(id, data)
|
87
|
+
#FIXME: Author controller doesnt receive data
|
88
|
+
return @client.raw("put", "/content/authors/#{id}", nil, data)
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# == Keywords
|
93
|
+
#
|
94
|
+
|
95
|
+
# === Get keywords.
|
96
|
+
# Get a collection of keywords.
|
97
|
+
#
|
98
|
+
# ==== Parameters
|
99
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
100
|
+
#
|
101
|
+
# ==== First Example
|
102
|
+
# @data = @mints_user.get_keywords
|
103
|
+
#
|
104
|
+
# ==== Second Example
|
105
|
+
# options = { "fields": "title" }
|
106
|
+
# @data = @mints_user.get_keywords(options)
|
107
|
+
def get_keywords(options = nil)
|
108
|
+
return @client.raw("get", "/content/keywords", options)
|
109
|
+
end
|
110
|
+
|
111
|
+
# === Get keyword.
|
112
|
+
# Get a keyword.
|
113
|
+
#
|
114
|
+
# ==== Parameters
|
115
|
+
# id:: (Integer) -- Keyword id.
|
116
|
+
#
|
117
|
+
def get_keyword(id)
|
118
|
+
return @client.raw("get", "/content/keywords/#{id}")
|
119
|
+
end
|
120
|
+
|
121
|
+
# === Create keyword.
|
122
|
+
# Create a keyword with data.
|
123
|
+
#
|
124
|
+
# ==== Parameters
|
125
|
+
# data:: (Hash) -- Data to be submited.
|
126
|
+
#
|
127
|
+
# ==== Example
|
128
|
+
# data = {
|
129
|
+
# "title": "New Keyword"
|
130
|
+
# }
|
131
|
+
# @data = @mints_user.create_keyword(data.to_json)
|
132
|
+
def create_keyword(data)
|
133
|
+
return @client.raw("post", "/content/keywords", nil, data)
|
134
|
+
end
|
135
|
+
|
136
|
+
# === Update keyword.
|
137
|
+
# Update a keyword info.
|
138
|
+
#
|
139
|
+
# ==== Parameters
|
140
|
+
# id:: (Integer) -- Keyword id.
|
141
|
+
# data:: (Hash) -- Data to be submited.
|
142
|
+
#
|
143
|
+
# ==== Example
|
144
|
+
#
|
145
|
+
def update_keyword(id, data)
|
146
|
+
#FIXME: Keyword controller doesnt receive data
|
147
|
+
return @client.raw("put", "/content/keywords/#{id}", nil, data)
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# == Stages
|
152
|
+
#
|
153
|
+
|
154
|
+
# === Get stages.
|
155
|
+
# Get a collection of stages.
|
156
|
+
#
|
157
|
+
# ==== Parameters
|
158
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
159
|
+
#
|
160
|
+
# ==== First Example
|
161
|
+
# @data = @mints_user.get_stages
|
162
|
+
#
|
163
|
+
# ==== Second Example
|
164
|
+
# options = { "fields": "title" }
|
165
|
+
# @data = @mints_user.get_stages(options)
|
166
|
+
def get_stages(options = nil)
|
167
|
+
return @client.raw("get", "/content/stages", options)
|
168
|
+
end
|
169
|
+
|
170
|
+
# === Get stage.
|
171
|
+
# Get a stage.
|
172
|
+
#
|
173
|
+
# ==== Parameters
|
174
|
+
# id:: (Integer) -- Stage id.
|
175
|
+
#
|
176
|
+
# ==== Example
|
177
|
+
# @data = @mints_user.get_stage(1)
|
178
|
+
def get_stage(id)
|
179
|
+
return @client.raw("get", "/content/stages/#{id}")
|
180
|
+
end
|
181
|
+
|
182
|
+
# === Create stage.
|
183
|
+
# Create a stage with data.
|
184
|
+
#
|
185
|
+
# ==== Parameters
|
186
|
+
# data:: (Hash) -- Data to be submited.
|
187
|
+
#
|
188
|
+
# ==== Example
|
189
|
+
# config_json = {
|
190
|
+
# "count": 1
|
191
|
+
# }
|
192
|
+
# event_json = {
|
193
|
+
# "rset": "DTSTART:20190214T000000Z",
|
194
|
+
# "duration": 1
|
195
|
+
# }
|
196
|
+
# data = {
|
197
|
+
# "title": "New Stage",
|
198
|
+
# "description": "New Stage Description",
|
199
|
+
# "config_json": config_json.to_json,
|
200
|
+
# "event_json": event_json.to_json
|
201
|
+
# }
|
202
|
+
# @data = @mints_user.create_stage(data.to_json)
|
203
|
+
def create_stage(data)
|
204
|
+
return @client.raw("post", "/content/stages", nil, data)
|
205
|
+
end
|
206
|
+
|
207
|
+
# === Update stage.
|
208
|
+
# Update a stage info.
|
209
|
+
#
|
210
|
+
# ==== Parameters
|
211
|
+
# id:: (Integer) -- Stage id.
|
212
|
+
# data:: (Hash) -- Data to be submited.
|
213
|
+
#
|
214
|
+
# ==== Example
|
215
|
+
# config_json = {
|
216
|
+
# "count": 2
|
217
|
+
# }
|
218
|
+
# event_json = {
|
219
|
+
# "rset": "DTSTART:20190214T000000Z",
|
220
|
+
# "duration": 2
|
221
|
+
# }
|
222
|
+
# data = {
|
223
|
+
# "stageProps": {
|
224
|
+
# "title": "New Stage Modified",
|
225
|
+
# "description": "New Stage Description Modified"
|
226
|
+
# },
|
227
|
+
# "config_json": config_json.to_json,
|
228
|
+
# "event_json": event_json.to_json
|
229
|
+
# }
|
230
|
+
# @data = @mints_user.update_stage(3, data.to_json)
|
231
|
+
def update_stage(id, data)
|
232
|
+
#TODO: Inform StageController.update method has been modified
|
233
|
+
return @client.raw("put", "/content/stages/#{id}", nil, data)
|
234
|
+
end
|
235
|
+
end
|