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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +97 -38
  3. data/lib/contact.rb +124 -21
  4. data/lib/mints/controllers/admin_base_controller.rb +2 -2
  5. data/lib/mints/controllers/base_api_controller.rb +12 -11
  6. data/lib/mints/controllers/base_controller.rb +38 -9
  7. data/lib/mints_helper.rb +47 -0
  8. data/lib/pub.rb +147 -61
  9. data/lib/user/config/api_keys.rb +65 -0
  10. data/lib/user/config/appointments.rb +221 -0
  11. data/lib/user/config/attribute_groups.rb +77 -0
  12. data/lib/user/config/attributes.rb +86 -0
  13. data/lib/user/config/calendars.rb +89 -0
  14. data/lib/user/config/config.rb +65 -0
  15. data/lib/user/config/importers.rb +184 -0
  16. data/lib/user/config/public_folders.rb +108 -0
  17. data/lib/user/config/relationships.rb +138 -0
  18. data/lib/user/config/roles.rb +84 -0
  19. data/lib/user/config/seeds.rb +14 -0
  20. data/lib/user/config/system_settings.rb +53 -0
  21. data/lib/user/config/tags.rb +63 -0
  22. data/lib/user/config/taxonomies.rb +124 -0
  23. data/lib/user/config/teams.rb +70 -0
  24. data/lib/user/config/users.rb +76 -0
  25. data/lib/user/contacts/contacts.rb +21 -0
  26. data/lib/user/content/assets.rb +98 -0
  27. data/lib/user/content/content.rb +235 -0
  28. data/lib/user/content/content_instances.rb +147 -0
  29. data/lib/user/content/content_templates.rb +111 -0
  30. data/lib/user/content/conversations.rb +174 -0
  31. data/lib/user/content/dam.rb +88 -0
  32. data/lib/user/content/forms.rb +168 -0
  33. data/lib/user/content/message_templates.rb +162 -0
  34. data/lib/user/content/messages.rb +90 -0
  35. data/lib/user/content/pages.rb +81 -0
  36. data/lib/user/content/stories.rb +164 -0
  37. data/lib/user/content/story_templates.rb +95 -0
  38. data/lib/user/crm/companies.rb +111 -0
  39. data/lib/user/crm/contacts.rb +312 -0
  40. data/lib/user/crm/crm.rb +21 -0
  41. data/lib/user/crm/deals.rb +111 -0
  42. data/lib/user/crm/favorites.rb +17 -0
  43. data/lib/user/crm/segments.rb +132 -0
  44. data/lib/user/crm/users.rb +22 -0
  45. data/lib/user/crm/workflow_step_objects.rb +89 -0
  46. data/lib/user/crm/workflow_steps.rb +49 -0
  47. data/lib/user/crm/workflows.rb +70 -0
  48. data/lib/user/ecommerce/ecommerce.rb +29 -0
  49. data/lib/user/ecommerce/item_prices.rb +86 -0
  50. data/lib/user/ecommerce/locations.rb +166 -0
  51. data/lib/user/ecommerce/order_items_groups.rb +109 -0
  52. data/lib/user/ecommerce/order_statuses.rb +26 -0
  53. data/lib/user/ecommerce/orders.rb +258 -0
  54. data/lib/user/ecommerce/price_lists.rb +73 -0
  55. data/lib/user/ecommerce/product_templates.rb +104 -0
  56. data/lib/user/ecommerce/product_variations.rb +129 -0
  57. data/lib/user/ecommerce/products.rb +169 -0
  58. data/lib/user/ecommerce/skus.rb +88 -0
  59. data/lib/user/ecommerce/taxes.rb +82 -0
  60. data/lib/user/ecommerce/variant_options.rb +69 -0
  61. data/lib/user/ecommerce/variant_values.rb +72 -0
  62. data/lib/user/helpers/helpers.rb +113 -0
  63. data/lib/user/helpers/object_activities.rb +83 -0
  64. data/lib/user/helpers/object_folders.rb +82 -0
  65. data/lib/user/helpers/user_folders.rb +83 -0
  66. data/lib/user/marketing/marketing.rb +120 -0
  67. data/lib/user/profile/profile.rb +111 -0
  68. data/lib/user.rb +24 -368
  69. metadata +63 -3
