mints 0.0.27 → 0.0.29

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