mints 0.0.27 → 0.0.29

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +287 -385
  4. data/lib/contact/config/appointments.rb +201 -0
  5. data/lib/contact/config/config.rb +7 -0
  6. data/lib/contact/content/content.rb +7 -0
  7. data/lib/contact/content/conversations.rb +121 -0
  8. data/lib/contact/ecommerce/ecommerce.rb +12 -0
  9. data/lib/contact/ecommerce/order_items.rb +19 -0
  10. data/lib/contact/ecommerce/order_items_groups.rb +95 -0
  11. data/lib/contact/ecommerce/orders.rb +133 -0
  12. data/lib/contact.rb +57 -607
  13. data/lib/errors.rb +4 -2
  14. data/lib/generators/mints_assets_controller.rb +4 -1
  15. data/lib/generators/mints_config.yml.erb +0 -2
  16. data/lib/generators/mints_contact_controller.rb +4 -1
  17. data/lib/generators/mints_files_generator.rb +16 -13
  18. data/lib/generators/mints_link.rb +9 -6
  19. data/lib/generators/mints_public_controller.rb +4 -1
  20. data/lib/generators/mints_user_controller.rb +3 -0
  21. data/lib/generators/short_link_controller.rb +4 -1
  22. data/lib/mints/controllers/admin_base_controller.rb +5 -3
  23. data/lib/mints/controllers/base_api_controller.rb +6 -4
  24. data/lib/mints/controllers/base_controller.rb +5 -3
  25. data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
  26. data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
  27. data/lib/mints/controllers/contact_api_controller.rb +12 -10
  28. data/lib/mints/controllers/public_api_controller.rb +10 -8
  29. data/lib/mints/controllers/user_api_controller.rb +11 -9
  30. data/lib/mints/helpers/contact_auth_helper.rb +3 -1
  31. data/lib/mints/helpers/mints_helper.rb +39 -38
  32. data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
  33. data/lib/mints/helpers/user_auth_helper.rb +5 -3
  34. data/lib/mints.rb +12 -10
  35. data/lib/pub.rb +75 -93
  36. data/lib/user/config/api_keys.rb +63 -61
  37. data/lib/user/config/appointments.rb +217 -215
  38. data/lib/user/config/attribute_groups.rb +74 -72
  39. data/lib/user/config/attributes.rb +83 -81
  40. data/lib/user/config/calendars.rb +88 -86
  41. data/lib/user/config/config.rb +31 -63
  42. data/lib/user/config/public_folders.rb +105 -104
  43. data/lib/user/config/relationships.rb +135 -132
  44. data/lib/user/config/roles.rb +76 -79
  45. data/lib/user/config/seeds.rb +52 -51
  46. data/lib/user/config/system_settings.rb +50 -49
  47. data/lib/user/config/tags.rb +57 -59
  48. data/lib/user/config/taxonomies.rb +115 -119
  49. data/lib/user/config/teams.rb +69 -68
  50. data/lib/user/config/users.rb +72 -71
  51. data/lib/user/contacts/contacts.rb +21 -20
  52. data/lib/user/content/assets.rb +275 -280
  53. data/lib/user/content/content.rb +236 -235
  54. data/lib/user/content/content_instances.rb +138 -138
  55. data/lib/user/content/content_templates.rb +105 -103
  56. data/lib/user/content/conversations.rb +195 -193
  57. data/lib/user/content/dam.rb +85 -80
  58. data/lib/user/content/forms.rb +231 -233
  59. data/lib/user/content/message_templates.rb +154 -151
  60. data/lib/user/content/messages.rb +89 -87
  61. data/lib/user/content/pages.rb +84 -82
  62. data/lib/user/content/stories.rb +101 -101
  63. data/lib/user/content/story_templates.rb +90 -88
  64. data/lib/user/content/story_versions.rb +117 -117
  65. data/lib/user/crm/companies.rb +106 -106
  66. data/lib/user/crm/contacts.rb +287 -292
  67. data/lib/user/crm/crm.rb +21 -19
  68. data/lib/user/crm/deals.rb +105 -103
  69. data/lib/user/crm/favorites.rb +16 -13
  70. data/lib/user/crm/segments.rb +123 -123
  71. data/lib/user/crm/users.rb +22 -20
  72. data/lib/user/crm/workflow_step_objects.rb +86 -84
  73. data/lib/user/crm/workflow_steps.rb +47 -45
  74. data/lib/user/crm/workflows.rb +67 -65
  75. data/lib/user/ecommerce/ecommerce.rb +29 -27
  76. data/lib/user/ecommerce/item_prices.rb +84 -81
  77. data/lib/user/ecommerce/locations.rb +162 -160
  78. data/lib/user/ecommerce/order_items_groups.rb +110 -106
  79. data/lib/user/ecommerce/order_statuses.rb +26 -24
  80. data/lib/user/ecommerce/orders.rb +253 -246
  81. data/lib/user/ecommerce/price_lists.rb +70 -68
  82. data/lib/user/ecommerce/product_templates.rb +101 -99
  83. data/lib/user/ecommerce/product_variations.rb +124 -120
  84. data/lib/user/ecommerce/products.rb +162 -159
  85. data/lib/user/ecommerce/skus.rb +87 -85
  86. data/lib/user/ecommerce/taxes.rb +81 -79
  87. data/lib/user/ecommerce/variant_options.rb +68 -66
  88. data/lib/user/ecommerce/variant_values.rb +71 -69
  89. data/lib/user/helpers/helpers.rb +104 -101
  90. data/lib/user/helpers/object_activities.rb +80 -78
  91. data/lib/user/helpers/object_folders.rb +78 -76
  92. data/lib/user/helpers/user_folders.rb +79 -77
  93. data/lib/user/marketing/marketing.rb +116 -113
  94. data/lib/user/profile/profile.rb +96 -103
  95. data/lib/user.rb +32 -41
  96. metadata +50 -43
  97. data/lib/user/config/importers.rb +0 -184
