mints 0.0.15 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +65 -30
  3. data/lib/contact.rb +146 -17
  4. data/lib/generators/mints_assets_controller.rb +3 -0
  5. data/lib/generators/mints_files_generator.rb +2 -0
  6. data/lib/mints/controllers/admin_base_controller.rb +28 -12
  7. data/lib/mints/controllers/base_api_controller.rb +97 -7
  8. data/lib/mints/controllers/base_controller.rb +48 -7
  9. data/lib/mints_helper.rb +47 -0
  10. data/lib/pub.rb +137 -52
  11. data/lib/user/config/api_keys.rb +65 -0
  12. data/lib/user/config/appointments.rb +221 -0
  13. data/lib/user/config/attribute_groups.rb +77 -0
  14. data/lib/user/config/attributes.rb +86 -0
  15. data/lib/user/config/calendars.rb +89 -0
  16. data/lib/user/config/config.rb +65 -0
  17. data/lib/user/config/importers.rb +184 -0
  18. data/lib/user/config/public_folders.rb +108 -0
  19. data/lib/user/config/relationships.rb +138 -0
  20. data/lib/user/config/roles.rb +84 -0
  21. data/lib/user/config/seeds.rb +14 -0
  22. data/lib/user/config/system_settings.rb +53 -0
  23. data/lib/user/config/tags.rb +63 -0
  24. data/lib/user/config/taxonomies.rb +124 -0
  25. data/lib/user/config/teams.rb +70 -0
  26. data/lib/user/config/users.rb +76 -0
  27. data/lib/user/contacts/contacts.rb +21 -0
  28. data/lib/user/content/assets.rb +98 -0
  29. data/lib/user/content/content.rb +235 -0
  30. data/lib/user/content/content_instances.rb +147 -0
  31. data/lib/user/content/content_templates.rb +111 -0
  32. data/lib/user/content/conversations.rb +174 -0
  33. data/lib/user/content/dam.rb +88 -0
  34. data/lib/user/content/forms.rb +168 -0
  35. data/lib/user/content/message_templates.rb +162 -0
  36. data/lib/user/content/messages.rb +90 -0
  37. data/lib/user/content/pages.rb +81 -0
  38. data/lib/user/content/stories.rb +164 -0
  39. data/lib/user/content/story_templates.rb +95 -0
  40. data/lib/user/crm/companies.rb +111 -0
  41. data/lib/user/crm/contacts.rb +312 -0
  42. data/lib/user/crm/crm.rb +21 -0
  43. data/lib/user/crm/deals.rb +111 -0
  44. data/lib/user/crm/favorites.rb +17 -0
  45. data/lib/user/crm/segments.rb +132 -0
  46. data/lib/user/crm/users.rb +22 -0
  47. data/lib/user/crm/workflow_step_objects.rb +89 -0
  48. data/lib/user/crm/workflow_steps.rb +49 -0
  49. data/lib/user/crm/workflows.rb +70 -0
  50. data/lib/user/ecommerce/ecommerce.rb +29 -0
  51. data/lib/user/ecommerce/item_prices.rb +86 -0
  52. data/lib/user/ecommerce/locations.rb +166 -0
  53. data/lib/user/ecommerce/order_items_groups.rb +109 -0
  54. data/lib/user/ecommerce/order_statuses.rb +26 -0
  55. data/lib/user/ecommerce/orders.rb +258 -0
  56. data/lib/user/ecommerce/price_lists.rb +73 -0
  57. data/lib/user/ecommerce/product_templates.rb +104 -0
  58. data/lib/user/ecommerce/product_variations.rb +129 -0
  59. data/lib/user/ecommerce/products.rb +169 -0
  60. data/lib/user/ecommerce/skus.rb +88 -0
  61. data/lib/user/ecommerce/taxes.rb +82 -0
  62. data/lib/user/ecommerce/variant_options.rb +69 -0
  63. data/lib/user/ecommerce/variant_values.rb +72 -0
  64. data/lib/user/helpers/helpers.rb +113 -0
  65. data/lib/user/helpers/object_activities.rb +83 -0
  66. data/lib/user/helpers/object_folders.rb +82 -0
  67. data/lib/user/helpers/user_folders.rb +83 -0
  68. data/lib/user/marketing/marketing.rb +120 -0
  69. data/lib/user/profile/profile.rb +111 -0
  70. data/lib/user.rb +36 -355
  71. metadata +64 -3
