mints 0.0.28 → 0.0.30
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.
- checksums.yaml +4 -4
- data/lib/client.rb +287 -385
- data/lib/contact/config/appointments.rb +201 -0
- data/lib/contact/config/config.rb +7 -0
- data/lib/contact/content/content.rb +7 -0
- data/lib/contact/content/conversations.rb +121 -0
- data/lib/contact/ecommerce/ecommerce.rb +14 -0
- data/lib/contact/ecommerce/order_items.rb +19 -0
- data/lib/contact/ecommerce/order_items_groups.rb +95 -0
- data/lib/contact/ecommerce/orders.rb +132 -0
- data/lib/contact/ecommerce/vouchers.rb +18 -0
- data/lib/contact.rb +54 -603
- data/lib/errors.rb +4 -2
- data/lib/generators/mints_assets_controller.rb +4 -1
- data/lib/generators/mints_contact_controller.rb +4 -1
- data/lib/generators/mints_files_generator.rb +16 -13
- data/lib/generators/mints_link.rb +7 -4
- data/lib/generators/mints_public_controller.rb +4 -1
- data/lib/generators/mints_user_controller.rb +3 -0
- data/lib/generators/short_link_controller.rb +4 -1
- data/lib/mints/controllers/admin_base_controller.rb +5 -3
- data/lib/mints/controllers/base_api_controller.rb +6 -4
- data/lib/mints/controllers/base_controller.rb +5 -3
- data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
- data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
- data/lib/mints/controllers/contact_api_controller.rb +12 -10
- data/lib/mints/controllers/public_api_controller.rb +10 -8
- data/lib/mints/controllers/user_api_controller.rb +11 -9
- data/lib/mints/helpers/contact_auth_helper.rb +5 -3
- data/lib/mints/helpers/mints_helper.rb +39 -38
- data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
- data/lib/mints/helpers/user_auth_helper.rb +5 -3
- data/lib/mints.rb +12 -10
- data/lib/pub/config/attributes.rb +13 -0
- data/lib/pub/config/config.rb +15 -0
- data/lib/pub/config/public_folders.rb +51 -0
- data/lib/pub/config/tags.rb +42 -0
- data/lib/pub/config/taxonomies.rb +49 -0
- data/lib/pub/content/assets.rb +16 -0
- data/lib/pub/content/content.rb +22 -0
- data/lib/pub/content/content_bundles.rb +40 -0
- data/lib/pub/content/content_instance_versions.rb +56 -0
- data/lib/pub/content/content_instances.rb +37 -0
- data/lib/pub/content/forms.rb +47 -0
- data/lib/pub/content/stories.rb +44 -0
- data/lib/pub/content/story_versions.rb +46 -0
- data/lib/pub/ecommerce/ecommerce.rb +14 -0
- data/lib/pub/ecommerce/locations.rb +25 -0
- data/lib/pub/ecommerce/orders.rb +31 -0
- data/lib/pub/ecommerce/products.rb +45 -0
- data/lib/pub.rb +22 -461
- data/lib/user/config/api_keys.rb +63 -61
- data/lib/user/config/appointments.rb +217 -215
- data/lib/user/config/attribute_groups.rb +74 -72
- data/lib/user/config/attributes.rb +83 -81
- data/lib/user/config/calendars.rb +88 -86
- data/lib/user/config/config.rb +31 -63
- data/lib/user/config/public_folders.rb +105 -104
- data/lib/user/config/relationships.rb +135 -132
- data/lib/user/config/roles.rb +76 -79
- data/lib/user/config/seeds.rb +52 -51
- data/lib/user/config/system_settings.rb +50 -49
- data/lib/user/config/tags.rb +57 -59
- data/lib/user/config/taxonomies.rb +115 -119
- data/lib/user/config/teams.rb +2 -0
- data/lib/user/config/users.rb +2 -0
- data/lib/user/contacts/contacts.rb +2 -0
- data/lib/user/content/assets.rb +3 -3
- data/lib/user/content/content.rb +224 -223
- data/lib/user/content/content_instances.rb +4 -2
- data/lib/user/content/content_templates.rb +2 -0
- data/lib/user/content/conversations.rb +2 -0
- data/lib/user/content/dam.rb +2 -0
- data/lib/user/content/forms.rb +2 -0
- data/lib/user/content/message_templates.rb +2 -0
- data/lib/user/content/messages.rb +2 -0
- data/lib/user/content/pages.rb +4 -2
- data/lib/user/content/stories.rb +3 -3
- data/lib/user/content/story_templates.rb +5 -3
- data/lib/user/content/story_versions.rb +2 -0
- data/lib/user/crm/companies.rb +3 -1
- data/lib/user/crm/contacts.rb +2 -0
- data/lib/user/crm/crm.rb +2 -0
- data/lib/user/crm/deals.rb +2 -0
- data/lib/user/crm/favorites.rb +2 -0
- data/lib/user/crm/segments.rb +2 -0
- data/lib/user/crm/users.rb +2 -0
- data/lib/user/crm/workflow_step_objects.rb +2 -0
- data/lib/user/crm/workflow_steps.rb +2 -0
- data/lib/user/crm/workflows.rb +2 -0
- data/lib/user/ecommerce/ecommerce.rb +4 -0
- data/lib/user/ecommerce/item_prices.rb +2 -0
- data/lib/user/ecommerce/locations.rb +4 -2
- data/lib/user/ecommerce/order_items_groups.rb +5 -2
- data/lib/user/ecommerce/order_statuses.rb +2 -0
- data/lib/user/ecommerce/orders.rb +4 -1
- data/lib/user/ecommerce/price_lists.rb +2 -0
- data/lib/user/ecommerce/product_templates.rb +3 -1
- data/lib/user/ecommerce/product_variations.rb +2 -0
- data/lib/user/ecommerce/products.rb +3 -1
- data/lib/user/ecommerce/skus.rb +2 -0
- data/lib/user/ecommerce/taxes.rb +2 -0
- data/lib/user/ecommerce/variant_options.rb +2 -0
- data/lib/user/ecommerce/variant_values.rb +2 -0
- data/lib/user/ecommerce/vouchers.rb +90 -0
- data/lib/user/helpers/helpers.rb +2 -0
- data/lib/user/helpers/object_activities.rb +2 -0
- data/lib/user/helpers/object_folders.rb +2 -0
- data/lib/user/helpers/user_folders.rb +2 -0
- data/lib/user/marketing/marketing.rb +2 -0
- data/lib/user/profile/profile.rb +2 -0
- data/lib/user.rb +32 -41
- metadata +42 -16
- data/lib/user/config/importers.rb +0 -184
|
@@ -1,86 +1,88 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Attributes
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
data/lib/user/config/config.rb
CHANGED
|
@@ -1,65 +1,33 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|