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