@@ -1,21 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  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 submitted.
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
- @client.raw("post", "/contacts/change-password-no-auth", nil, data_transform(data))
20
- end
21
- end
4
+ ##
5
+ # == Contact Auth
6
+ #
7
+ # === Change password no auth.
8
+ # Change password to an email without auth.
9
+ #
10
+ # ==== Parameters
11
+ # data:: (Hash) -- Data to be submitted.
12
+ #
13
+ # ==== Example
14
+ # data = {
15
+ # password: '12345678',
16
+ # email: 'email@example.com'
17
+ # }
18
+ # @data = @mints_user.change_password_no_auth(data)
19
+ def change_password_no_auth(data)
20
+ @client.raw('post', '/contacts/change-password-no-auth', nil, data_transform(data))
21
+ end
22
+ end
@@ -1,299 +1,294 @@
1
- module Assets
2
-
1
+ # frozen_string_literal: true
3
2
 
4
- ##
5
- # == Assets
6
- #
7
- # === Get assets.
8
- # Get a collection of assets.
9
- #
10
- # ==== Parameters
11
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
12
- # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
13
- #
14
- # ==== First Example
15
- # @data = @mints_user.get_assets
16
- #
17
- # ==== Second Example
18
- # options = {
19
- # "fields": "id, title"
20
- # }
21
- # @data = @mints_user.get_assets(options)
22
- #
23
- # ==== Third Example
24
- # options = {
25
- # "fields": "id, title"
26
- # }
27
- # @data = @mints_user.get_assets(options, true)
28
- def get_assets(options = nil, use_post = true)
29
- return get_query_results("/content/assets", options, use_post)
30
- end
3
+ module Assets
4
+ ##
5
+ # == Assets
6
+ #
7
+ # === Get assets.
8
+ # Get a collection of assets.
9
+ #
10
+ # ==== Parameters
11
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
12
+ # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
13
+ #
14
+ # ==== First Example
15
+ # @data = @mints_user.get_assets
16
+ #
17
+ # ==== Second Example
18
+ # options = { fields: 'id, title' }
19
+ # @data = @mints_user.get_assets(options)
20
+ #
21
+ # ==== Third Example
22
+ # options = { fields: 'id, title' }
23
+ # @data = @mints_user.get_assets(options, true)
24
+ def get_assets(options = nil, use_post = true)
25
+ get_query_results('/content/assets', options, use_post)
26
+ end
31
27
 
