mints 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +38 -32
  3. data/lib/contact.rb +65 -60
  4. data/lib/mints/controllers/base_api_controller.rb +4 -4
  5. data/lib/mints/controllers/base_controller.rb +12 -3
  6. data/lib/mints_helper.rb +47 -0
  7. data/lib/pub.rb +75 -87
  8. data/lib/user/config/api_keys.rb +65 -0
  9. data/lib/user/config/appointments.rb +221 -0
  10. data/lib/user/config/attribute_groups.rb +77 -0
  11. data/lib/user/config/attributes.rb +86 -0
  12. data/lib/user/config/calendars.rb +89 -0
  13. data/lib/user/config/config.rb +65 -0
  14. data/lib/user/config/importers.rb +184 -0
  15. data/lib/user/config/public_folders.rb +108 -0
  16. data/lib/user/config/relationships.rb +138 -0
  17. data/lib/user/config/roles.rb +84 -0
  18. data/lib/user/config/seeds.rb +14 -0
  19. data/lib/user/config/system_settings.rb +53 -0
  20. data/lib/user/config/tags.rb +63 -0
  21. data/lib/user/config/taxonomies.rb +124 -0
  22. data/lib/user/config/teams.rb +70 -0
  23. data/lib/user/config/users.rb +76 -0
  24. data/lib/user/contacts/contacts.rb +21 -0
  25. data/lib/user/content/assets.rb +98 -0
  26. data/lib/user/content/content.rb +235 -0
  27. data/lib/user/content/content_instances.rb +147 -0
  28. data/lib/user/content/content_templates.rb +111 -0
  29. data/lib/user/content/conversations.rb +174 -0
  30. data/lib/user/content/dam.rb +88 -0
  31. data/lib/user/content/forms.rb +168 -0
  32. data/lib/user/content/message_templates.rb +162 -0
  33. data/lib/user/content/messages.rb +90 -0
  34. data/lib/user/content/pages.rb +81 -0
  35. data/lib/user/content/stories.rb +164 -0
  36. data/lib/user/content/story_templates.rb +95 -0
  37. data/lib/user/crm/companies.rb +111 -0
  38. data/lib/user/crm/contacts.rb +312 -0
  39. data/lib/user/crm/crm.rb +21 -0
  40. data/lib/user/crm/deals.rb +111 -0
  41. data/lib/user/crm/favorites.rb +17 -0
  42. data/lib/user/crm/segments.rb +132 -0
  43. data/lib/user/crm/users.rb +22 -0
  44. data/lib/user/crm/workflow_step_objects.rb +89 -0
  45. data/lib/user/crm/workflow_steps.rb +49 -0
  46. data/lib/user/crm/workflows.rb +70 -0
  47. data/lib/user/ecommerce/ecommerce.rb +29 -0
  48. data/lib/user/ecommerce/item_prices.rb +86 -0
  49. data/lib/user/ecommerce/locations.rb +166 -0
  50. data/lib/user/ecommerce/order_items_groups.rb +109 -0
  51. data/lib/user/ecommerce/order_statuses.rb +26 -0
  52. data/lib/user/ecommerce/orders.rb +258 -0
  53. data/lib/user/ecommerce/price_lists.rb +73 -0
  54. data/lib/user/ecommerce/product_templates.rb +104 -0
  55. data/lib/user/ecommerce/product_variations.rb +129 -0
  56. data/lib/user/ecommerce/products.rb +169 -0
  57. data/lib/user/ecommerce/skus.rb +88 -0
  58. data/lib/user/ecommerce/taxes.rb +82 -0
  59. data/lib/user/ecommerce/variant_options.rb +69 -0
  60. data/lib/user/ecommerce/variant_values.rb +72 -0
  61. data/lib/user/helpers/helpers.rb +113 -0
  62. data/lib/user/helpers/object_activities.rb +83 -0
  63. data/lib/user/helpers/object_folders.rb +82 -0
  64. data/lib/user/helpers/user_folders.rb +83 -0
  65. data/lib/user/marketing/marketing.rb +120 -0
  66. data/lib/user/profile/profile.rb +111 -0
  67. data/lib/user.rb +22 -922
  68. metadata +61 -1
