mints 0.0.28 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +287 -385
  3. data/lib/contact/config/appointments.rb +201 -0
  4. data/lib/contact/config/config.rb +7 -0
  5. data/lib/contact/content/content.rb +7 -0
  6. data/lib/contact/content/conversations.rb +121 -0
  7. data/lib/contact/ecommerce/ecommerce.rb +14 -0
  8. data/lib/contact/ecommerce/order_items.rb +19 -0
  9. data/lib/contact/ecommerce/order_items_groups.rb +95 -0
  10. data/lib/contact/ecommerce/orders.rb +132 -0
  11. data/lib/contact/ecommerce/vouchers.rb +18 -0
  12. data/lib/contact.rb +54 -603
  13. data/lib/errors.rb +4 -2
  14. data/lib/generators/mints_assets_controller.rb +4 -1
  15. data/lib/generators/mints_contact_controller.rb +4 -1
  16. data/lib/generators/mints_files_generator.rb +16 -13
  17. data/lib/generators/mints_link.rb +7 -4
  18. data/lib/generators/mints_public_controller.rb +4 -1
  19. data/lib/generators/mints_user_controller.rb +3 -0
  20. data/lib/generators/short_link_controller.rb +4 -1
  21. data/lib/mints/controllers/admin_base_controller.rb +5 -3
  22. data/lib/mints/controllers/base_api_controller.rb +6 -4
  23. data/lib/mints/controllers/base_controller.rb +5 -3
  24. data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
  25. data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
  26. data/lib/mints/controllers/contact_api_controller.rb +12 -10
  27. data/lib/mints/controllers/public_api_controller.rb +10 -8
  28. data/lib/mints/controllers/user_api_controller.rb +11 -9
  29. data/lib/mints/helpers/contact_auth_helper.rb +5 -3
  30. data/lib/mints/helpers/mints_helper.rb +39 -38
  31. data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
  32. data/lib/mints/helpers/user_auth_helper.rb +5 -3
  33. data/lib/mints.rb +12 -10
  34. data/lib/pub/config/attributes.rb +13 -0
  35. data/lib/pub/config/config.rb +15 -0
  36. data/lib/pub/config/public_folders.rb +51 -0
  37. data/lib/pub/config/tags.rb +42 -0
  38. data/lib/pub/config/taxonomies.rb +49 -0
  39. data/lib/pub/content/assets.rb +16 -0
  40. data/lib/pub/content/content.rb +22 -0
  41. data/lib/pub/content/content_bundles.rb +40 -0
  42. data/lib/pub/content/content_instance_versions.rb +56 -0
  43. data/lib/pub/content/content_instances.rb +37 -0
  44. data/lib/pub/content/forms.rb +47 -0
  45. data/lib/pub/content/stories.rb +44 -0
  46. data/lib/pub/content/story_versions.rb +46 -0
  47. data/lib/pub/ecommerce/ecommerce.rb +14 -0
  48. data/lib/pub/ecommerce/locations.rb +25 -0
  49. data/lib/pub/ecommerce/orders.rb +31 -0
  50. data/lib/pub/ecommerce/products.rb +45 -0
  51. data/lib/pub.rb +22 -461
  52. data/lib/user/config/api_keys.rb +63 -61
  53. data/lib/user/config/appointments.rb +217 -215
  54. data/lib/user/config/attribute_groups.rb +74 -72
  55. data/lib/user/config/attributes.rb +83 -81
  56. data/lib/user/config/calendars.rb +88 -86
  57. data/lib/user/config/config.rb +31 -63
  58. data/lib/user/config/public_folders.rb +105 -104
  59. data/lib/user/config/relationships.rb +135 -132
  60. data/lib/user/config/roles.rb +76 -79
  61. data/lib/user/config/seeds.rb +52 -51
  62. data/lib/user/config/system_settings.rb +50 -49
  63. data/lib/user/config/tags.rb +57 -59
  64. data/lib/user/config/taxonomies.rb +115 -119
  65. data/lib/user/config/teams.rb +2 -0
  66. data/lib/user/config/users.rb +2 -0
  67. data/lib/user/contacts/contacts.rb +2 -0
  68. data/lib/user/content/assets.rb +3 -3
  69. data/lib/user/content/content.rb +224 -223
  70. data/lib/user/content/content_instances.rb +4 -2
  71. data/lib/user/content/content_templates.rb +2 -0
  72. data/lib/user/content/conversations.rb +2 -0
  73. data/lib/user/content/dam.rb +2 -0
  74. data/lib/user/content/forms.rb +2 -0
  75. data/lib/user/content/message_templates.rb +2 -0
  76. data/lib/user/content/messages.rb +2 -0
  77. data/lib/user/content/pages.rb +4 -2
  78. data/lib/user/content/stories.rb +3 -3
  79. data/lib/user/content/story_templates.rb +5 -3
  80. data/lib/user/content/story_versions.rb +2 -0
  81. data/lib/user/crm/companies.rb +3 -1
  82. data/lib/user/crm/contacts.rb +2 -0
  83. data/lib/user/crm/crm.rb +2 -0
  84. data/lib/user/crm/deals.rb +2 -0
  85. data/lib/user/crm/favorites.rb +2 -0
  86. data/lib/user/crm/segments.rb +2 -0
  87. data/lib/user/crm/users.rb +2 -0
  88. data/lib/user/crm/workflow_step_objects.rb +2 -0
  89. data/lib/user/crm/workflow_steps.rb +2 -0
  90. data/lib/user/crm/workflows.rb +2 -0
  91. data/lib/user/ecommerce/ecommerce.rb +4 -0
  92. data/lib/user/ecommerce/item_prices.rb +2 -0
  93. data/lib/user/ecommerce/locations.rb +4 -2
  94. data/lib/user/ecommerce/order_items_groups.rb +5 -2
  95. data/lib/user/ecommerce/order_statuses.rb +2 -0
  96. data/lib/user/ecommerce/orders.rb +4 -1
  97. data/lib/user/ecommerce/price_lists.rb +2 -0
  98. data/lib/user/ecommerce/product_templates.rb +3 -1
  99. data/lib/user/ecommerce/product_variations.rb +2 -0
  100. data/lib/user/ecommerce/products.rb +3 -1
  101. data/lib/user/ecommerce/skus.rb +2 -0
  102. data/lib/user/ecommerce/taxes.rb +2 -0
  103. data/lib/user/ecommerce/variant_options.rb +2 -0
  104. data/lib/user/ecommerce/variant_values.rb +2 -0
  105. data/lib/user/ecommerce/vouchers.rb +90 -0
  106. data/lib/user/helpers/helpers.rb +2 -0
  107. data/lib/user/helpers/object_activities.rb +2 -0
  108. data/lib/user/helpers/object_folders.rb +2 -0
  109. data/lib/user/helpers/user_folders.rb +2 -0
  110. data/lib/user/marketing/marketing.rb +2 -0
  111. data/lib/user/profile/profile.rb +2 -0
  112. data/lib/user.rb +32 -41
  113. metadata +42 -16
  114. data/lib/user/config/importers.rb +0 -184