32
- # === Get asset.
33
- # Get a asset info.
34
- #
35
- # ==== Parameters
36
- # id:: (Integer) -- Asset id.
37
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
38
- #
39
- # ==== First Example
40
- # @data = @mints_user.get_asset(1)
41
- #
42
- # ==== Second Example
43
- # options = {
44
- # "fields": "id, title"
45
- # }
46
- # @data = @mints_user.get_asset(1, options)
47
- def get_asset(id, options = nil)
48
- @client.raw("get", "/content/assets/#{id}", options)
49
- end
28
+ # === Get asset.
29
+ # Get a asset info.
30
+ #
31
+ # ==== Parameters
32
+ # id:: (Integer) -- Asset id.
33
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
34
+ #
35
+ # ==== First Example
36
+ # @data = @mints_user.get_asset(1)
37
+ #
38
+ # ==== Second Example
39
+ # options = {
40
+ # fields: 'id, title'
41
+ # }
42
+ # @data = @mints_user.get_asset(1, options)
43
+ def get_asset(id, options = nil)
44
+ @client.raw('get', "/content/assets/#{id}", options)
45
+ end
50
46
 
51
- # === Create asset.
52
- # Create a asset with data.
53
- #
54
- # ==== Parameters
55
- # data:: (Hash) -- Data to be submitted.
56
- #
57
- # ==== Example
58
- # data = {
59
- # "title": "New Asset",
60
- # "slug": "new-asset",
61
- # }
62
- # @data = @mints_user.create_asset(data)
63
- def create_asset(data)
64
- @client.raw("post", "/content/assets", nil, data_transform(data))
65
- end
47
+ # === Create asset.
48
+ # Create a asset with data.
49
+ #
50
+ # ==== Parameters
51
+ # data:: (Hash) -- Data to be submitted.
52
+ #
53
+ # ==== Example
54
+ # data = {
55
+ # title: 'New Asset',
56
+ # slug: 'new-asset',
57
+ # }
58
+ # @data = @mints_user.create_asset(data)
59
+ def create_asset(data)
60
+ @client.raw('post', '/content/assets', nil, data_transform(data))
61
+ end
66
62
 
67
- # === Update asset.
68
- # Update a asset info.
69
- #
70
- # ==== Parameters
71
- # id:: (Integer) -- Asset id.
72
- # data:: (Hash) -- Data to be submitted.
73
- #
74
- # ==== Example
75
- # data = {
76
- # "title": "New Asset Modified",
77
- # "slug": "new-asset"
78
- # }
79
- # @data = @mints_user.update_asset(5, data)
80
- def update_asset(id, data)
81
- @client.raw("put", "/content/assets/#{id}", nil, data_transform(data))
82
- end
63
+ # === Update asset.
64
+ # Update a asset info.
65
+ #
66
+ # ==== Parameters
67
+ # id:: (Integer) -- Asset id.
68
+ # data:: (Hash) -- Data to be submitted.
69
+ #
70
+ # ==== Example
71
+ # data = {
72
+ # title: 'New Asset Modified',
73
+ # slug: 'new-asset'
74
+ # }
75
+ # @data = @mints_user.update_asset(5, data)
76
+ def update_asset(id, data)
77
+ @client.raw('put', "/content/assets/#{id}", nil, data_transform(data))
78
+ end
83
79
 
84
- # === Delete asset.
85
- # Delete a asset.
86
- #
87
- # ==== Parameters
88
- # id:: (Integer) -- Asset id.
89
- #
90
- # ==== Example
91
- # @data = @mints_user.delete_asset(6)
92
- def delete_asset(id)
93
- @client.raw("delete", "/content/assets/#{id}")
94
- end
80
+ # === Delete asset.
81
+ # Delete a asset.
82
+ #
83
+ # ==== Parameters
84
+ # id:: (Integer) -- Asset id.
85
+ #
86
+ # ==== Example
87
+ # @data = @mints_user.delete_asset(6)
88
+ def delete_asset(id)
89
+ @client.raw('delete', "/content/assets/#{id}")
90
+ end
95
91
 
96
- # === Get asset link info.
97
- # Get information of an asset by url.
98
- #
99
- # ==== Parameters
100
- # data:: (Hash) -- Data to be submitted.
101
- #
102
- # ==== Example
103
- # data = {
104
- # "link": "https://www.example.com/img/img.jpg"
105
- # }
106
- # @data = @mints_user.get_asset_link_info(data.to_json)
107
- def get_asset_link_info(data)
108
- @client.raw("post", "/content/assets/getLinkInfo", nil, data)
109
- end
92
+ # === Get asset link info.
93
+ # Get information of an asset by url.
94
+ #
95
+ # ==== Parameters
96
+ # data:: (Hash) -- Data to be submitted.
97
+ #
98
+ # ==== Example
99
+ # data = {
100
+ # link: 'https://www.example.com/img/img.jpg'
101
+ # }
102
+ # @data = @mints_user.get_asset_link_info(data.to_json)
103
+ def get_asset_link_info(data)
104
+ @client.raw('post', '/content/assets/getLinkInfo', nil, data)
105
+ end
110
106
 
