mints 0.0.27 → 0.0.29
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 +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 +12 -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 +133 -0
- data/lib/contact.rb +57 -607
- data/lib/errors.rb +4 -2
- data/lib/generators/mints_assets_controller.rb +4 -1
- data/lib/generators/mints_config.yml.erb +0 -2
- data/lib/generators/mints_contact_controller.rb +4 -1
- data/lib/generators/mints_files_generator.rb +16 -13
- data/lib/generators/mints_link.rb +9 -6
- 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 +3 -1
- 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.rb +75 -93
- 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 +69 -68
- data/lib/user/config/users.rb +72 -71
- data/lib/user/contacts/contacts.rb +21 -20
- data/lib/user/content/assets.rb +275 -280
- data/lib/user/content/content.rb +236 -235
- data/lib/user/content/content_instances.rb +138 -138
- data/lib/user/content/content_templates.rb +105 -103
- data/lib/user/content/conversations.rb +195 -193
- data/lib/user/content/dam.rb +85 -80
- data/lib/user/content/forms.rb +231 -233
- data/lib/user/content/message_templates.rb +154 -151
- data/lib/user/content/messages.rb +89 -87
- data/lib/user/content/pages.rb +84 -82
- data/lib/user/content/stories.rb +101 -101
- data/lib/user/content/story_templates.rb +90 -88
- data/lib/user/content/story_versions.rb +117 -117
- data/lib/user/crm/companies.rb +106 -106
- data/lib/user/crm/contacts.rb +287 -292
- data/lib/user/crm/crm.rb +21 -19
- data/lib/user/crm/deals.rb +105 -103
- data/lib/user/crm/favorites.rb +16 -13
- data/lib/user/crm/segments.rb +123 -123
- data/lib/user/crm/users.rb +22 -20
- data/lib/user/crm/workflow_step_objects.rb +86 -84
- data/lib/user/crm/workflow_steps.rb +47 -45
- data/lib/user/crm/workflows.rb +67 -65
- data/lib/user/ecommerce/ecommerce.rb +29 -27
- data/lib/user/ecommerce/item_prices.rb +84 -81
- data/lib/user/ecommerce/locations.rb +162 -160
- data/lib/user/ecommerce/order_items_groups.rb +110 -106
- data/lib/user/ecommerce/order_statuses.rb +26 -24
- data/lib/user/ecommerce/orders.rb +253 -246
- data/lib/user/ecommerce/price_lists.rb +70 -68
- data/lib/user/ecommerce/product_templates.rb +101 -99
- data/lib/user/ecommerce/product_variations.rb +124 -120
- data/lib/user/ecommerce/products.rb +162 -159
- data/lib/user/ecommerce/skus.rb +87 -85
- data/lib/user/ecommerce/taxes.rb +81 -79
- data/lib/user/ecommerce/variant_options.rb +68 -66
- data/lib/user/ecommerce/variant_values.rb +71 -69
- data/lib/user/helpers/helpers.rb +104 -101
- data/lib/user/helpers/object_activities.rb +80 -78
- data/lib/user/helpers/object_folders.rb +78 -76
- data/lib/user/helpers/user_folders.rb +79 -77
- data/lib/user/marketing/marketing.rb +116 -113
- data/lib/user/profile/profile.rb +96 -103
- data/lib/user.rb +32 -41
- metadata +50 -43
- data/lib/user/config/importers.rb +0 -184
@@ -1,69 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module VariantOptions
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Variant Options
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get variant options.
|
9
|
+
# Get a collection of variant options.
|
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_variant_options
|
16
|
+
#
|
17
|
+
# ==== Second Example
|
18
|
+
# options = { fields: 'id, title' }
|
19
|
+
# @data = @mints_user.get_variant_options(options)
|
20
|
+
def get_variant_options(options = nil)
|
21
|
+
@client.raw('get', '/ecommerce/variant-options', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get variant option.
|
25
|
+
# Get a variant options info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Variant option 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_variant_option(1)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = { fields: 'id, title' }
|
36
|
+
# @data = @mints_user.get_variant_option(1, options)
|
37
|
+
def get_variant_option(id, options = nil)
|
38
|
+
@client.raw('get', "/ecommerce/variant-options/#{id}", options)
|
39
|
+
end
|
5
40
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
41
|
+
# === Create variant option.
|
42
|
+
# Create a variant option with data.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# data:: (Hash) -- Data to be submitted.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# title: 'New Variant Option'
|
50
|
+
# }
|
51
|
+
# @data = @mints_user.create_variant_option(data)
|
52
|
+
def create_variant_option(data)
|
53
|
+
@client.raw('post', '/ecommerce/variant-options', nil, data_transform(data))
|
54
|
+
end
|
21
55
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
# === Create variant option.
|
40
|
-
# Create a variant option with data.
|
41
|
-
#
|
42
|
-
# ==== Parameters
|
43
|
-
# data:: (Hash) -- Data to be submitted.
|
44
|
-
#
|
45
|
-
# ==== Example
|
46
|
-
# data = {
|
47
|
-
# "title": "New Variant Option"
|
48
|
-
# }
|
49
|
-
# @data = @mints_user.create_variant_option(data)
|
50
|
-
def create_variant_option(data)
|
51
|
-
@client.raw("post", "/ecommerce/variant-options", nil, data_transform(data))
|
52
|
-
end
|
53
|
-
|
54
|
-
# === Update variant option.
|
55
|
-
# Update a variant option info.
|
56
|
-
#
|
57
|
-
# ==== Parameters
|
58
|
-
# id:: (Integer) -- Variant option id.
|
59
|
-
# data:: (Hash) -- Data to be submitted.
|
60
|
-
#
|
61
|
-
# ==== Example
|
62
|
-
# data = {
|
63
|
-
# "title": "New Variant Option Modified"
|
64
|
-
# }
|
65
|
-
# @data = @mints_user.update_variant_option(6, data)
|
66
|
-
def update_variant_option(id, data)
|
67
|
-
@client.raw("put", "/ecommerce/variant-options/#{id}", nil, data_transform(data))
|
68
|
-
end
|
69
|
-
end
|
56
|
+
# === Update variant option.
|
57
|
+
# Update a variant option info.
|
58
|
+
#
|
59
|
+
# ==== Parameters
|
60
|
+
# id:: (Integer) -- Variant option id.
|
61
|
+
# data:: (Hash) -- Data to be submitted.
|
62
|
+
#
|
63
|
+
# ==== Example
|
64
|
+
# data = {
|
65
|
+
# title: 'New Variant Option Modified'
|
66
|
+
# }
|
67
|
+
# @data = @mints_user.update_variant_option(6, data)
|
68
|
+
def update_variant_option(id, data)
|
69
|
+
@client.raw('put', "/ecommerce/variant-options/#{id}", nil, data_transform(data))
|
70
|
+
end
|
71
|
+
end
|
@@ -1,72 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module VariantValues
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
4
|
+
##
|
5
|
+
# == Variant Values
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get variant values.
|
9
|
+
# Get a collection of variant values.
|
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_variant_values
|
16
|
+
#
|
17
|
+
# ==== Second Example
|
18
|
+
# options = { sort: '-id'}
|
19
|
+
# @data = @mints_user.get_variant_values(options)
|
20
|
+
def get_variant_values(options = nil)
|
21
|
+
@client.raw('get', '/ecommerce/variant-values', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get variant value.
|
25
|
+
# Get a variant value info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Variant value 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_variant_value(5)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = { fields: 'id'}
|
36
|
+
# @data = @mints_user.get_variant_value(5, options)
|
37
|
+
def get_variant_value(id, options = nil)
|
38
|
+
@client.raw('get', "/ecommerce/variant-values/#{id}", options)
|
39
|
+
end
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
41
|
+
# === Create variant value.
|
42
|
+
# Create a variant value with data.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# data:: (Hash) -- Data to be submitted.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# value: 'New Variant Value',
|
50
|
+
# variant_option_id: 1,
|
51
|
+
# display_order: 1,
|
52
|
+
# sku_code: 'new-variant-value-sku'
|
53
|
+
# }
|
54
|
+
# @data = @mints_user.create_variant_value(data)
|
55
|
+
def create_variant_value(data)
|
56
|
+
@client.raw('post', '/ecommerce/variant-values', nil, data_transform(data))
|
57
|
+
end
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
59
|
+
# === Update variant value.
|
60
|
+
# Update a variant value info.
|
61
|
+
#
|
62
|
+
# ==== Parameters
|
63
|
+
# id:: (Integer) -- Variant value id.
|
64
|
+
# data:: (Hash) -- Data to be submitted.
|
65
|
+
#
|
66
|
+
# ==== Example
|
67
|
+
# data = {
|
68
|
+
# value: 'New Variant Value Modified'
|
69
|
+
# }
|
70
|
+
# @data = @mints_user.update_variant_value(22, data)
|
71
|
+
def update_variant_value(id, data)
|
72
|
+
@client.raw('put', "/ecommerce/variant-values/#{id}", nil, data_transform(data))
|
73
|
+
end
|
74
|
+
end
|
data/lib/user/helpers/helpers.rb
CHANGED
@@ -1,113 +1,116 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require_relative './
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative './object_activities'
|
4
|
+
require_relative './object_folders'
|
5
|
+
require_relative './user_folders'
|
4
6
|
|
5
7
|
module Helpers
|
8
|
+
include ObjectActivities
|
9
|
+
include ObjectFolders
|
10
|
+
include UserFolders
|
11
|
+
|
12
|
+
##
|
13
|
+
# == Helpers
|
14
|
+
#
|
15
|
+
|
16
|
+
# === Slugify.
|
17
|
+
# Slugify a text using an object type.
|
18
|
+
#
|
19
|
+
# ==== Parameters
|
20
|
+
# data:: (Hash) -- Data to be submitted.
|
21
|
+
#
|
22
|
+
# ==== Example
|
23
|
+
#
|
24
|
+
def slugify(data)
|
25
|
+
# TODO: Research use of variable polymorphicObjectType
|
26
|
+
@client.raw('post', '/helpers/slugify', nil, data_transform(data))
|
27
|
+
end
|
6
28
|
|
7
|
-
|
8
|
-
|
9
|
-
|
29
|
+
# === Get available types from usage.
|
30
|
+
# Get available types by usage.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# usage:: () -- ...
|
34
|
+
#
|
35
|
+
def get_available_types_from_usage(usage)
|
36
|
+
# TODO: Research use
|
37
|
+
@client.raw('get', "/helpers/available-types/#{usage}")
|
38
|
+
end
|
10
39
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
# data:: (Hash) -- Data to be submitted.
|
20
|
-
#
|
21
|
-
# ==== Example
|
22
|
-
#
|
23
|
-
def slugify(data) #TODO: Research use of variable polymorphicObjectType
|
24
|
-
@client.raw("post", "/helpers/slugify", nil, data_transform(data))
|
25
|
-
end
|
26
|
-
|
27
|
-
# === Get available types from usage.
|
28
|
-
# Get available types by usage.
|
29
|
-
#
|
30
|
-
# ==== Parameters
|
31
|
-
# usage:: () -- ...
|
32
|
-
#
|
33
|
-
def get_available_types_from_usage(usage) #TODO: Research use
|
34
|
-
@client.raw("get", "/helpers/available-types/#{usage}")
|
35
|
-
end
|
40
|
+
# === Get magic link config.
|
41
|
+
# Get config used in magic links.
|
42
|
+
#
|
43
|
+
# ==== Example
|
44
|
+
# @data = @mints_user.get_magic_link_config
|
45
|
+
def get_magic_link_config
|
46
|
+
@client.raw('get', '/helpers/magic-link-config')
|
47
|
+
end
|
36
48
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# ==== Example
|
41
|
-
# @data = @mints_user.get_magic_link_config
|
42
|
-
def get_magic_link_config
|
43
|
-
@client.raw("get", "/helpers/magic-link-config")
|
44
|
-
end
|
49
|
+
##
|
50
|
+
# == Activities
|
51
|
+
#
|
45
52
|
|
46
|
-
|
47
|
-
|
48
|
-
|
53
|
+
# === Get activities by object type and id.
|
54
|
+
# Get activities using an object type and object type id.
|
55
|
+
#
|
56
|
+
# ==== Parameters
|
57
|
+
# object_type:: (String) -- Object type.
|
58
|
+
# id:: (Integer) -- Object type id.
|
59
|
+
#
|
60
|
+
# ==== Example
|
61
|
+
# @data = @mints_user.get_activities_by_object_type_and_id('contacts', 1)
|
62
|
+
def get_activities_by_object_type_and_id(object_type, id)
|
63
|
+
@client.raw('get', "/helpers/activities/#{object_type}/#{id}")
|
64
|
+
end
|
49
65
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
# ==== Parameters
|
54
|
-
# object_type:: (String) -- Object type.
|
55
|
-
# id:: (Integer) -- Object type id.
|
56
|
-
#
|
57
|
-
# ==== Example
|
58
|
-
# @data = @mints_user.get_activities_by_object_type_and_id("contacts", 1)
|
59
|
-
def get_activities_by_object_type_and_id(object_type, id)
|
60
|
-
@client.raw("get", "/helpers/activities/#{object_type}/#{id}")
|
61
|
-
end
|
66
|
+
##
|
67
|
+
# == Dice Coefficient
|
68
|
+
#
|
62
69
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
# @data = @mints_user.get_dice_coefficient(options)
|
80
|
-
def get_dice_coefficient(options)
|
81
|
-
@client.raw("get", "/helpers/dice-coefficient", options)
|
82
|
-
end
|
70
|
+
# === Get dice coefficient.
|
71
|
+
# Get dice coefficient.
|
72
|
+
#
|
73
|
+
# ==== Parameters
|
74
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
75
|
+
#
|
76
|
+
# ==== Example
|
77
|
+
# options = {
|
78
|
+
# table: 'contacts',
|
79
|
+
# field: 'id',
|
80
|
+
# word: '1'
|
81
|
+
# }
|
82
|
+
# @data = @mints_user.get_dice_coefficient(options)
|
83
|
+
def get_dice_coefficient(options)
|
84
|
+
@client.raw('get', '/helpers/dice-coefficient', options)
|
85
|
+
end
|
83
86
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
+
##
|
88
|
+
# == Permission
|
89
|
+
#
|
87
90
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
91
|
+
# === Get permission menu.
|
92
|
+
# Get permission menu.
|
93
|
+
#
|
94
|
+
# ==== Example
|
95
|
+
# @data = @mints_user.get_permission_menu
|
96
|
+
def get_permission_menu
|
97
|
+
@client.raw('get', '/helpers/menu')
|
98
|
+
end
|
96
99
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
+
##
|
101
|
+
# == Seed
|
102
|
+
#
|
100
103
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
104
|
+
# === Generate seed.
|
105
|
+
# Generate seed using object type and object type id.
|
106
|
+
#
|
107
|
+
# ==== Parameters
|
108
|
+
# objectType:: (String) -- Object type.
|
109
|
+
# id:: (Integer) -- Object type id.
|
110
|
+
#
|
111
|
+
# ==== Example
|
112
|
+
# @data = @mints_user.generate_seed('contacts', 1)
|
113
|
+
def generate_seed(object_type, id)
|
114
|
+
@client.raw('get', "/helpers/seeds/#{object_type}/#{id}")
|
115
|
+
end
|
116
|
+
end
|
@@ -1,83 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ObjectActivities
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Object Activities
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get object activities.
|
9
|
+
# Get a collection of object activities.
|
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_object_activities
|
16
|
+
#
|
17
|
+
# ==== Second Example
|
18
|
+
# options = { fields: 'object_type' }
|
19
|
+
# @data = @mints_user.get_object_activities(options)
|
20
|
+
def get_object_activities(options = nil)
|
21
|
+
@client.raw('get', '/helpers/object-activities', options)
|
22
|
+
end
|
5
23
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
# === Get object activity.
|
25
|
+
# Get an object activity.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Object activity 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_object_activity(1)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = { fields: 'activity_type' }
|
36
|
+
# @data = @mints_user.get_object_activity(1, options)
|
37
|
+
def get_object_activity(id, options = nil)
|
38
|
+
@client.raw('get', "/helpers/object-activities/#{id}", options)
|
39
|
+
end
|
21
40
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
41
|
+
# === Create object activity.
|
42
|
+
# Create an object activity with data.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# data:: (Hash) -- Data to be submitted.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# activity_type: 'note',
|
50
|
+
# object_type: 'contacts',
|
51
|
+
# object_id: 1
|
52
|
+
# }
|
53
|
+
# @data = @mints_user.create_object_activity(data)
|
54
|
+
def create_object_activity(data)
|
55
|
+
@client.raw('post', '/helpers/object-activities', nil, data_transform(data))
|
56
|
+
end
|
38
57
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
# === Update object activity.
|
57
|
-
# Update an object activity info.
|
58
|
-
#
|
59
|
-
# ==== Parameters
|
60
|
-
# id:: (Integer) -- Object activity id.
|
61
|
-
# data:: (Hash) -- Data to be submitted.
|
62
|
-
#
|
63
|
-
# ==== Example
|
64
|
-
# data = {
|
65
|
-
# "activity_type": "ticket"
|
66
|
-
# }
|
67
|
-
# @data = @mints_user.update_object_activity(573, data)
|
68
|
-
def update_object_activity(id, data)
|
69
|
-
@client.raw("put", "/helpers/object-activities/#{id}", nil, data_transform(data))
|
70
|
-
end
|
58
|
+
# === Update object activity.
|
59
|
+
# Update an object activity info.
|
60
|
+
#
|
61
|
+
# ==== Parameters
|
62
|
+
# id:: (Integer) -- Object activity id.
|
63
|
+
# data:: (Hash) -- Data to be submitted.
|
64
|
+
#
|
65
|
+
# ==== Example
|
66
|
+
# data = {
|
67
|
+
# activity_type: 'ticket'
|
68
|
+
# }
|
69
|
+
# @data = @mints_user.update_object_activity(573, data)
|
70
|
+
def update_object_activity(id, data)
|
71
|
+
@client.raw('put', "/helpers/object-activities/#{id}", nil, data_transform(data))
|
72
|
+
end
|
71
73
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
end
|
74
|
+
# === Delete object activity.
|
75
|
+
# Delete an object activity.
|
76
|
+
#
|
77
|
+
# ==== Parameters
|
78
|
+
# id:: (Integer) -- Object activity id.
|
79
|
+
#
|
80
|
+
# ==== Example
|
81
|
+
# @data = @mints_user.delete_object_activity(573)
|
82
|
+
def delete_object_activity(id)
|
83
|
+
@client.raw('delete', "/helpers/object-activities/#{id}")
|
84
|
+
end
|
85
|
+
end
|