@@ -1,86 +1,88 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Attributes
2
- ##
3
- # == Attributes
4
- #
4
+ ##
5
+ # == Attributes
6
+ #
7
+
8
+ # === Get attributes data types.
9
+ # Get data types used in attributes.
10
+ #
11
+ # ==== Example
12
+ # @data = @mints_user.get_attributes_data_types
13
+ def get_attributes_data_types
14
+ @client.raw('get', '/config/attributes/data-types')
15
+ end
16
+
17
+ # === Get sub attributes.
18
+ # Get sub attributes with a slug.
19
+ #
20
+ # ==== Parameters
21
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
22
+ #
23
+ # ==== Example
24
+ #
25
+ def get_sub_attributes(options)
26
+ @client.raw('get', '/config/attributes/sub-attributes', options)
27
+ end
5
28
 
6
- # === Get attributes data types.
7
- # Get data types used in attributes.
8
- #
9
- # ==== Example
10
- # @data = @mints_user.get_attributes_data_types
11
- def get_attributes_data_types
12
- @client.raw('get', "/config/attributes/data-types")
13
- end
29
+ # === Get attributes.
30
+ # Get a collection of attributes.
31
+ #
32
+ # ==== Example
33
+ # @data = @mints_user.get_attributes
34
+ def get_attributes
35
+ @client.raw('get', '/config/attributes')
36
+ end
14
37
 
