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.
- 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
data/lib/user/config/tags.rb
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
##
|
|
3
|
-
# == Tags
|
|
4
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
module Tags
|
|
4
|
+
##
|
|
5
|
+
# == Tags
|
|
6
|
+
#
|
|
7
|
+
# === Get tags.
|
|
8
|
+
# Get a collection of tags.
|
|
9
|
+
#
|
|
10
|
+
# ==== Example
|
|
11
|
+
# @data = @mints_user.get_tags
|
|
12
|
+
def get_tags
|
|
13
|
+
@client.raw('get', '/config/tags')
|
|
14
|
+
end
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
# === Get tag.
|
|
17
|
+
# Get a tag info.
|
|
18
|
+
#
|
|
19
|
+
# ==== Parameters
|
|
20
|
+
# id:: (Integer) -- Tag id.
|
|
21
|
+
#
|
|
22
|
+
# ==== Example
|
|
23
|
+
# @data = @mints_user.get_tag(1)
|
|
24
|
+
def get_tag(id)
|
|
25
|
+
@client.raw('get', "/config/tags/#{id}")
|
|
26
|
+
end
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
# === Create tag.
|
|
29
|
+
# Create a tag with data.
|
|
30
|
+
#
|
|
31
|
+
# ==== Parameters
|
|
32
|
+
# data:: (Hash) -- Data to be submitted.
|
|
33
|
+
#
|
|
34
|
+
# ==== Example
|
|
35
|
+
# data = {
|
|
36
|
+
# tag: 'new-tag',
|
|
37
|
+
# is_visible: true
|
|
38
|
+
# }
|
|
39
|
+
# @data = @mints_user.create_tag(data)
|
|
40
|
+
def create_tag(data)
|
|
41
|
+
@client.raw('post', '/config/tags', nil, data_transform(data))
|
|
42
|
+
end
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@client.raw("put", "/config/tags/#{id}", nil, data)
|
|
62
|
-
end
|
|
63
|
-
end
|
|
44
|
+
# === Update tag.
|
|
45
|
+
# Update a tag info.
|
|
46
|
+
#
|
|
47
|
+
# ==== Parameters
|
|
48
|
+
# id:: (Integer) -- Tag id.
|
|
49
|
+
# data:: (Hash) -- Data to be submitted.
|
|
50
|
+
#
|
|
51
|
+
# ==== Example
|
|
52
|
+
# data = {
|
|
53
|
+
# tag: 'new-tag',
|
|
54
|
+
# slug: 'new-tag',
|
|
55
|
+
# is_visible: false
|
|
56
|
+
# }
|
|
57
|
+
# @data = @mints_user.update_tag(54, data)
|
|
58
|
+
def update_tag(id, data)
|
|
59
|
+
@client.raw('put', "/config/tags/#{id}", nil, data_transform(data))
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -1,124 +1,120 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Taxonomies
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
##
|
|
5
|
+
# == Taxonomies
|
|
6
|
+
#
|
|
7
|
+
# === Sync taxonomies for object.
|
|
8
|
+
# Sync taxonomies 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_taxonomies_for_object(data)
|
|
19
|
+
def sync_taxonomies_for_object(data)
|
|
20
|
+
@client.raw('put', '/config/taxonomies/sync_taxonomies_for_object', nil, data_transform(data))
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# === Get taxonomies for object.
|
|
24
|
+
# Get taxonomies 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_taxonomies_for_object(options)
|
|
35
|
+
def get_taxonomies_for_object(options)
|
|
36
|
+
@client.raw('get', '/config/taxonomies/get_taxonomies_for_object', options)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# === Get taxonomies support data.
|
|
40
|
+
# Get support data used in taxonomies.
|
|
41
|
+
#
|
|
42
|
+
# ==== Example
|
|
43
|
+
# @data = @mints_user.get_taxonomies_support_data
|
|
44
|
+
def get_taxonomies_support_data
|
|
45
|
+
@client.raw('get', '/config/taxonomies/support-data')
|
|
46
|
+
end
|
|
5
47
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
48
|
+
# === Get taxonomies.
|
|
49
|
+
# Get a collection of taxonomies.
|
|
50
|
+
#
|
|
51
|
+
# ==== Parameters
|
|
52
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
53
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
|
54
|
+
#
|
|
55
|
+
# ==== First Example
|
|
56
|
+
# @data = @mints_user.get_taxonomies
|
|
57
|
+
#
|
|
58
|
+
# ==== Second Example
|
|
59
|
+
# options = { fields: 'title' }
|
|
60
|
+
# @data = @mints_user.get_taxonomies(options)
|
|
61
|
+
#
|
|
62
|
+
# ==== Third Example
|
|
63
|
+
# options = { fields: 'title' }
|
|
64
|
+
# @data = @mints_user.get_taxonomies(options, false)
|
|
65
|
+
def get_taxonomies(options = nil, use_post = true)
|
|
66
|
+
get_query_results('/config/taxonomies', options, use_post)
|
|
67
|
+
end
|
|
21
68
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# === Get taxonomies support data.
|
|
39
|
-
# Get support data used in taxonomies.
|
|
40
|
-
#
|
|
41
|
-
# ==== Example
|
|
42
|
-
# @data = @mints_user.get_taxonomies_support_data
|
|
43
|
-
def get_taxonomies_support_data
|
|
44
|
-
@client.raw("get", "/config/taxonomies/support-data")
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
#FIXME: Method doesnt exist in TaxonomyController.getUISupportData
|
|
48
|
-
#def get_ui_taxonomy(id)
|
|
49
|
-
# @client.raw("get", "/config/taxonomies/ui-taxonomies/#{id}")
|
|
50
|
-
#end
|
|
51
|
-
|
|
52
|
-
# === Get taxonomies.
|
|
53
|
-
# Get a collection of taxonomies.
|
|
54
|
-
#
|
|
55
|
-
# ==== Parameters
|
|
56
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
57
|
-
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
|
58
|
-
#
|
|
59
|
-
# ==== First Example
|
|
60
|
-
# @data = @mints_user.get_taxonomies
|
|
61
|
-
#
|
|
62
|
-
# ==== Second Example
|
|
63
|
-
# options = { "fields": "title" }
|
|
64
|
-
# @data = @mints_user.get_taxonomies(options)
|
|
65
|
-
#
|
|
66
|
-
# ==== Third Example
|
|
67
|
-
# options = { "fields": "title" }
|
|
68
|
-
# @data = @mints_user.get_taxonomies(options, false)
|
|
69
|
-
def get_taxonomies(options = nil, use_post = true)
|
|
70
|
-
return get_query_results("/config/taxonomies", options, use_post)
|
|
71
|
-
end
|
|
69
|
+
# === Get taxonomy.
|
|
70
|
+
# Get a taxonomy info.
|
|
71
|
+
#
|
|
72
|
+
# ==== Parameters
|
|
73
|
+
# id:: (Integer) -- Taxonomy id.
|
|
74
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
75
|
+
#
|
|
76
|
+
# ==== First Example
|
|
77
|
+
# @data = @mints_user.get_taxonomy(1)
|
|
78
|
+
#
|
|
79
|
+
# ==== Second Example
|
|
80
|
+
# options = { fields: 'title' }
|
|
81
|
+
# @data = @mints_user.get_taxonomy(1, options)
|
|
82
|
+
def get_taxonomy(id, options = nil)
|
|
83
|
+
@client.raw('get', "/config/taxonomies/#{id}", options)
|
|
84
|
+
end
|
|
72
85
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
# === Create taxonomy.
|
|
87
|
+
# Create a taxonomy with data.
|
|
88
|
+
#
|
|
89
|
+
# ==== Parameters
|
|
90
|
+
# data:: (Hash) -- Data to be submitted.
|
|
91
|
+
#
|
|
92
|
+
# ==== Example
|
|
93
|
+
# data = {
|
|
94
|
+
# title: 'New Taxonomy',
|
|
95
|
+
# slug: 'new-taxonomy',
|
|
96
|
+
# object_type: 'contacts'
|
|
97
|
+
# }
|
|
98
|
+
# @data = @mints_user.create_taxonomy(data)
|
|
99
|
+
def create_taxonomy(data, options = nil)
|
|
100
|
+
@client.raw('post', '/config/taxonomies', options, data_transform(data))
|
|
101
|
+
end
|
|
89
102
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
# Update a taxonomy info.
|
|
109
|
-
#
|
|
110
|
-
# ==== Parameters
|
|
111
|
-
# id:: (Integer) -- Taxonomy id.
|
|
112
|
-
# data:: (Hash) -- Data to be submitted.
|
|
113
|
-
#
|
|
114
|
-
# ==== Example
|
|
115
|
-
# data = {
|
|
116
|
-
# "title": "New Taxomony Modified",
|
|
117
|
-
# "slug": "new-taxonomy",
|
|
118
|
-
# "object_type": "contacts"
|
|
119
|
-
# }
|
|
120
|
-
# @data = @mints_user.update_taxonomy(104, data)
|
|
121
|
-
def update_taxonomy(id, data, options = nil)
|
|
122
|
-
@client.raw("put", "/config/taxonomies/#{id}", options, data_transform(data))
|
|
123
|
-
end
|
|
124
|
-
end
|
|
103
|
+
# === Update taxonomy.
|
|
104
|
+
# Update a taxonomy info.
|
|
105
|
+
#
|
|
106
|
+
# ==== Parameters
|
|
107
|
+
# id:: (Integer) -- Taxonomy id.
|
|
108
|
+
# data:: (Hash) -- Data to be submitted.
|
|
109
|
+
#
|
|
110
|
+
# ==== Example
|
|
111
|
+
# data = {
|
|
112
|
+
# title: "New Taxonomy Modified",
|
|
113
|
+
# slug: "new-taxonomy",
|
|
114
|
+
# object_type: "contacts"
|
|
115
|
+
# }
|
|
116
|
+
# @data = @mints_user.update_taxonomy(104, data)
|
|
117
|
+
def update_taxonomy(id, data, options = nil)
|
|
118
|
+
@client.raw('put', "/config/taxonomies/#{id}", options, data_transform(data))
|
|
119
|
+
end
|
|
120
|
+
end
|
data/lib/user/config/teams.rb
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Teams
|
|
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
|
-
|
|
4
|
+
##
|
|
5
|
+
# == Teams
|
|
6
|
+
#
|
|
7
|
+
# === Get team types.
|
|
8
|
+
# Get a collection of team types.
|
|
9
|
+
#
|
|
10
|
+
# ==== Example
|
|
11
|
+
# @data = @mints_user.get_team_types
|
|
12
|
+
def get_team_types
|
|
13
|
+
@client.raw('get', '/config/teams/team-types')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# === Get teams.
|
|
17
|
+
# Get a collection of teams.
|
|
18
|
+
#
|
|
19
|
+
# ==== Example
|
|
20
|
+
# @data = @mints_user.get_teams
|
|
21
|
+
def get_teams
|
|
22
|
+
@client.raw('get', '/config/teams')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# === Get team.
|
|
26
|
+
# Get a team info.
|
|
27
|
+
#
|
|
28
|
+
# ==== Parameters
|
|
29
|
+
# id:: (Integer) -- Team id.
|
|
30
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
31
|
+
#
|
|
32
|
+
# ==== Example
|
|
33
|
+
# @data = @mints_user.get_team(1)
|
|
34
|
+
def get_team(id)
|
|
35
|
+
@client.raw('get', "/config/teams/#{id}")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# === Create team.
|
|
39
|
+
# Create a team with data.
|
|
40
|
+
#
|
|
41
|
+
# ==== Parameters
|
|
42
|
+
# data:: (Hash) -- Data to be submitted.
|
|
43
|
+
#
|
|
44
|
+
# ==== Example
|
|
45
|
+
# data = {
|
|
46
|
+
# title: 'New Team',
|
|
47
|
+
# team_type_enum: 1
|
|
48
|
+
# }
|
|
49
|
+
# @data = @mints_user.create_team(data)
|
|
50
|
+
def create_team(data)
|
|
51
|
+
@client.raw('post', '/config/teams', nil, data_transform(data))
|
|
52
|
+
end
|
|
36
53
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
#
|
|
56
|
-
# ==== Parameters
|
|
57
|
-
# id:: (Integer) -- Team id.
|
|
58
|
-
# data:: (Hash) -- Data to be submitted.
|
|
59
|
-
#
|
|
60
|
-
# ==== Example
|
|
61
|
-
# data = {
|
|
62
|
-
# "title": "New Team Modified",
|
|
63
|
-
# "team_type_enum": 1,
|
|
64
|
-
# "members": []
|
|
65
|
-
# }
|
|
66
|
-
# @data = @mints_user.update_team(5, data)
|
|
67
|
-
def update_team(id, data)
|
|
68
|
-
@client.raw("put", "/config/teams/#{id}", nil, data_transform(data))
|
|
69
|
-
end
|
|
70
|
-
end
|
|
54
|
+
# === Update team.
|
|
55
|
+
# Update a team info.
|
|
56
|
+
#
|
|
57
|
+
# ==== Parameters
|
|
58
|
+
# id:: (Integer) -- Team id.
|
|
59
|
+
# data:: (Hash) -- Data to be submitted.
|
|
60
|
+
#
|
|
61
|
+
# ==== Example
|
|
62
|
+
# data = {
|
|
63
|
+
# title: 'New Team Modified',
|
|
64
|
+
# team_type_enum: 1,
|
|
65
|
+
# members: []
|
|
66
|
+
# }
|
|
67
|
+
# @data = @mints_user.update_team(5, data)
|
|
68
|
+
def update_team(id, data)
|
|
69
|
+
@client.raw('put', "/config/teams/#{id}", nil, data_transform(data))
|
|
70
|
+
end
|
|
71
|
+
end
|
data/lib/user/config/users.rb
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Users
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
##
|
|
5
|
+
# == Users
|
|
6
|
+
#
|
|
7
|
+
##
|
|
8
|
+
# === Can Users Coach.
|
|
9
|
+
# Determine if users can coach.
|
|
10
|
+
#
|
|
11
|
+
# ==== Example
|
|
12
|
+
# @data = @mints_user.can_users_coach
|
|
13
|
+
def can_users_coach
|
|
14
|
+
@client.raw('get', '/config/users/can_coach')
|
|
15
|
+
end
|
|
5
16
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
end
|
|
17
|
+
# === Get users.
|
|
18
|
+
# Get a collection of users.
|
|
19
|
+
#
|
|
20
|
+
# ==== Example
|
|
21
|
+
# @data = @mints_user.get_users
|
|
22
|
+
def get_users(options)
|
|
23
|
+
@client.raw('get', '/config/users', options)
|
|
24
|
+
end
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
# === Get user.
|
|
27
|
+
# Get an user info.
|
|
28
|
+
#
|
|
29
|
+
# ==== Parameters
|
|
30
|
+
# id:: (Integer) -- User id.
|
|
31
|
+
#
|
|
32
|
+
# ==== Example
|
|
33
|
+
# @data = @mints_user.get_user(8)
|
|
34
|
+
def get_user(id)
|
|
35
|
+
@client.raw('get', "/config/users/#{id}")
|
|
36
|
+
end
|
|
24
37
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# data = {
|
|
45
|
-
# "name": "New User Name",
|
|
46
|
-
# "email": "new_user_email@example.com",
|
|
47
|
-
# "is_confirmed": false,
|
|
48
|
-
# "set_password": true,
|
|
49
|
-
# "password": "123456",
|
|
50
|
-
# "is_coach": false
|
|
51
|
-
# }
|
|
52
|
-
# @data = @mints_user.create_user(data)
|
|
53
|
-
def create_user(data)
|
|
54
|
-
@client.raw("post", "/config/users", nil, data_transform(data))
|
|
55
|
-
end
|
|
38
|
+
# === Create user.
|
|
39
|
+
# Create an user with data.
|
|
40
|
+
#
|
|
41
|
+
# ==== Parameters
|
|
42
|
+
# data:: (Hash) -- Data to be submitted.
|
|
43
|
+
#
|
|
44
|
+
# ==== Example
|
|
45
|
+
# data = {
|
|
46
|
+
# name: 'New User Name',
|
|
47
|
+
# email: 'new_user_email@example.com',
|
|
48
|
+
# is_confirmed: false,
|
|
49
|
+
# set_password: true,
|
|
50
|
+
# password: '123456',
|
|
51
|
+
# is_coach: false
|
|
52
|
+
# }
|
|
53
|
+
# @data = @mints_user.create_user(data)
|
|
54
|
+
def create_user(data)
|
|
55
|
+
@client.raw('post', '/config/users', nil, data_transform(data))
|
|
56
|
+
end
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
end
|
|
58
|
+
# === Update user.
|
|
59
|
+
# Update an user info.
|
|
60
|
+
#
|
|
61
|
+
# ==== Parameters
|
|
62
|
+
# id:: (Integer) -- User id.
|
|
63
|
+
# data:: (Hash) -- Data to be submitted.
|
|
64
|
+
#
|
|
65
|
+
# ==== Example
|
|
66
|
+
# data = {
|
|
67
|
+
# name: 'New User Name Modified',
|
|
68
|
+
# email: 'new_user_name@example.com',
|
|
69
|
+
# is_active: true,
|
|
70
|
+
# is_confirmed: false,
|
|
71
|
+
# roles: ''
|
|
72
|
+
# }
|
|
73
|
+
# @data = @mints_user.update_user(14, data)
|
|
74
|
+
def update_user(id, data)
|
|
75
|
+
@client.raw('put', "/config/users/#{id}", nil, data_transform(data))
|
|
76
|
+
end
|
|
77
|
+
end
|