data/lib/pub.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'yaml'
2
2
  require_relative './client.rb'
3
+ require_relative './mints_helper.rb'
4
+
3
5
  module Mints
4
6
  ##
5
7
  # == Public context API
@@ -70,39 +72,38 @@ module Mints
70
72
 
71
73
  class Pub
72
74
  attr_reader :client
73
-
74
75
  ##
75
76
  # === Initialize.
76
- # Class constructor
77
+ # Class constructor.
77
78
  #
78
79
  # ==== Parameters
79
- # * +host+ - [String] It's the visitor IP
80
- # * +api_key+ - [String] Mints instance api key
81
- # * +contact_token+ - [String] Cookie 'mints_contact_id' value (mints_contact_token)
80
+ # host:: (String) -- It's the visitor IP.
81
+ # api_key:: (String) -- Mints instance api key.
82
+ # contact_token_id:: (Integer) -- Cookie 'mints_contact_id' value (mints_contact_token).
83
+ #
82
84
  # ==== Return
83
- # Returns a Client object
85
+ # Returns a Client object.
84
86
  def initialize(host, api_key, contact_token_id = nil, debug = false)
85
87
  @client = Mints::Client.new(host, api_key, 'public', nil, contact_token_id, debug)
86
88
  end
87
89
 
88
90
  ##
89
91
  # === Register Visit.
90
- # Register a ghost/contact visit in Mints.Cloud
92
+ # Register a ghost/contact visit in Mints.Cloud.
91
93
  #
92
94
  # ==== Parameters
93
- # * +request+ - [ActionDispatch::Request] request
94
- # * +ip+ - [String] It's the visitor IP
95
- # * +user_agent+ - The visitor's browser user agent
96
- # * +url+ - [String] URL visited
95
+ # request:: (ActionDispatch::Request) -- request.
96
+ # ip:: (String) -- It's the visitor IP.
97
+ # user_agent:: (String) -- The visitor's browser user agent.
98
+ # url:: (String) -- URL visited.
97
99
  #
98
100
  # ==== Example
99
101
  # request = {
100
- # "remote_ip" => "http://864.401.156.12/",
102
+ # "remote_ip" => "http://1.1.1.1/",
101
103
  # "user_agent" => "User Agent",
102
- # "fullpath" => "https://mints.cloud/blog"
104
+ # "fullpath" => "https://fullpath/example"
103
105
  # }
104
106
  # @mints_pub.register_visit(request, request["remote_ip"], request["user_agent"], request["fullpath"])
105
- #
106
107
  def register_visit(request, ip = nil, user_agent = nil, url = nil)