15
- # === Get sub attributes.
16
- # Get sub attributes with a slug.
17
- #
18
- # ==== Parameters
19
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
20
- #
21
- # ==== Example
22
- #
23
- def get_sub_attributes(options) #TODO: Test, this method has been added recently
24
- @client.raw('get', "/config/attributes/sub-attributes", options)
25
- end
26
-
27
- # === Get attributes.
28
- # Get a collection of attributes.
29
- #
30
- # ==== Example
31
- # @data = @mints_user.get_attributes
32
- def get_attributes
33
- @client.raw('get', "/config/attributes")
34
- end
35
-
36
- # === Get attribute.
37
- # Get an attribute info.
38
- #
39
- # ==== Parameters
40
- # id:: (Integer) -- Attribute id.
41
- #
42
- # ==== Example
43
- # @data = @mints_user.get_attribute(1)
44
- def get_attribute(id)
45
- @client.raw('get', "/config/attributes/#{id}")
46
- end
38
+ # === Get attribute.
39
+ # Get an attribute info.
40
+ #
41
+ # ==== Parameters
42
+ # id:: (Integer) -- Attribute id.
43
+ #
44
+ # ==== Example
45
+ # @data = @mints_user.get_attribute(1)
46
+ def get_attribute(id)
47
+ @client.raw('get', "/config/attributes/#{id}")
48
+ end
47
49
 
48
- # === Create attribute.
49
- # Create an attribute with data.
50
- #
51
- # ==== Parameters
52
- # data:: (Hash) -- Data to be submitted.
53
- #
54
- # ==== Example
55
- # data = {
56
- # title: "New Attribute",
57
- # "object_type": "orders",
58
- # slug: "new_attribute",
59
- # "attribute_group_id": 1,
60
- # "data_type_enum": 10
61
- # }
62
- # @data = @mints_user.create_attribute(data)
63
- def create_attribute(data)
64
- @client.raw('post', "/config/attributes", nil, data_transform(data))
65
- end
50
+ # === Create attribute.
51
+ # Create an attribute with data.
52
+ #
53
+ # ==== Parameters
54
+ # data:: (Hash) -- Data to be submitted.
55
+ #
56
+ # ==== Example
57
+ # data = {
58
+ # title: "New Attribute",
59
+ # object_type: "orders",
60
+ # slug: "new_attribute",
61
+ # attribute_group_id: 1,
62
+ # data_type_enum: 10
63
+ # }
64
+ # @data = @mints_user.create_attribute(data)
65
+ def create_attribute(data)
66
+ @client.raw('post', '/config/attributes', nil, data_transform(data))
67
+ end
66
68
 