@@ -0,0 +1,184 @@
1
+ module Importers
2
+ ##
3
+ # == Importers
4
+ #
5
+
6
+ # === Get importers results.
7
+ # Get a results of importers.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== Example
13
+ # options = { "ip_id": 1 }
14
+ # @data = @mints_user.get_importers_results(options)
15
+ def get_importers_results(options) #FIXME: Query doesnt get results. Maybe no data in db.
16
+ return @client.raw("get", "/config/importers/results", options)
17
+ end
18
+
19
+ # === Get importers configuration.
20
+ # Get configurations of importers.
21
+ #
22
+ # ==== Example
23
+ # @data = @mints_user.get_importers_configuration
24
+ def get_importers_configuration
25
+ return @client.raw("get", "/config/importers/configuration")
26
+ end
27
+
28
+ # === Get importing process status.
29
+ # Get importing process status by importer ids.
30
+ #
31
+ # ==== Parameters
32
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
33
+ #
34
+ # ==== Example
35
+ # options = {
36
+ # "ids": "1,2,3"
37
+ # }
38
+ # @data = @mints_user.get_importing_process_status(options)
39
+ def get_importing_process_status(options = nil)
40
+ return @client.raw("get", "/config/importers/importing_process_status", options)
41
+ end
42
+
43
+ # === Get importers attributes.
44
+ # Get import attributes of modules in a table.
45
+ #
46
+ # ==== Parameters
47
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
48
+ #
49
+ # ==== Example
50
+ # options = {
51
+ # "table": "contacts",
52
+ # "module": "crm"
53
+ # }
54
+ # @data = @mints_user.get_importers_attributes(options)
55
+ def get_importers_attributes(options = nil)
56
+ return @client.raw("get", "/config/importers/attributes", options)
57
+ end
58
+
59
+ # === Upload importer.
60
+ # Upload to an importer.
61
+ #
62
+ # ==== Parameters
63
+ # id:: (Integer) -- Importer id.
64
+ # data:: (Hash) -- Data to be submited.
65
+ #
66
+ # ==== Example
67
+ # data = {
68
+ # "csv": "archive.csv"
69
+ # }
70
+ # @data = @mints_user.upload_importer(1, data.to_json)
71
+ def upload_importer(id, data) #TODO: Search for csv archives
72
+ return @client.raw("post", "/config/importers/#{id}/upload", nil, data)
73
+ end
74
+
75
+ # === Import row.
76
+ # Import a row.
77
+ #
78
+ # ==== Parameters
79
+ # data:: (Hash) -- Data to be submited.
80
+ #
81
+ # ==== Example
82
+ #
83
+ def import_row(data) #TODO: Research use
84
+ return @client.raw("post", "/config/importers/import_row", nil, data)
85
+ end
86
+
87
+ # === Remove importers active process.
88
+ # Remove an active process in an importer.
89
+ #
90
+ # ==== Parameters
91
+ # data:: (Hash) -- Data to be submited.
92
+ #
93
+ # ==== Example
94
+ #
95
+ def remove_importers_active_process(data) #FIXME: Cannot get property 'active_importing_process' of non-object.
96
+ return @client.raw("post", "/config/importers/removeActiveProcess", nil, data_transform(data))
97
+ end
98
+
99
+ # === Get importers.
100
+ # Get a collection of importers.
101
+ #
102
+ # ==== Parameters
103
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
104
+ #
105
+ # ==== First Example
106
+ # @data = @mints_user.get_importers
107
+ #
108
+ # ==== Second Example
109
+ # options = { "fields": "name" }
110
+ # @data = @mints_user.get_importers(options)
111
+ def get_importers(options = nil)
112
+ return @client.raw("get", "/config/importers", options)
113
+ end
114
+
115
+ # === Get importer.
116
+ # Get an importer info.
117
+ #
118
+ # ==== Parameters
119
+ # id:: (Integer) -- Importer id.
120
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
121
+ #
122
+ # ==== First Example
123
+ # @data = @mints_user.get_importer(1)
124
+ #
125
+ # ==== Second Example
126
+ # options = { "fields": "name" }
127
+ # @data = @mints_user.get_importer(1, options)
128
+ def get_importer(id, options = nil)
129
+ return @client.raw("get", "/config/importers/#{id}", options)
130
+ end
131
+
132
+ # === Create importer.
133
+ # Create an importer with data.
134
+ #
135
+ # ==== Parameters
136
+ # data:: (Hash) -- Data to be submited.
137
+ #
138
+ # ==== Example
139
+ # data = {
140
+ # "name": "New Importer",
141
+ # "module": "crm"
142
+ # }
143
+ # @data = @mints_user.create_importer(data)
144
+ def create_importer(data)
145
+ return @client.raw("post", "/config/importers", nil, data_transform(data))
146
+ end
147
+
148
+ # === Update importer.
149
+ # Update an importer info.
150
+ #
151
+ # ==== Parameters
152
+ # id:: (Integer) -- Importer id.
153
+ # data:: (Hash) -- Data to be submited.
154
+ #
155
+ # ==== Example
156
+ # data = {
157
+ # "name": "New Importer Modified"
158
+ # }
159
+ # @data = @mints_user.update_importer(4, data)
160
+ def update_importer(id, data)
161
+ return @client.raw("put", "/config/importers/#{id}", nil, data_transform(data))
162
+ end
163
+
164
+ # === Delete importer.
165
+ # Delete a importer.
166
+ #
167
+ # ==== Parameters
168
+ # id:: (Integer) -- Importer id.
169
+ #
170
+ # ==== Example
171
+ # @data = @mints_user.delete_importer(4)
172
+ def delete_importer(id)
173
+ return @client.raw("delete", "/config/importers/#{id}")
174
+ end
175
+
176
+ # === Get importers pusher key.
177
+ # Get the pusher key of importers.
178
+ #
179
+ # ==== Example
180
+ # @data = @mints_user.get_importers_pusher_key
181
+ def get_importers_pusher_key
182
+ return @client.raw("get", "/config/pusher_key")
183
+ end
184
+ end
@@ -0,0 +1,108 @@
1
+ module PublicFolders
2
+ ##
3
+ # == Public Folders
4
+ #
5
+
6
+ # === Sync public folders for object.
7
+ # Sync public folders 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_public_folders_for_object(data.to_json)
18
+ def sync_public_folders_for_object(data)
19
+ return @client.raw("put", "/config/public-folders/sync_public-folders_for_object", nil, data)
20
+ end
21
+
22
+ # === Get public folders for object.
23
+ # Get public folders 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_public_folders_for_object(options)
34
+ def get_public_folders_for_object(options)
35
+ return @client.raw("get", "/config/public-folders/get_public-folders_for_object", options)
36
+ end
37
+
38
+ # === Get public folders.
39
+ # Get a collection of public folders.
40
+ #
41
+ # ==== Example
42
+ # @data = @mints_user.get_public_folders
43
+ def get_public_folders
44
+ return @client.raw("get", "/config/public-folders")
45
+ end
46
+
47
+ # === Create public folder.
48
+ # Create a public folder with data.
49
+ #
50
+ # ==== Parameters
51
+ # data:: (Hash) -- Data to be submited.
52
+ #
53
+ # ==== Example
54
+ # data = {
55
+ # "title": "New Public Folder",
56
+ # "slug": "new-public-folder",
57
+ # "object_type": "contacts",
58
+ # "visible": true
59
+ # }
60
+ # @data = @mints_user.create_public_folder(data.to_json)
61
+ def create_public_folder(data)
62
+ return @client.raw("post", "/config/public-folders", nil, data)
63
+ end
64
+
65
+ # === Update public folder.
66
+ # Update a public folder info.
67
+ #
68
+ # ==== Parameters
69
+ # id:: (Integer) -- Public folder id.
70
+ # data:: (Hash) -- Data to be submited.
71
+ #
72
+ # ==== Example
73
+ # data = {
74
+ # "title": "New Public Folder Modified",
75
+ # "slug": "new-public-folder",
76
+ # "object_type": "contacts",
77
+ # "visible": true
78
+ # }
79
+ # @data = @mints_user.update_public_folder(20, data.to_json)
80
+ def update_public_folder(id, data)
81
+ return @client.raw("put", "/config/public-folders/#{id}", nil, data)
82
+ end
83
+
84
+ # === Get public folder support data.
85
+ # Get support data used in a public folder.
86
+ #
87
+ # ==== Parameters
88
+ # id:: (Integer) -- Public folder id.
89
+ #
90
+ # ==== Example
91
+ # @data = @mints_user.get_public_folder_support_data(1)
92
+ def get_public_folder_support_data(id)
93
+ return @client.raw("get", "/config/public-folders/support-data/#{id}")
94
+ end
95
+
96
+ # === Get public folder.
97
+ # Get a public folder info.
98
+ #
99
+ # ==== Parameters
100
+ # id:: (Integer) -- Public folder id.
101
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
102
+ #
103
+ # ==== Example
104
+ # @data = @mints_user.get_public_folder(3)
105
+ def get_public_folder(id)
106
+ return @client.raw("get", "/config/public-folders/#{id}")
107
+ end
108
+ end
@@ -0,0 +1,138 @@
1
+ module Relationships
2
+ ##
3
+ # == Relationships
4
+ #
5
+
6
+ # === Get relationships available for.
7
+ # Get relationships availables.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== Example
13
+ # options = {
14
+ # "objectType": "contacts"
15
+ # }
16
+ # @data = @mints_user.get_relationships_available_for(options)
17
+ def get_relationships_available_for(options)
18
+ return @client.raw("get", "/config/relationships/available-for", options)
19
+ end
20
+
21
+ # === Attach relationship.
22
+ # Attach a relationship.
23
+ #
24
+ # ==== Parameters
25
+ # data:: (Hash) -- Data to be submited.
26
+ #
27
+ # ==== Example
28
+ #
29
+ def attach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.
30
+ return @client.raw("post", "/config/relationships/attach", nil, data)
31
+ end
32
+
33
+ # === Detach relationship.
34
+ # Detach a relationship.
35
+ #
36
+ # ==== Parameters
37
+ # data:: (Hash) -- Data to be submited.
38
+ #
39
+ # ==== Example
40
+ #
41
+ def detach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.
42
+ return @client.raw("post", "/config/relationships/detach", nil, data)
43
+ end
44
+
45
+ # === Relationship has objects.
46
+ # Get relationships that has objects.
47
+ #
48
+ # ==== Parameters
49
+ # id:: (Integer) -- Relationship id.
50
+ #
51
+ # ==== Example
52
+ # @data = @mints_user.relationship_has_objects(1)
53
+ def relationship_has_objects(id)
54
+ return @client.raw("get", "/config/relationships/#{id}/hasObjects")
55
+ end
56
+
57
+ # === Get relationships.
58
+ # Get a collection of relationships.
59
+ #
60
+ # ==== Parameters
61
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
62
+ #
63
+ # ==== First Example
64
+ # @data = @mints_user.get_relationships
65
+ #
66
+ # ==== Second Example
67
+ # options = { "fields": "id" }
68
+ # @data = @mints_user.get_relationships(options)
69
+ def get_relationships(options = nil)
70
+ return @client.raw("get", "/config/relationships", options)
71
+ end
72
+
73
+ # === Get relationship.
74
+ # Get a relationship info.
75
+ #
76
+ # ==== Parameters
77
+ # id:: (Integer) -- Relationship 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_relationship(1)
82
+ #
83
+ # ==== Second Example
84
+ # options = { "fields": "id" }
85
+ # @data = @mints_user.get_relationship(1, options)
86
+ def get_relationship(id, options = nil)
87
+ return @client.raw("get", "/config/relationships/#{id}", options)
88
+ end
89
+
90
+ # === Create relationship.
91
+ # Create a relationship with data.
92
+ #
93
+ # ==== Parameters
94
+ # data:: (Hash) -- Data to be submited.
95
+ #
96
+ # ==== Example
97
+ # data = {
98
+ # "alias_1": "eventsCopy",
99
+ # "alias_2": "ticketsCopy",
100
+ # "object_model_1": "Story",
101
+ # "object_model_2": "Product"
102
+ # }
103
+ # @data = @mints_user.create_relationship(data)
104
+ def create_relationship(data)
105
+ return @client.raw("post", "/config/relationships", nil, data_transform(data))
106
+ end
107
+
108
+ # === Update relationship.
109
+ # Update a relationship info.
110
+ #
111
+ # ==== Parameters
112
+ # id:: (Integer) -- Relationship id.
113
+ # data:: (Hash) -- Data to be submited.
114
+ #
115
+ # ==== Example
116
+ # data = {
117
+ # "alias_1": "eventsCopyModified",
118
+ # "alias_2": "ticketsCopyModified",
119
+ # "object_model_1": "Story",
120
+ # "object_model_2": "Product"
121
+ # }
122
+ # @data = @mints_user.update_relationship(5, data)
123
+ def update_relationship(id, data)
124
+ return @client.raw("put", "/config/relationships/#{id}", nil, data_transform(data))
125
+ end
126
+
127
+ # === Delete relationship.
128
+ # Delete a relationship.
129
+ #
130
+ # ==== Parameters
131
+ # id:: (Integer) -- Relationship id.
132
+ #
133
+ # ==== Example
134
+ # @data = @mints_user.delete_relationship(5)
135
+ def delete_relationship(id)
136
+ return @client.raw("delete", "/config/relationships/#{id}")
137
+ end
138
+ end
@@ -0,0 +1,84 @@
1
+ module Roles
2
+ ##
3
+ # == Roles
4
+ #
5
+
6
+ #def get_roles_permissions #FIXME: RoleController doesnt have getPermissions method
7
+ # return @client.raw("get", "/config/roles/get-permissions")
8
+ #end
9
+
10
+ # === Duplicate role.
11
+ # Duplicate a role.
12
+ #
13
+ # ==== Parameters
14
+ # id:: (Integer) -- Role id.
15
+ # data:: (Hash) -- Data to be submited.
16
+ #
17
+ # ==== Example
18
+ # data = {
19
+ # "options": []
20
+ # }
21
+ # @data = @mints_user.duplicate_role(1, data.to_json)
22
+ def duplicate_role(id, data)
23
+ return @client.raw("post", "/config/roles/#{id}/duplicate", nil, data)
24
+ end
25
+
26
+ # === Get roles.
27
+ # Get a collection of roles.
28
+ #
29
+ # ==== Example
30
+ # @data = @mints_user.get_roles
31
+ def get_roles
32
+ return @client.raw("get", "/config/roles")
33
+ end
34
+
35
+ # === Get role.
36
+ # Get a role info.
37
+ #
38
+ # ==== Parameters
39
+ # id:: (Integer) -- Role id.
40
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
41
+ #
42
+ # ==== Example
43
+ # @data = @mints_user.get_role(1)
44
+ def get_role(id)
45
+ return @client.raw("get", "/config/roles/#{id}")
46
+ end
47
+
48
+ # === Create role.
49
+ # Create a role with data.
50
+ #
51
+ # ==== Parameters
52
+ # data:: (Hash) -- Data to be submited.
53
+ #
54
+ # ==== Example
55
+ # data = {
56
+ # "name": "new-role",
57
+ # "display_name": "New Role",
58
+ # "description": "Role description"
59
+ # }
60
+ # @data = @mints_user.create_role(data)
61
+ def create_role(data)
62
+ return @client.raw("post", "/config/roles", nil, data_transform(data))
63
+ end
64
+
65
+ # === Update role.
66
+ # Update a role info.
67
+ #
68
+ # ==== Parameters
69
+ # id:: (Integer) -- Role id.
70
+ # data:: (Hash) -- Data to be submited.
71
+ #
72
+ # ==== Example
73
+ # data = {
74
+ # "name": "new-role",
75
+ # "display_name": "New Role Display Name Modified",
76
+ # "description": "Role description",
77
+ # "permissions": 1
78
+ # }
79
+ # @data = @mints_user.update_role(8, data)
80
+ def update_role(id, data) #FIXME: This action is unauthorized
81
+ #TODO: Research permissions variable type. This would be the error's solution.
82
+ return @client.raw("put", "/config/roles/#{id}", nil, data_transform(data))
83
+ end
84
+ end
@@ -0,0 +1,14 @@
1
+ module Seeds
2
+ ##
3
+ # == Seeds
4
+ #
5
+
6
+ # === Apply seeds.
7
+ # Apply seeds.
8
+ #
9
+ # ==== Example
10
+ #
11
+ def apply_seeds(data) #TODO: Research use
12
+ return @client.raw("post", "/config/seeds", nil, data)
13
+ end
14
+ end
@@ -0,0 +1,53 @@
1
+ module SystemSettings
2
+ ##
3
+ # == System Settings
4
+ #
5
+
6
+ # === Get settings by keys.
7
+ # Get a collection of settings using keys.
8
+ #
9
+ # ==== Example
10
+ # options = {
11
+ # "setting_keys": "email_transport_provider,email_template_provider,email_template_default_from_address"
12
+ # }
13
+ # @data = @mints_user.get_settings_by_keys(options)
14
+ def get_settings_by_keys(options)
15
+ return @client.raw("get", "/config/settings/by-keys", options)
16
+ end
17
+
18
+ # === Get settings.
19
+ # Get a collection of settings.
20
+ #
21
+ # ==== Example
22
+ # @data = @mints_user.get_settings
23
+ def get_settings
24
+ return @client.raw("get", "/config/settings")
25
+ end
26
+
27
+ # === Create setting.
28
+ # Create a setting title with data.
29
+ #
30
+ # ==== Parameters
31
+ # data:: (Hash) -- Data to be submited.
32
+ #
33
+ # ==== Example
34
+ # data = {
35
+ # "title": "new_settings"
36
+ # }
37
+ # @data = @mints_user.create_setting(data)
38
+ def create_setting(data)
39
+ return @client.raw("post", "/config/settings", nil, data_transform(data))
40
+ end
41
+
42
+ # === Clear tag.
43
+ # Clar a tag info.
44
+ #
45
+ # ==== Parameters
46
+ # tag:: (Integer) -- Tag id.
47
+ #
48
+ # ==== Example
49
+ # @data = @mints_user.clear_tag(1)
50
+ def clear_tag(tag)
51
+ return @client.raw("get", "/config/settings/tags/#{tag}/clear")
52
+ end
53
+ end
@@ -0,0 +1,63 @@
1
+ module Tags
2
+ ##
3
+ # == Tags
4
+ #
5
+
6
+ # === Get tags.
7
+ # Get a collection of tags.
8
+ #
9
+ # ==== Example
10
+ # @data = @mints_user.get_tags
11
+ def get_tags
12
+ return @client.raw("get", "/config/tags")
13
+ end
14
+
15
+ # === Get tag.
16
+ # Get a tag info.
17
+ #
18
+ # ==== Parameters
19
+ # id:: (Integer) -- Tag id.
20
+ #
21
+ # ==== Example
22
+ # @data = @mints_user.get_tag(1)
23
+ def get_tag(id)
24
+ return @client.raw("get", "/config/tags/#{id}")
25
+ end
26
+
27
+ # === Create tag.
28
+ # Create a tag with data.
29
+ #
30
+ # ==== Parameters
31
+ # data:: (Hash) -- Data to be submited.
32
+ #
33
+ # ==== Example
34
+ # data = {
35
+ # "tag": "new-tag",
36
+ # "is_visible": true
37
+ # }
38
+ # @data = @mints_user.create_tag(data.to_json)
39
+ def create_tag(data)
40
+ return @client.raw("post", "/config/tags", nil, data)
41
+ end
42
+
43
+ # === Update tag.
44
+ # Update a tag info.
45
+ #
46
+ # ==== Parameters
47
+ # id:: (Integer) -- Tag id.
48
+ # data:: (Hash) -- Data to be submited.
49
+ #
50
+ # ==== Example
51
+ # data = {
52
+ # "tag": {
53
+ # "tag": "new-tag",
54
+ # "slug": "new-tag",
55
+ # "is_visible": false
56
+ # }
57
+ # }
58
+ # @data = @mints_user.update_tag(54, data.to_json)
59
+ def update_tag(id, data)
60
+ #TODO: Inform TagController.update method has been modified
61
+ return @client.raw("put", "/config/tags/#{id}", nil, data)
62
+ end
63
+ end