107
108
  data = {
108
109
  ip_address: ip || request.remote_ip,
@@ -115,43 +116,40 @@ module Mints
115
116
 
116
117
  ##
117
118
  # === Register Visit timer.
118
- # Register a page visit time
119
+ # Register a page visit time.
119
120
  #
120
121
  # ==== Parameters
121
- # * +visit+ - [String] It's the visitor IP
122
- # * +time+ - [Integer] The visitor's browser user agent
122
+ # visit:: (String) -- It's the visitor IP.
123
+ # time:: (Integer) -- The visitor's browser user agent.
123
124
  #
124
125
  # ==== Example
125
126
  # @mints_pub.register_visit_timer("60da2325d29acc7e55684472", 4)
126
- #
127
127
  def register_visit_timer(visit, time)
128
128
  return @client.raw("get", "/register-visit-timer?visit=#{visit}&time=#{time}")
129
129
  end
130
130
 
131
131
  ##
132
132
  # === Get Asset Info.
133
- # Get a description of an Asset
133
+ # Get a description of an Asset.
134
134
  #
135
135
  # ==== Parameters
136
- # * +slug+ - [String] It's the string identifier of the asset.
136
+ # slug:: (String) -- It's the string identifier of the asset.
137
137
  #
138
138
  # ==== Example
139
- # @mints_pub.get_asset_info("quaerat")
140
- #
139
+ # @mints_pub.get_asset_info("asset_slug")
141
140
  def get_asset_info(slug)
142
141
  return @client.raw("get", "/content/asset-info/#{slug}")
143
142
  end
144
143
 
145
144
  ##
146
145
  # === Get Stories.
147
- # Get a collection of stories
146
+ # Get a collection of stories.
148
147
  #
149
148
  # ==== Parameters
150
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
149
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
151
150
  #
152
151
  # ==== Example
153
152
  # @mints_pub.get_stories
154
- #
155
153
  def get_stories(options = nil)
156
154
  return @client.raw("get", "/content/stories", options)
157
155
  end
@@ -161,26 +159,24 @@ module Mints
161
159
  # Get a single story.
162
160
  #
163
161
  # ==== Parameters
164
- # * +slug+ - [String] It's the string identifier generated by Mints
165
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
162
+ # slug:: (String) -- It's the string identifier generated by Mints.
163
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
166
164
  #
167
165
  # ==== Example
168
- # @mints_pub.get_story("getting-ready-for-e3")
169
- #
166
+ # @mints_pub.get_story("story_slug")
170
167
  def get_story(slug, options = nil)
171
168
  return @client.raw("get", "/content/stories/#{slug}", options)
172
169
  end
173
170
 
174
171
  ##
175
172
  # === Get Forms.
176
- # Get a collection of forms
173
+ # Get a collection of forms.
177
174
  #
178
175
  # ==== Parameters
179
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
176
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
180
177
  #
181
178
  # ==== Example
182
179
  # @mints_pub.get_forms
183
- #
184
180
  def get_forms(options = nil)
185
181
  return @client.raw("get", "/content/forms", options)
186
182
  end
@@ -190,35 +186,34 @@ module Mints
190
186
  # Get a single form.
191
187
  #
192
188
  # ==== Parameters
193
- # * +slug+ - [String] It's the string identifier generated by Mints
194
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
189
+ # slug:: (String) -- It's the string identifier generated by Mints.
190
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
195
191
  #
196
192
  # ==== Example
197
- # @mints_pub.get_form("survey")
198
- #
193
+ # @mints_pub.get_form("form_slug")
199
194
  def get_form(slug, options = nil)
200
195
  return @client.raw("get", "/content/forms/#{slug}", options)
201
196
  end
202
197
 
203
198
  ##
204
199
  # === Submit Form.
205
- # Submit a form.
200
+ # Submit a form with data.
206
201
  #
207
202
  # ==== Parameters
208
- # * +data+ - [Hash] Data to be submited
203
+ # data:: (Hash) -- Data to be submited.
209
204
  #
210
205
  # ==== Example
211
- # data_form = {
212
- # "data": {
213
- # 'form_slug': 'formulario',
214
- # 'email': 'oscar@mints.cloud',
215
- # 'ingrese-un-texto': 'hola'
216
- # }
206
+ # data = {
207
+ # 'form_slug': 'form_slug',
208
+ # 'email': 'email@example.com',
209
+ # 'given_name': 'given_name',
210
+ # 'f1': 'Field 1 answer',
211
+ # 'f2': 'Field 2 answer',
212
+ # 'f3': 'Field 3 answer'
217
213
  # }
218
- # @mints_pub.submit_form(data_form.to_json)
219
- #
214
+ # @data = @mints_pub.submit_form(data)
220
215
  def submit_form(data)
221
- return @client.raw("post", "/content/forms/submit", nil, data)
216
+ return @client.raw("post", "/content/forms/submit", nil, data_transform(data))
222
217
  end
223
218
 
224
219
  ##
@@ -226,7 +221,7 @@ module Mints
226
221
  # Get a collection of content instances. _Note:_ Options must be specified.
227
222
  #
228
223
  # ==== Parameters
229
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
224
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
230
225
  def get_content_instances(options = nil)
231
226
  return @client.raw("get", "/content/content-instances", options)
232
227
  end
@@ -236,12 +231,11 @@ module Mints
236
231
  # Get a single content instance.
237
232
  #
238
233
  # ==== Parameters
239
- # * +slug+ - [String] It's the string identifier generated by Mints
240
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
234
+ # slug:: (String) -- It's the string identifier generated by Mints.
235
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
241
236
  #
242
237
  # ==== Example
243
- # @mints_pub.get_content_instance("bill-gates")
244
- #
238
+ # @mints_pub.get_content_instance("content_instance_slug")
245
239
  def get_content_instance(slug, options = nil)
246
240
  return @client.raw("get", "/content/content-instances/#{slug}", options)
247
241
  end
@@ -251,22 +245,21 @@ module Mints
251
245
  # Get all content pages.
252
246
  #
253
247
  # ==== Parameters
254
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
248
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
255
249
  def get_content_pages(options = nil)
256
250
  return @client.raw("get", "/content/content-pages", options)
257
251
  end
258
252
 
259
253
  ##
260
254
  # === Get Content Page.
261
- # Get a single content page
255
+ # Get a single content page.
262
256
  #
263
257
  # ==== Parameters
264
- # * +slug+ - [String] It's the slug
265
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
258
+ # slug:: (String) -- It's the string identifier generated by Mints.
259
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
266
260
  #
267
261
  # ==== Example
268
262
  # @mints_pub.get_content_page("test-page")
269
- #
270
263
  def get_content_page(slug, options = nil)
271
264
  return @client.raw("get", "/content/content-pages/#{slug}", options)
272
265
  end
@@ -276,11 +269,10 @@ module Mints
276
269
  # Get all locations.
277
270
  #
278
271
  # ==== Parameters
279
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
272
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
280
273
  #
281
274
  # ==== Example
282
275
  # @mints_pub.get_locations
283
- #
284
276
  def get_locations(options = nil)
285
277
  return @client.raw("get", "/ecommerce/locations", options)
286
278
  end
@@ -290,11 +282,10 @@ module Mints
290
282
  # Get a collection of products.
291
283
  #
292
284
  # ==== Parameters
293
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
285
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
294
286
  #
295
287
  # ==== Example
296
288
  # @mints_pub.get_products
297
- #
298
289
  def get_products(options = nil)
299
290
  return @client.raw("get", "/ecommerce/products", options)
300
291
  end
@@ -304,12 +295,11 @@ module Mints
304
295
  # Get a single product.
305
296
  #
306
297
  # ==== Parameters
307
- # * +slug+ - [String] It's the string identifier generated by Mints
308
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
298
+ # slug:: (String) -- It's the string identifier generated by Mints.
299
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
309
300
  #
310
301
  # ==== Example
311
- # @mints_pub.get_product("batman-shirt")
312
- #
302
+ # @mints_pub.get_product("product_slug")
313
303
  def get_product(slug, options = nil)
314
304
  return @client.raw("get", "/ecommerce/products/#{slug}", options)
315
305
  end
@@ -319,7 +309,7 @@ module Mints
319
309
  # Get a collection of categories.
320
310
  #
321
311
  # ==== Parameters
322
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
312
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
323
313
  #
324
314
  # ==== Example
325
315
  # options = {
@@ -332,18 +322,17 @@ module Mints
332
322
 
333
323
  ##
334
324
  # === Get Category.
335
- # Get a single category
325
+ # Get a single category.
336
326
  #
337
327
  # ==== Parameters
338
- # * +slug+ - [String] It's the string identifier generated by Mints
339
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
328
+ # slug:: (String) -- It's the string identifier generated by Mints.
329
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
340
330
  #
341
331
  # ==== Example
342
332
  # options = {
343
333
  # "object_type": "locations"
344
334
  # }
345
- # @mints_pub.get_category("atm", options)
346
- #
335
+ # @mints_pub.get_category("asset_slug", options)
347
336
  def get_category(slug, options = nil)
348
337
  return @client.raw("get", "/config/categories/#{slug}", options)
349
338
  end
@@ -353,26 +342,24 @@ module Mints
353
342
  # Get a collection of tags.
354
343
  #
355
344
  # ==== Parameters
356
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
345
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
357
346
  #
358
347
  # ==== Example
359
348
  # @mints_pub.get_tags
360
- #
361
349
  def get_tags(options = nil)
362
350
  return @client.raw("get", "/config/tags", options)
363
351
  end
364
352
 
365
353
  ##
366
354
  # === Get Tag.
367
- # Get a single tag
355
+ # Get a single tag.
368
356
  #
369
357
  # ==== Parameters
370
- # * +slug+ - [String] It's the string identifier generated by Mints
371
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
358
+ # slug:: (String) -- It's the string identifier generated by Mints.
359
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
372
360
  #
373
361
  # ==== Example
374
- # @mints_pub.get_tag("ad-0")
375
- #
362
+ # @mints_pub.get_tag("tag_slug")
376
363
  def get_tag(slug, options = nil)
377
364
  return @client.raw("get", "/config/tags/#{slug}", options)
378
365
  end
@@ -382,26 +369,24 @@ module Mints
382
369
  # Get a collection of taxonomies.
383
370
  #
384
371
  # ==== Parameters
385
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
372
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
386
373
  #
387
374
  # ==== Example
388
375
  # @mints_pub.get_taxonomies
389
- #
390
376
  def get_taxonomies(options = nil)
391
377
  return @client.raw("get", "/config/taxonomies", options)
392
378
  end
393
379
 
394
380
  ##
395
381
  # === Get Taxonomy.
396
- # Get a single taxonomy
382
+ # Get a single taxonomy.
397
383
  #
398
384
  # ==== Parameters
399
- # * +slug+ - [String] It's the string identifier generated by Mints
400
- # * +options+ - [Hash] List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter
385
+ # slug:: (String) -- It's the string identifier generated by Mints.
386
+ # options:: (Hash) -- List of {Single Resource Options}[#class-Mints::Pub-label-Single+resource+options] shown above can be used as parameter.
401
387
  #
402
388
  # ==== Example
403
- # @mints_pub.get_taxonomy("unit_pricing_measure")
404
- #
389
+ # @mints_pub.get_taxonomy("taxonomy_slug")
405
390
  def get_taxonomy(slug, options = nil)
406
391
  return @client.raw("get", "/config/taxonomies/#{slug}", options)
407
392
  end
@@ -411,13 +396,16 @@ module Mints
411
396
  # Get a collection of attributes.
412
397
  #
413
398
  # ==== Parameters
414
- # * +options+ - [Hash] List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter
399
+ # options:: (Hash) -- List of {Resource collection Options}[#class-Mints::Pub-label-Resource+collections+options+] shown above can be used as parameter.
415
400
  #
416
401
  # ==== Example
417
402
  # @mints_pub.get_attributes
418
- #
419
403
  def get_attributes(options = nil)
420
404
  return @client.raw("get", "/config/attributes", options)
421
405
  end
406
+
407
+ private
408
+
409
+ include MintsHelper
422
410
  end
423
411
  end
@@ -0,0 +1,65 @@
1
+ module ApiKeys
2
+ ##
3
+ # == Api keys
4
+ #
5
+
6
+ # === Get api keys.
7
+ # Get a collection of api keys.
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_api_keys
14
+ #
15
+ # ==== Second Example
16
+ # options = { "fields": "id" }
17
+ # @data = @mints_user.get_api_keys(options)
18
+ def get_api_keys(options = nil)
19
+ return @client.raw("get", "/config/api-keys", options)
20
+ end
21
+
22
+ # === Get api key.
23
+ # Get an api key info.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Api key id.
27
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
28
+ #
29
+ # ==== First Example
30
+ # @data = @mints_user.get_api_key(2)
31
+ #
32
+ # ==== Second Example
33
+ # options = { "fields": "id" }
34
+ # @data = @mints_user.get_api_key(2, options)
35
+ def get_api_key(id, options = nil)
36
+ return @client.raw("get", "/config/api-keys/#{id}", options)
37
+ end
38
+
39
+ # === Create api key.
40
+ # Create an api key with data.
41
+ #
42
+ # ==== Parameters
43
+ # data:: (Hash) -- Data to be submited.
44
+ #
45
+ # ==== Example
46
+ # data = {
47
+ # "description": "New Api Key Description"
48
+ # }
49
+ # @data = @mints_user.create_api_key(data)
50
+ def create_api_key(data)
51
+ return @client.raw("post", "/config/api-keys", nil, data_transform(data))
52
+ end
53
+
54
+ # === Delete api key.
55
+ # Delete an api key.
56
+ #
57
+ # ==== Parameters
58
+ # id:: (Integer) -- Api key id.
59
+ #
60
+ # ==== Example
61
+ # @data = @mints_user.delete_api_key(2)
62
+ def delete_api_key(id)
63
+ return @client.raw("delete", "/config/api-keys/#{id}")
64
+ end
65
+ end