67
- # === Update attribute.
68
- # Update an attribute info.
69
- #
70
- # ==== Parameters
71
- # id:: (Integer) -- Attribute id.
72
- # data:: (Hash) -- Data to be submitted.
73
- #
74
- # ==== Example
75
- # data = {
76
- # title: "New Attribute Modified",
77
- # "object_type": "orders",
78
- # slug: "new_attribute",
79
- # "attribute_group_id": 1,
80
- # "data_type_enum": 10
81
- # }
82
- # @data = @mints_user.update_attribute(292, data)
83
- def update_attribute(id, data)
84
- @client.raw('put', "/config/attributes/#{id}", nil, data_transform(data))
85
- end
86
- end
69
+ # === Update attribute.
70
+ # Update an attribute info.
71
+ #
72
+ # ==== Parameters
73
+ # id:: (Integer) -- Attribute id.
74
+ # data:: (Hash) -- Data to be submitted.
75
+ #
76
+ # ==== Example
77
+ # data = {
78
+ # title: 'New Attribute Modified',
79
+ # object_type: 'orders',
80
+ # slug: 'new_attribute',
81
+ # attribute_group_id: 1,
82
+ # data_type_enum: 10
83
+ # }
84
+ # @data = @mints_user.update_attribute(292, data)
85
+ def update_attribute(id, data)
86
+ @client.raw('put', "/config/attributes/#{id}", nil, data_transform(data))
87
+ end
88
+ end
@@ -1,89 +1,91 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Calendars
2
- ##
3
- # == Calendars
4
- #
4
+ ##
5
+ # == Calendars
6
+ #
7
+
8
+ # === Get calendars.
9
+ # Get a collection of calendars.
10
+ #
11
+ # ==== Parameters
12
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
13
+ #
14
+ # ==== First Example
15
+ # @data = @mints_user.get_calendars
16
+ #
17
+ # ==== Second Example
18
+ # options = {
19
+ # fields: 'title'
20
+ # }
21
+ # @data = @mints_user.get_calendars(options)
22
+ def get_calendars(options = nil)
23
+ @client.raw('get', '/config/calendars', options)
24
+ end
25
+
26
+ # === Get calendar.
27
+ # Get a calendar info.
28
+ #
29
+ # ==== Parameters
30
+ # id:: (Integer) -- Calendar 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_calendar(1)
35
+ #
36
+ # ==== Second Example
37
+ # options = {
38
+ # fields: 'title'
39
+ # }
40
+ # @data = @mints_user.get_calendar(1, options)
41
+ def get_calendar(id, options = nil)
42
+ @client.raw('get', "/config/calendars/#{id}", options)
43
+ end
44
+
45
+ # === Create calendar.
46
+ # Create a calendar with data.
47
+ #
48
+ # ==== Parameters
49
+ # data:: (Hash) -- Data to be submitted.
50
+ #
51
+ # ==== Example
52
+ # data = {
53
+ # title: 'New Calendar',
54
+ # object_type: 'contacts',
55
+ # object_id: 1
56
+ # }
57
+ # @data = @mints_user.create_calendar(data)
58
+ def create_calendar(data)
59
+ @client.raw('post', '/config/calendars', nil, data_transform(data))
60
+ end
5
61
 
6
- # === Get calendars.
7
- # Get a collection of calendars.
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_calendars
14
- #
15
- # ==== Second Example
16
- # options = {
17
- # fields: "title"
18
- # }
19
- # @data = @mints_user.get_calendars(options)
20
- def get_calendars(options = nil)
21
- @client.raw('get', "/config/calendars", options)
22
- end
23
-
24
- # === Get calendar.
25
- # Get a calendar info.
26
- #
27
- # ==== Parameters
28
- # id:: (Integer) -- Calendar id.
29
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
30
- #
31
- # ==== First Example
32
- # @data = @mints_user.get_calendar(1)
33
- #
34
- # ==== Second Example
35
- # options = {
36
- # fields: "title"
37
- # }
38
- # @data = @mints_user.get_calendar(1, options)
39
- def get_calendar(id, options = nil)
40
- @client.raw('get', "/config/calendars/#{id}", options)
41
- end
42
-
43
- # === Create calendar.
44
- # Create a calendar with data.
45
- #
46
- # ==== Parameters
47
- # data:: (Hash) -- Data to be submitted.
48
- #
49
- # ==== Example
50
- # data = {
51
- # title: "New Calendar",
52
- # "object_type": "contacts",
53
- # "object_id": 1
54
- # }
55
- # @data = @mints_user.create_calendar(data)
56
- def create_calendar(data)
57
- @client.raw('post', "/config/calendars", nil, data_transform(data))
58
- end
62
+ # === Update calendar.
63
+ # Update a calendar info.
64
+ #
65
+ # ==== Parameters
66
+ # id:: (Integer) -- Calendar id.
67
+ # data:: (Hash) -- Data to be submitted.
68
+ #
69
+ # ==== Example
70
+ # data = {
71
+ # title: 'New Calendar Modified',
72
+ # object_type: 'contacts',
73
+ # object_id: 1
74
+ # }
75
+ # @data = @mints_user.update_calendar(4, data)
76
+ def update_calendar(id, data)
77
+ @client.raw('put', "/config/calendars/#{id}", nil, data_transform(data))
78
+ end
59
79
 