111
- # === Download asset.
112
- # Get information of an asset.
113
- #
114
- # ==== Parameters
115
- # id:: (Integer) -- Asset id.
116
- #
117
- # ==== Example
118
- # @data = @mints_user.download_asset(2)
119
- def download_asset(id) #FIXME: File not found at path, error in result but method works
120
- @client.raw("get", "/content/assets/download/#{id}")
121
- end
107
+ # === Download asset.
108
+ # Get information of an asset.
109
+ #
110
+ # ==== Parameters
111
+ # id:: (Integer) -- Asset id.
112
+ #
113
+ # ==== Example
114
+ # @data = @mints_user.download_asset(2)
115
+ def download_asset(id)
116
+ # FIXME: File not found at path, error in result but method works
117
+ @client.raw('get', "/content/assets/download/#{id}")
118
+ end
122
119
 
120
+ def get_asset_thumbnails(id)
123
121
  # FIXME: Returns json invalid token
124
- # def get_asset_thumbnails(id)
125
- # @client.raw("get", "/content/assets/thumbnails/#{id}")
126
- #end
127
-
128
- # === Get asset usage.
129
- # Get usage of an asset.
130
- #
131
- # ==== Parameters
132
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
133
- def get_asset_usage(options)
134
- @client.raw("get", "/content/assets/usage", options)
135
- end
136
-
137
- # === Get asset info.
138
- # Get info of an asset.
139
- #TODO: Research if is an asset or many assets
140
- #
141
- # ==== Parameters
142
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
143
- def get_asset_info(options)
144
- @client.raw("get", "/content/assets/getAssetInfo", options)
145
- end
146
-
147
- # === Get asset doc types.
148
- # Get doc types of assets.
149
- def get_asset_doc_types
150
- @client.raw("get", "/content/assets/docTypes")
151
- end
152
-
153
- # === Get asset public route.
154
- # Get public route of assets.
155
- def get_asset_public_route
156
- @client.raw("get", "/content/assets/publicRoute")
157
- end
158
-
159
- # === Upload asset.
160
- # Upload an asset. It can be images, documents and videos.
161
- #
162
- # ==== Parameters
163
- # data:: (Hash) -- Data to be submitted.
164
- #
165
- # ==== First Example (with files)
166
- #
167
- #
168
- # ==== Second Example (with urls)
169
- # data = {
170
- # "title": "asset title",
171
- # "description": "asset description",
172
- # "link": "https://link/example",
173
- # "url-type": "url-image",
174
- # "slug": "slug",
175
- # "type": "link",
176
- # "father_id": 1
177
- # }
178
- # @data = @mints_user.upload_asset(data.to_json)
179
- #
180
- # ==== Third Example (with video)
181
- # data = {
182
- # "title": "Video Title",
183
- # "fileType": "video/mp4",
184
- # "type": "video",
185
- # "slug": "video-slug",
186
- # "status": "not-uploaded",
187
- # "ext": "mp4",
188
- # "size": 29605264,
189
- # "access_token": "access_token",
190
- # "name": "Video Title",
191
- # "videoData": {
192
- # "id": 80313307,
193
- # "name": "Video Title",
194
- # "type": "video",
195
- # "created": "2021-10-19T19:18:17+00:00",
196
- # "updated": "2021-10-19T19:18:17+00:00",
197
- # "duration": 191.936133,
198
- # "hashed_id": "hashed_id",
199
- # "progress": 0.14285714285714285,
200
- # "status": "queued",
201
- # "thumbnail": {
202
- # "url": "https://www.example.com/img/img.jpg",
203
- # "width": 200,
204
- # "height": 120
205
- # },
206
- # "account_id": 1234567
207
- # }
208
- # }
209
- # @data = @mints_user.upload_asset(data.to_json)
210
- def upload_asset(data) #TODO: Research a way to upload a File accross sdk
211
- @client.raw("post", "/content/assets/upload", nil, data)
212
- end
213
-
122
+ @client.raw('get', "/content/assets/thumbnails/#{id}")
123
+ end
214
124
 