@@ -0,0 +1,147 @@
1
+ module ContentInstances
2
+ ##
3
+ # == Content Instances
4
+ #
5
+
6
+ # === Get content instances.
7
+ # Get a collection of content instances.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== First Example
13
+ # @data = @mints_user.get_content_instances
14
+ #
15
+ # ==== Second Example
16
+ # options = { "fields": "id" }
17
+ # @data = @mints_user.get_content_instances(options)
18
+ def get_content_instances(options = nil)
19
+ return @client.raw("get", "/content/instances", options)
20
+ end
21
+
22
+ # === Duplicate content instance.
23
+ # Duplicate a content instance.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Content instance id.
27
+ # data:: (Hash) -- Data to be submited.
28
+ #
29
+ # ==== Example
30
+ # data = {
31
+ # "options": []
32
+ # }
33
+ # @data = @mints_user.duplicate_content_instance(1, data.to_json)
34
+ def duplicate_content_instance(id, data)
35
+ return @client.raw("post", "/content/instances/#{id}/duplicate", nil, data)
36
+ end
37
+
38
+ # === Get content instance.
39
+ # Get a content instance info.
40
+ #
41
+ # ==== Parameters
42
+ # id:: (Integer) -- Content instance id.
43
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
44
+ #
45
+ # ==== First Example
46
+ # @data = @mints_user.get_content_instance(1)
47
+ #
48
+ # ==== Second Example
49
+ # options = { "fields": "id, title" }
50
+ # @data = @mints_user.get_content_instance(1, options)
51
+ def get_content_instance(id, options = nil)
52
+ return @client.raw("get", "/content/instances/#{id}", options)
53
+ end
54
+
55
+ # === Publish content instance.
56
+ # Publish a content instance.
57
+ #
58
+ # ==== Parameters
59
+ # id:: (Integer) -- Content instance id.
60
+ # data:: (Hash) -- Data to be submited.
61
+ #
62
+ # ==== Example
63
+ # data = {
64
+ # "title": "New publish",
65
+ # "slug": "new-publish",
66
+ # "content_template_id": 1
67
+ # }
68
+ # @data = @mints_user.publish_content_instance(2, data)
69
+ def publish_content_instance(id, data)
70
+ return @client.raw("put", "/content/instances/#{id}/publish", nil, data_transform(data))
71
+ end
72
+
73
+ # === Schedule content instance.
74
+ # Schedule a content instance in a specified date.
75
+ #
76
+ # ==== Parameters
77
+ # id:: (Integer) -- Content instance id.
78
+ # data:: (Hash) -- Data to be submited.
79
+ #
80
+ # ==== Example
81
+ # data = {
82
+ # "scheduled_at": "2021-09-06T20:29:16+00:00"
83
+ # }
84
+ # @data = @mints_user.schedule_content_instance(1, data)
85
+ def schedule_content_instance(id, data)
86
+ return @client.raw("put", "/content/instances/#{id}/schedule", nil, data_transform(data))
87
+ end
88
+
89
+ # === Revert published content instance.
90
+ # Revert a published content instance.
91
+ #
92
+ # ==== Parameters
93
+ # id:: (Integer) -- Content instance id.
94
+ #
95
+ # ==== Example
96
+ # @data = @mints_user.revert_published_content_instance(1)
97
+ def revert_published_content_instance(id)
98
+ return @client.raw("get", "/content/instances/#{id}/revert-published-data")
99
+ end
100
+
101
+ # === Create content instance.
102
+ # Create a content instance with data.
103
+ #
104
+ # ==== Parameters
105
+ # data:: (Hash) -- Data to be submited.
106
+ #
107
+ # ==== Example
108
+ # data = {
109
+ # "title": "New Content Instance",
110
+ # "content_template_id": 1,
111
+ # "slug": "new-content-instance-slug"
112
+ # }
113
+ # @data = @mints_user.create_content_instance(data)
114
+ def create_content_instance(data)
115
+ return @client.raw("post", "/content/instances", nil, data_transform(data))
116
+ end
117
+
118
+ # === Update content instance.
119
+ # Update a content instance info.
120
+ #
121
+ # ==== Parameters
122
+ # id:: (Integer) -- Content instance id.
123
+ # data:: (Hash) -- Data to be submited.
124
+ #
125
+ # ==== Example
126
+ # data = {
127
+ # "title": "New Content Instance Modified",
128
+ # "content_template_id": 1,
129
+ # "slug": "new-content-instance-slug"
130
+ # }
131
+ # @data = @mints_user.update_content_instance(18, data)
132
+ def update_content_instance(id, data)
133
+ return @client.raw("put", "/content/instances/#{id}", nil, data_transform(data))
134
+ end
135
+
136
+ # === Delete content instance.
137
+ # Delete a content instance.
138
+ #
139
+ # ==== Parameters
140
+ # id:: (Integer) -- Content instance id.
141
+ #
142
+ # ==== Example
143
+ # @data = @mints_user.delete_content_instance(20)
144
+ def delete_content_instance(id)
145
+ return @client.raw("delete", "/content/instances/#{id}")
146
+ end
147
+ end
@@ -0,0 +1,111 @@
1
+ module ContentTemplates
2
+ ##
3
+ # == Content templates
4
+ #
5
+
6
+ # === Get content template instances.
7
+ # Get instances of a content template.
8
+ #
9
+ # ==== Parameters
10
+ # templateId:: (Integer) -- Template id.
11
+ #
12
+ # ==== Example
13
+ # @data = @mints_user.get_content_template_instances(1)
14
+ def get_content_template_instances(templateId)
15
+ return @client.raw("get", "/content/templates/#{templateId}/instances")
16
+ end
17
+
18
+ # === Duplicate content template.
19
+ # Duplicate a content template.
20
+ #
21
+ # ==== Parameters
22
+ # id:: (Integer) -- Content template id.
23
+ #
24
+ # ==== Example
25
+ # @data = @mints_user.get_content_template(1)
26
+ def duplicate_content_template(id)
27
+ return @client.raw("post", "/content/templates/#{id}/duplicate/")
28
+ end
29
+
30
+ # === Get content templates.
31
+ # Get a collection of content templates.
32
+ #
33
+ # ==== Parameters
34
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
35
+ #
36
+ # ==== First Example
37
+ # @data = @mints_user.get_content_templates
38
+ #
39
+ # ==== Second Example
40
+ # options = { "sort": "title" }
41
+ # @data = @mints_user.get_content_templates(options)
42
+ def get_content_templates(options = nil)
43
+ return @client.raw("get", "/content/templates", options)
44
+ end
45
+
46
+ # === Get content template.
47
+ # Get a content template.
48
+ #
49
+ # ==== Parameters
50
+ # id:: (Integer) -- Content template id.
51
+ #
52
+ # ==== Example
53
+ # @data = @mints_user.get_content_template(1)
54
+ def get_content_template(id)
55
+ return @client.raw("get", "/content/templates/#{id}")
56
+ end
57
+
58
+ # === Create content template.
59
+ # Create a content template with data.
60
+ #
61
+ # ==== Parameters
62
+ # data:: (Hash) -- Data to be submited.
63
+ #
64
+ # ==== Example
65
+ # data = {
66
+ # "template": {
67
+ # "title": "New Content Template",
68
+ # "slug": "new-content-template-slug",
69
+ # "description": "New Content Template Description"
70
+ # }
71
+ # }
72
+ # @data = @mints_user.create_content_template(data.to_json)
73
+ def create_content_template(data)
74
+ #TODO: Inform ContentTemplateController.store method has been modified
75
+ return @client.raw("post", "/content/templates", nil, data)
76
+ end
77
+
78
+ # === Update content template.
79
+ # Update a content template info.
80
+ #
81
+ # ==== Parameters
82
+ # id:: (Integer) -- Content template id.
83
+ # data:: (Hash) -- Data to be submited.
84
+ #
85
+ # ==== Example
86
+ # data = {
87
+ # "template": {
88
+ # "title": "New Content Template Modified",
89
+ # "slug": "new-content-template-slug",
90
+ # "description": "New Content Template Description"
91
+ # }
92
+ # }
93
+ # @data = @mints_user.update_content_template(7, data.to_json)
94
+ def update_content_template(id, data)
95
+ #TODO: Inform ContentTemplateController.update method has been modified
96
+ return @client.raw("put", "/content/templates/#{id}", nil, data)
97
+ end
98
+
99
+ # === Delete content template.
100
+ # Delete a content template.
101
+ #
102
+ # ==== Parameters
103
+ # id:: (Integer) -- Content template id.
104
+ #
105
+ # ==== Example
106
+ # @data = @mints_user.delete_content_template(1)
107
+ def delete_content_template(id)
108
+ #TODO: Inform ContentTemplateController.destroy method has been modified
109
+ return @client.raw("delete", "/content/templates/#{id}")
110
+ end
111
+ end
@@ -0,0 +1,174 @@
1
+ module Conversations
2
+ ##
3
+ # == Conversations
4
+ #
5
+
6
+ ###
7
+ # === Get conversations.
8
+ # Get a collection of conversations.
9
+ #
10
+ # ==== Parameters
11
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
12
+ #
13
+ # ==== First Example
14
+ # @data = @mints_user.get_conversations
15
+ #
16
+ # ==== Second Example
17
+ # options = { "fields": "title" }
18
+ # @data = @mints_user.get_conversations(options)
19
+ def get_conversations(options = nil)
20
+ return @client.raw("get", "/content/conversations", options)
21
+ end
22
+
23
+ # === Get conversation.
24
+ # Get a conversation info.
25
+ #
26
+ # ==== Parameters
27
+ # id:: (Integer) -- Conversation id.
28
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
29
+ #
30
+ # ==== First Example
31
+ # @data = @mints_user.get_conversation(1)
32
+ #
33
+ # ==== Second Example
34
+ # options = { "fields": "title" }
35
+ # @data = @mints_user.get_conversation(1, options)
36
+ def get_conversation(id, options = nil)
37
+ return @client.raw("get", "/content/conversations/#{id}", options)
38
+ end
39
+
40
+ # === Create conversation.
41
+ # Create a conversation with data.
42
+ #
43
+ # ==== Parameters
44
+ # data:: (Hash) -- Data to be submited.
45
+ #
46
+ # ==== Example
47
+ # data = {
48
+ # "title": "New Conversation"
49
+ # }
50
+ # @data = @mints_user.create_conversation(data)
51
+ def create_conversation(data)
52
+ return @client.raw("post", "/content/conversations", nil, data_transform(data))
53
+ end
54
+
55
+ # === Update conversation.
56
+ # Update a conversation info.
57
+ #
58
+ # ==== Parameters
59
+ # id:: (Integer) -- Conversation id.
60
+ # data:: (Hash) -- Data to be submited.
61
+ #
62
+ # ==== Example
63
+ # data = {
64
+ # "title": "New Conversation Modified"
65
+ # }
66
+ # @data = @mints_user.update_conversation(13, data)
67
+ def update_conversation(id, data)
68
+ return @client.raw("put", "/content/conversations/#{id}", nil, data_transform(data))
69
+ end
70
+
71
+ # === Delete conversation.
72
+ # Delete a conversation.
73
+ #
74
+ # ==== Parameters
75
+ # id:: (Integer) -- Conversation id.
76
+ #
77
+ # ==== Example
78
+ # @data = @mints_user.delete_conversation(11)
79
+ def delete_conversation(id)
80
+ return @client.raw("delete", "/content/conversations/#{id}")
81
+ end
82
+
83
+ # === Update conversation status.
84
+ # Update a conversation status.
85
+ #
86
+ # ==== Parameters
87
+ # id:: (Integer) -- Conversation id.
88
+ # data:: (Hash) -- Data to be submited.
89
+ #
90
+ # ==== Example
91
+ # data = {
92
+ # "status": "read"
93
+ # }
94
+ # @data = @mints_user.update_conversation_status(13, data)
95
+ def update_conversation_status(id, data)
96
+ return @client.raw("put", "/content/conversations/#{id}/status", nil, data_transform(data))
97
+ end
98
+
99
+ # === Get conversation participants.
100
+ # Get participants in a conversation.
101
+ #
102
+ # ==== Parameters
103
+ # id:: (Integer) -- Conversation id.
104
+ #
105
+ # ==== Example
106
+ # @data = @mints_user.get_conversation_participants(1)
107
+ def get_conversation_participants(id)
108
+ return @client.raw("get", "/content/conversations/#{id}/participants")
109
+ end
110
+
111
+ # === Attach user in conversation.
112
+ # Attach an user in a conversation.
113
+ #
114
+ # ==== Parameters
115
+ # id:: (Integer) -- Conversation id.
116
+ # data:: (Hash) -- Data to be submited.
117
+ #
118
+ # ==== Example
119
+ # data = {
120
+ # "user_id": 2
121
+ # }
122
+ # @data = @mints_user.attach_user_in_conversation(13, data)
123
+ def attach_user_in_conversation(id, data)
124
+ return @client.raw("post", "/content/conversations/#{id}/attach-user", nil, data_transform(data))
125
+ end
126
+
127
+ # === Detach user in conversation.
128
+ # Detach an user in a conversation.
129
+ #
130
+ # ==== Parameters
131
+ # id:: (Integer) -- Conversation id.
132
+ # data:: (Hash) -- Data to be submited.
133
+ #
134
+ # ==== Example
135
+ # data = {
136
+ # "user_id": 2
137
+ # }
138
+ # @data = @mints_user.detach_user_in_conversation(13, data)
139
+ def detach_user_in_conversation(id, data)
140
+ return @client.raw("post", "/content/conversations/#{id}/detach-user", nil, data_transform(data))
141
+ end
142
+
143
+ # === Attach contact in conversation.
144
+ # Attach a contact in a conversation.
145
+ #
146
+ # ==== Parameters
147
+ # id:: (Integer) -- Conversation id.
148
+ # data:: (Hash) -- Data to be submited.
149
+ #
150
+ # ==== Example
151
+ # data = {
152
+ # "contact_id": 2
153
+ # }
154
+ # @data = @mints_user.attach_contact_in_conversation(1, data)
155
+ def attach_contact_in_conversation(id, data)
156
+ return @client.raw("post", "/content/conversations/#{id}/attach-contact", nil, data_transform(data))
157
+ end
158
+
159
+ # === Detach contact in conversation.
160
+ # Detach a contact in a conversation.
161
+ #
162
+ # ==== Parameters
163
+ # id:: (Integer) -- Contact id.
164
+ # data:: (Hash) -- Data to be submited.
165
+ #
166
+ # ==== Example
167
+ # data = {
168
+ # "contact_id": 2
169
+ # }
170
+ # @data = @mints_user.detach_contact_in_conversation(1, data)
171
+ def detach_contact_in_conversation(id, data)
172
+ return @client.raw("post", "/content/conversations/#{id}/detach-contact", nil, data_transform(data))
173
+ end
174
+ end
@@ -0,0 +1,88 @@
1
+ module DAM
2
+ ##
3
+ # == dam
4
+ #
5
+
6
+ # === Get dam loadtree.
7
+ # Get dam loadtree.
8
+ #
9
+ # ==== Example
10
+ # @data = @mints_user.get_dam_loadtree
11
+ def get_dam_loadtree
12
+ return @client.raw("get", "/content/dam/loadtree")
13
+ end
14
+
15
+ # === Get dam asset locations.
16
+ # Get an asset locations in dam.
17
+ #
18
+ # ==== Parameters
19
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
20
+ #
21
+ # ==== Example
22
+ # @data = @mints_user.get_dam_asset_locations(options)
23
+ def get_dam_asset_locations(options)
24
+ return @client.raw("get", "/content/dam/asset-locations", options)
25
+ end
26
+
27
+ def paste_dam(data) #FIXME: Controller detect object array like a single array.
28
+ return @client.raw("post", "/content/dam/paste", nil, data)
29
+ end
30
+
31
+ # === Rename dam.
32
+ # Rename folder or asset in dam.
33
+ #
34
+ # ==== Parameters
35
+ # data:: (Hash) -- Data to be submited.
36
+ #
37
+ # ==== Example
38
+ # data = {
39
+ # "itemType": "asset",
40
+ # "id": 21,
41
+ # "title": "accusantium",
42
+ # "description": "Ea cupiditate",
43
+ # "slug": "accusantium"
44
+ # }
45
+ # @data = @mints_user.rename_dam(data.to_json)
46
+ def rename_dam(data)
47
+ return @client.raw("post", "/content/dam/rename", nil, data)
48
+ end
49
+
50
+ # === Search dam.
51
+ # Search folder or asset in dam.
52
+ #
53
+ # ==== Parameters
54
+ # data:: (Hash) -- Data to be submited.
55
+ #
56
+ # ==== Example
57
+ # data = {
58
+ # "searchFor": "accusantium"
59
+ # }
60
+ # @data = @mints_user.search_dam(data.to_json)
61
+ def search_dam(data)
62
+ return @client.raw("post", "/content/dam/search", nil, data)
63
+ end
64
+
65
+ def send_to_trash_dam(data) #FIXME: Invalid argument supplied for foreach()
66
+ return @client.raw("post", "/content/dam/sendToTrash", nil, data)
67
+ end
68
+
69
+ def delete_dam(data) #FIXME: Invalid argument supplied for foreach()
70
+ return @client.raw("post", "/content/dam/delete", nil, data)
71
+ end
72
+
73
+ # === Create dam folder.
74
+ # Create a folder in dam.
75
+ #
76
+ # ==== Parameters
77
+ # data:: (Hash) -- Data to be submited.
78
+ #
79
+ # ==== Example
80
+ # data = {
81
+ # "folder_name": "New Dam Folder",
82
+ # "slug": "new-dam-folder"
83
+ # }
84
+ # @data = @mints_user.create_dam_folder(data.to_json)
85
+ def create_dam_folder(data)
86
+ return @client.raw("post", "/content/folders/create", nil, data)
87
+ end
88
+ end
@@ -0,0 +1,168 @@
1
+ module Forms
2
+ ##
3
+ # == Forms
4
+ #
5
+
6
+ # === Get forms.
7
+ # Get a collection of forms.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== First Example
13
+ # @data = @mints_user.get_forms
14
+ #
15
+ # ==== Second Example
16
+ # options = { "sort": "id", "fields": "title" }
17
+ # @data = @mints_user.get_forms(options)
18
+ def get_forms(options = nil)
19
+ return @client.raw("get", "/content/forms", options)
20
+ end
21
+
22
+ # === Publish form.
23
+ # Publish a form.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Form id.
27
+ # data:: (Hash) -- Data to be submited.
28
+ #
29
+ # ==== Example
30
+ # data = {
31
+ # "data": {
32
+ # "slug": "new-publish"
33
+ # }
34
+ # }
35
+ # @data = @mints_user.publish_form(1, data.to_json)
36
+ def publish_form(id, data) #FIXME: Output cannot be processed. response cannot be converted to json.
37
+ return @client.raw("put", "/content/forms/#{id}/publish", nil, data)
38
+ end
39
+
40
+ # === Schedule form.
41
+ # Schedule a form in a specified date.
42
+ #
43
+ # ==== Parameters
44
+ # id:: (Integer) -- Form id.
45
+ # data:: (Hash) -- Data to be submited.
46
+ #
47
+ # ==== Example
48
+ # data = {
49
+ # "data": {
50
+ # "scheduled_at": "2021-09-06T20:29:16+00:00"
51
+ # }
52
+ # }
53
+ # @data = @mints_user.schedule_form(1, data.to_json)
54
+ def schedule_form(id, data) #FIXME: Output cannot be processed. response cannot be converted to json.
55
+ return @client.raw("put", "/content/forms/#{id}/schedule", nil, data)
56
+ end
57
+
58
+ # === Revert published form.
59
+ # Revert a published form.
60
+ #
61
+ # ==== Parameters
62
+ # id:: (Integer) -- Form id.
63
+ #
64
+ # ==== Example
65
+ # @data = @mints_user.revert_published_form(1)
66
+ def revert_published_form(id)
67
+ return @client.raw("get", "/content/forms/#{id}/revert-published-data")
68
+ end
69
+
70
+ # === Duplicate form.
71
+ # Duplicate a form.
72
+ #
73
+ # ==== Parameters
74
+ # id:: (Integer) -- Form id.
75
+ #
76
+ # ==== Example
77
+ # @data = @mints_user.duplicate_form(3)
78
+ def duplicate_form(id)
79
+ return @client.raw("post", "/content/forms/#{id}/duplicate")
80
+ end
81
+
82
+ # === Get form support data.
83
+ # Get form support data.
84
+ #
85
+ # ==== Example
86
+ # @data = @mints_user.get_form_support_data
87
+ def get_form_support_data
88
+ return @client.raw("get", "/content/forms/support-data")
89
+ end
90
+
91
+ # === Get form submissions.
92
+ # Get form submissions.
93
+ #
94
+ # ==== Parameters
95
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
96
+ #
97
+ # ==== First Example
98
+ # @data = @mints_user.get_form_submissions
99
+ #
100
+ # ==== Second Example
101
+ # options = { "fields": "id" }
102
+ # @data = @mints_user.get_form_submissions(options)
103
+ def get_form_submissions(options = nil)
104
+ return @client.raw("get", "/content/forms/submissions", options)
105
+ end
106
+
107
+ # === Get form.
108
+ # Get a form info.
109
+ #
110
+ # ==== Parameters
111
+ # id:: (Integer) -- Form id.
112
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
113
+ #
114
+ # ==== First Example
115
+ # @data = @mints_user.get_form(9)
116
+ #
117
+ # ==== Second Example
118
+ # options = { "sort": "id", "fields": "title" }
119
+ # @data = @mints_user.get_form(2, options)
120
+ def get_form(id, options = nil)
121
+ return @client.raw("get", "/content/forms/#{id}", options)
122
+ end
123
+
124
+ # === Create form.
125
+ # Create a form with data.
126
+ #
127
+ # ==== Parameters
128
+ # data:: (Hash) -- Data to be submited.
129
+ #
130
+ # ==== Example
131
+ # data = {
132
+ # "title": "New Form",
133
+ # "slug": "new-form-slug"
134
+ # }
135
+ # @data = @mints_user.create_form(data)
136
+ def create_form(data)
137
+ return @client.raw("post", "/content/forms", nil, data_transform(data))
138
+ end
139
+
140
+ # === Update form.
141
+ # Update a form info.
142
+ #
143
+ # ==== Parameters
144
+ # id:: (Integer) -- Form id.
145
+ # data:: (Hash) -- Data to be submited.
146
+ #
147
+ # ==== Example
148
+ # data = {
149
+ # "title": "New Form Modified",
150
+ # "slug": "new-form-slug"
151
+ # }
152
+ # @data = @mints_user.update_form(3, data)
153
+ def update_form(id, data)
154
+ return @client.raw("put", "/content/forms/#{id}", nil, data_transform(data))
155
+ end
156
+
157
+ # === Delete form.
158
+ # Delete a form.
159
+ #
160
+ # ==== Parameters
161
+ # id:: (Integer) -- Form id.
162
+ #
163
+ # ==== Example
164
+ # @data = @mints_user.delete_form(9)
165
+ def delete_form(id)
166
+ return @client.raw("delete", "/content/forms/#{id}")
167
+ end
168
+ end