60
- # === Update calendar.
61
- # Update a calendar info.
62
- #
63
- # ==== Parameters
64
- # id:: (Integer) -- Calendar id.
65
- # data:: (Hash) -- Data to be submitted.
66
- #
67
- # ==== Example
68
- # data = {
69
- # title: "New Calendar Modified",
70
- # "object_type": "contacts",
71
- # "object_id": 1
72
- # }
73
- # @data = @mints_user.update_calendar(4, data)
74
- def update_calendar(id, data)
75
- @client.raw('put', "/config/calendars/#{id}", nil, data_transform(data))
76
- end
77
-
78
- # === Delete calendar.
79
- # Delete a calendar.
80
- #
81
- # ==== Parameters
82
- # id:: (Integer) -- Calendar id.
83
- #
84
- # ==== Example
85
- # @data = @mints_user.delete_calendar(4)
86
- def delete_calendar(id)
87
- @client.raw('delete', "/config/calendars/#{id}")
88
- end
89
- end
80
+ # === Delete calendar.
81
+ # Delete a calendar.
82
+ #
83
+ # ==== Parameters
84
+ # id:: (Integer) -- Calendar id.
85
+ #
86
+ # ==== Example
87
+ # @data = @mints_user.delete_calendar(4)
88
+ def delete_calendar(id)
89
+ @client.raw('delete', "/config/calendars/#{id}")
90
+ end
91
+ end
@@ -1,65 +1,33 @@
1
- require_relative './api_keys.rb'
2
- require_relative './appointments.rb'
3
- require_relative './attribute_groups.rb'
4
- require_relative './attributes.rb'
5
- require_relative './calendars.rb'
6
- require_relative './importers.rb'
7
- require_relative './public_folders.rb'
8
- require_relative './relationships.rb'
9
- require_relative './roles.rb'
10
- require_relative './seeds.rb'
11
- require_relative './system_settings.rb'
12
- require_relative './tags.rb'
13
- require_relative './taxonomies.rb'
14
- require_relative './teams.rb'
15
- require_relative './users.rb'
1
+ # frozen_string_literal: true
16
2
 
17
- module Config
18
- include ApiKeys
19
- include Appointments
20
- include AttributeGroups
21
- include Attributes
22
- include Calendars
23
- include Importers
24
- include PublicFolders
25
- include Relationships
26
- include Roles
27
- include Seeds
28
- include SystemSettings
29
- include Tags
30
- include Taxonomies
31
- include Teams
32
- include Users
33
-
34
- ##
35
- # == Categories
36
- #
37
-
38
- # def sync_categories_for_object(data)
39
- # @client.raw('put', "/config/categories/sync_categories_for_object", nil, data)
40
- #end
41
-
42
- # def get_categories_for_object(options)
43
- # @client.raw('get', "/config/categories/get_categories_for_object", options)
44
- #end
45
-
46
- # def get_categories
47
- # @client.raw('get', "/config/categories")
48
- #end
3
+ require_relative './api_keys'
4
+ require_relative './appointments'
5
+ require_relative './attribute_groups'
6
+ require_relative './attributes'
7
+ require_relative './calendars'
8
+ require_relative './public_folders'
9
+ require_relative './relationships'
10
+ require_relative './roles'
11
+ require_relative './seeds'
12
+ require_relative './system_settings'
13
+ require_relative './tags'
14
+ require_relative './taxonomies'
15
+ require_relative './teams'
16
+ require_relative './users'
49
17
 