215
- ##
216
- # == Sizes
217
- #
125
+ # === Get asset usage.
126
+ # Get usage of an asset.
127
+ #
128
+ # ==== Parameters
129
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
130
+ def get_asset_usage(options)
131
+ @client.raw('get', '/content/assets/usage', options)
132
+ end
218
133
 
134
+ # === Get asset info.
135
+ # Get info of an asset.
136
+ # TODO: Research if is an asset or many assets
137
+ #
138
+ # ==== Parameters
139
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
140
+ def get_asset_info(options)
141
+ @client.raw('get', '/content/assets/getAssetInfo', options)
142
+ end
219
143
 
220
- #FIXME: Double get asset sizes method!
221
- # === Get asset sizes.
222
- # Get a collection of sizes of an asset.
223
- #
224
- # ==== Parameters
225
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
226
- def get_asset_sizes(options)
227
- @client.raw("get", "/content/assets/sizes", options)
228
- end
144
+ # === Get asset doc types.
145
+ # Get doc types of assets.
146
+ def get_asset_doc_types
147
+ @client.raw('get', '/content/assets/docTypes')
148
+ end
229
149
 
230
- # === Get asset sizes.
231
- # Get sizes of an asset.
232
- #
233
- # ==== Parameters
234
- # id:: (Integer) Asset id.
235
- #
236
- # ==== Example
237
- # @data = @mints_user.get_asset_sizes(2)
238
- def get_asset_size(id) #FIXME: wrong number of arguments (given 1, expected 0)
239
- @client.raw("get", "/content/assets/sizes/#{id}")
240
- end
150
+ # === Get asset public route.
151
+ # Get public route of assets.
152
+ def get_asset_public_route
153
+ @client.raw('get', '/content/assets/publicRoute')
154
+ end
241
155
 
242
- # === Create asset size.
243
- # Create an asset size by data.
244
- #
245
- # ==== Parameters
246
- # data:: (Hash) -- Data to be submitted.
247
- #
248
- # ==== Example
249
- # data = {
250
- # "aspectRadio": "custom",
251
- # "assetId": 23,
252
- # "drawPosData": {
253
- # "pos": {
254
- # "sx": 100,
255
- # "sy": 100,
256
- # "swidth": 200,
257
- # "sheight": 200
258
- # }
259
- # },
260
- # "width": 100,
261
- # "height": 100,
262
- # "slug": "fuji_size_slug",
263
- # "title": "fuji_size",
264
- # "variationId": "original"
265
- # }
266
- # @data = @mints_user.create_asset_size(data.to_json)
267
- def create_asset_size(data)
268
- @client.raw("post", "/content/assets/sizes", nil, data)
269
- end
156
+ # === Upload asset.
157
+ # Upload an asset. It can be images, documents and videos.
158
+ #
159
+ # ==== Parameters
160
+ # data:: (Hash) -- Data to be submitted.
161
+ #
162
+ # ==== First Example (with files)
163
+ #
164
+ #
165
+ # ==== Second Example (with urls)
166
+ # data = {
167
+ # title: 'asset title',
168
+ # description: 'asset description',
169
+ # link: 'https://link/example',
170
+ # url-type: 'url-image',
171
+ # slug: 'slug',
172
+ # type: 'link',
173
+ # father_id: 1
174
+ # }
175
+ # @data = @mints_user.upload_asset(data.to_json)
176
+ #
177
+ # ==== Third Example (with video)
178
+ # data = {
179
+ # title: 'Video Title',
180
+ # fileType: 'video/mp4',
181
+ # type: 'video',
182
+ # slug: 'video-slug',
183
+ # status: 'not-uploaded',
184
+ # ext: 'mp4',
185
+ # size: 29605264,
186
+ # access_token: 'access_token',
187
+ # name: 'Video Title',
188
+ # videoData: {
189
+ # id: 80313307,
190
+ # name: 'Video Title',
191
+ # type: 'video',
192
+ # created: '2021-10-19T19:18:17+00:00',
193
+ # updated: '2021-10-19T19:18:17+00:00',
194
+ # duration: 191.936133,
195
+ # hashed_id: 'hashed_id',
196
+ # progress: 0.14285714285714285,
197
+ # status: 'queued',
198
+ # thumbnail: {
199
+ # url: 'https://www.example.com/img/img.jpg',
200
+ # width: 200,
201
+ # height: 120
202
+ # },
203
+ # account_id: 1234567
204
+ # }
205
+ # }
206
+ # @data = @mints_user.upload_asset(data.to_json)
207
+ def upload_asset(data)
208
+ # TODO: Research a way to upload a File across sdk
209
+ @client.raw('post', '/content/assets/upload', nil, data)
210
+ end
270
211
 