50
- # def create_category(data) #TODO: Research if 'visible' is a boolean or int. It accepts smallint
51
- # @client.raw('post', "/config/categories", nil, data)
52
- #end
53
-
54
- # def update_category(id, data)
55
- # @client.raw('put', "/config/categories/#{id}", nil, data)
56
- #end
57
-
58
- # def get_category_support_data(id)
59
- # @client.raw('get', "/config/categories/support-data/#{id}")
60
- #end
61
-
62
- # def get_category(id)
63
- # @client.raw('get', "/config/categories/#{id}")
64
- #end
65
- end
18
+ module Config
19
+ include ApiKeys
20
+ include Appointments
21
+ include AttributeGroups
22
+ include Attributes
23
+ include Calendars
24
+ include PublicFolders
25
+ include Relationships
26
+ include Roles
27
+ include Seeds
28
+ include SystemSettings
29
+ include Tags
30
+ include Taxonomies
31
+ include Teams
32
+ include Users
33
+ end
@@ -1,108 +1,109 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PublicFolders
2
- ##
3
- # == Public Folders
4
- #
4
+ ##
5
+ # == Public Folders
6
+ #
7
+ # === Sync public folders for object.
8
+ # Sync public folders for object.
9
+ #
10
+ # ==== Parameters
11
+ # data:: (Hash) -- Data to be submitted.
12
+ #
13
+ # ==== Example
14
+ # data = {
15
+ # object_type: 'contacts',
16
+ # object_id: 1
17
+ # }
18
+ # @data = @mints_user.sync_public_folders_for_object(data.to_json)
19
+ def sync_public_folders_for_object(data)
20
+ @client.raw('put', '/config/public-folders/sync_public-folders_for_object', nil, data)
21
+ end
22
+
23
+ # === Get public folders for object.
24
+ # Get public folders for object.
25
+ #
26
+ # ==== Parameters
27
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
28
+ #
29
+ # ==== Example
30
+ # options = {
31
+ # object_type: "contacts",
32
+ # object_id: 1
33
+ # }
34
+ # @data = @mints_user.get_public_folders_for_object(options)
35
+ def get_public_folders_for_object(options)
36
+ @client.raw('get', '/config/public-folders/get_public-folders_for_object', options)
37
+ end
38
+
39
+ # === Get public folders.
40
+ # Get a collection of public folders.
41
+ #
42
+ # ==== Example
43
+ # @data = @mints_user.get_public_folders
44
+ def get_public_folders(options = nil)
45
+ @client.raw('get', '/config/public-folders', options)
46
+ end
47
+
48
+ # === Create public folder.
49
+ # Create a public folder with data.
50
+ #
51
+ # ==== Parameters
52
+ # data:: (Hash) -- Data to be submitted.
53
+ #
54
+ # ==== Example
55
+ # data = {
56
+ # title: 'New Public Folder',
57
+ # slug: 'new-public-folder',
58
+ # object_type: 'contacts',
59
+ # visible: true
60
+ # }
61
+ # @data = @mints_user.create_public_folder(data.to_json)
62
+ def create_public_folder(data)
63
+ @client.raw('post', '/config/public-folders', nil, data)
64
+ end
5
65
 
6
- # === Sync public folders for object.
7
- # Sync public folders for object.
8
- #
9
- # ==== Parameters
10
- # data:: (Hash) -- Data to be submitted.
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
- @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
- @client.raw('get', "/config/public-folders/get_public-folders_for_object", options)
36
- end
66
+ # === Update public folder.
67
+ # Update a public folder info.
68
+ #
69
+ # ==== Parameters
70
+ # id:: (Integer) -- Public folder id.
71
+ # data:: (Hash) -- Data to be submitted.
72
+ #
73
+ # ==== Example
74
+ # data = {
75
+ # title: 'New Public Folder Modified',
76
+ # slug: 'new-public-folder',
77
+ # object_type: 'contacts',
78
+ # visible: true
79
+ # }
80
+ # @data = @mints_user.update_public_folder(20, data.to_json)
81
+ def update_public_folder(id, data)
82
+ @client.raw('put', "/config/public-folders/#{id}", nil, data)
83
+ end
37
84
 
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(options = nil)
44
- @client.raw('get', "/config/public-folders", options)
45
- end
46
-
47
- # === Create public folder.
48
- # Create a public folder with data.
49
- #
50
- # ==== Parameters
51
- # data:: (Hash) -- Data to be submitted.
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
- @client.raw('post', "/config/public-folders", nil, data)
63
- end
85
+ # === Get public folder support data.
86
+ # Get support data used in a public folder.
87
+ #
88
+ # ==== Parameters
89
+ # id:: (Integer) -- Public folder id.
90
+ #
91
+ # ==== Example
92
+ # @data = @mints_user.get_public_folder_support_data(1)
93
+ def get_public_folder_support_data(id)
94
+ @client.raw('get', "/config/public-folders/support-data/#{id}")
95
+ end
64
96
 
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 submitted.
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
- @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
- @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
- @client.raw('get', "/config/public-folders/#{id}")
107
- end
108
- end
97
+ # === Get public folder.
98
+ # Get a public folder info.
99
+ #
100
+ # ==== Parameters
101
+ # id:: (Integer) -- Public folder id.
102
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
103
+ #
104
+ # ==== Example
105
+ # @data = @mints_user.get_public_folder(3)
106
+ def get_public_folder(id)
107
+ @client.raw('get', "/config/public-folders/#{id}")
108
+ end
109
+ end