212
+ ##
213
+ # == Sizes
214
+ #
215
+ # === Get asset sizes.
216
+ # Get a collection of sizes of an asset.
217
+ #
218
+ # ==== Parameters
219
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
220
+ # FIXME: Double get asset sizes method!
221
+ def get_asset_sizes(options)
222
+ @client.raw('get', '/content/assets/sizes', options)
223
+ end
271
224
 
272
- ##
273
- # == Variations
274
- #
225
+ # === Get asset sizes.
226
+ # Get sizes of an asset.
227
+ #
228
+ # ==== Parameters
229
+ # id:: (Integer) Asset id.
230
+ #
231
+ # ==== Example
232
+ # @data = @mints_user.get_asset_sizes(2)
233
+ def get_asset_size(id)
234
+ # FIXME: wrong number of arguments (given 1, expected 0)
235
+ @client.raw('get', "/content/assets/sizes/#{id}")
236
+ end
275
237
 
238
+ # === Create asset size.
239
+ # Create an asset size by data.
240
+ #
241
+ # ==== Parameters
242
+ # data:: (Hash) -- Data to be submitted.
243
+ #
244
+ # ==== Example
245
+ # data = {
246
+ # aspectRadio: 'custom',
247
+ # assetId: 23,
248
+ # drawPosData: {
249
+ # pos: {
250
+ # sx: 100,
251
+ # sy: 100,
252
+ # swidth: 200,
253
+ # sheight: 200
254
+ # }
255
+ # },
256
+ # width: 100,
257
+ # height: 100,
258
+ # slug: 'fuji_size_slug',
259
+ # title: 'fuji_size',
260
+ # variationId: 'original'
261
+ # }
262
+ # @data = @mints_user.create_asset_size(data.to_json)
263
+ def create_asset_size(data)
264
+ @client.raw('post', '/content/assets/sizes', nil, data)
265
+ end
276
266
 
277
- # === Get asset variation.
278
- # Get variation of an asset.
279
- #
280
- # ==== Parameters
281
- # id:: (Integer) Asset variation id. #TODO: Research if is an asset id or an variation id
282
- #
283
- # ==== Example
284
- # @data = @mints_user.get_asset_sizes(2)
285
- def get_asset_variation(id)
286
- #FIXME: Id 1 and 4: Trying to get property 'path' of non-object maybe json conversion is bad
287
- #FIXME: Id 2 and 3: File not found at path maybe doesnt exist
288
- @client.raw("get", "/content/assets/variation/#{id}")
289
- end
267
+ ##
268
+ # == Variations
269
+ #
270
+ # === Get asset variation.
271
+ # Get variation of an asset.
272
+ #
273
+ # ==== Parameters
274
+ # id:: (Integer) Asset variation id.
275
+ #
276
+ # ==== Example
277
+ # @data = @mints_user.get_asset_sizes(2)
278
+ # TODO: Research if is an asset id or an variation id
279
+ def get_asset_variation(id)
280
+ # FIXME: Id 1 and 4: Trying to get property 'path' of non-object maybe json conversion is bad
281
+ # FIXME: Id 2 and 3: File not found at path maybe doesnt exist
282
+ @client.raw('get', "/content/assets/variation/#{id}")
283
+ end
290
284
 
291
- # === Generate asset variation.
292
- # Create an asset variation of an existing asset.
293
- #
294
- # ==== Parameters
295
- # data:: (Hash) -- Data to be submitted.
296
- def generate_asset_variation(data) #FIXME: Trying to get property 'width' of non-object
297
- @client.raw("post", "/content/assets/generate-asset-variations", nil, data)
298
- end
299
- end
285
+ # === Generate asset variation.
286
+ # Create an asset variation of an existing asset.
287
+ #
288
+ # ==== Parameters
289
+ # data:: (Hash) -- Data to be submitted.
290
+ def generate_asset_variation(data)
291
+ # FIXME: Trying to get property 'width' of non-object
292
+ @client.raw('post', '/content/assets/generate-asset-variations', nil, data)
293
+ end
294
+ end