moesif_api 1.2.10 → 1.2.14
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/LICENSE +1 -1
- data/README.md +157 -42
- data/lib/moesif_api/configuration.rb +1 -1
- data/lib/moesif_api/controllers/api_controller.rb +51 -85
- data/lib/moesif_api/models/base_model.rb +10 -4
- data/lib/moesif_api/models/event_model.rb +11 -2
- metadata +24 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4c04a384626a3dc2b02d2e7f0ab9737dc50d78cb2f564f57b6a9ca4f478a516
|
4
|
+
data.tar.gz: cbe67532493cade527fcbc0909d54d53e29e738b9f7419c9c4e9f0b864b4b99d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bbe517499c6d03fe02dfbd00b802ad52ef312fb1f50e6673c37067c0faf241afbe439235433904153cc0a0647bb126d14731cdec97b7be85b1b6a4f9f2b9ae0
|
7
|
+
data.tar.gz: 8e6ec1b3f88515a00b3a1cc873271fa3da87b55feb4b834a5fa1a1a1d4687d89bb13621f6160def2fb157b502469817ab6d38026db1e5e05dd8072697413c5a6
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -114,62 +114,177 @@ event_model.metadata = metadata
|
|
114
114
|
response = api_controller.create_event(event_model)
|
115
115
|
```
|
116
116
|
|
117
|
-
|
117
|
+
## Update a Single User
|
118
118
|
|
119
|
-
|
119
|
+
Create or update a user profile in Moesif.
|
120
|
+
The metadata field can be any customer demographic or other info you want to store.
|
121
|
+
Only the `userId` field is required.
|
122
|
+
For details, visit the [Ruby API Reference](https://www.moesif.com/docs/api?ruby#update-a-user).
|
120
123
|
|
121
124
|
```ruby
|
122
|
-
api_client = MoesifApi::MoesifAPIClient.new(
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
125
|
+
api_client = MoesifApi::MoesifAPIClient.new('YOUR_COLLECTOR_APPLICATION_ID').api
|
126
|
+
|
127
|
+
metadata = {
|
128
|
+
:email => 'john@acmeinc.com',
|
129
|
+
:first_name => 'John',
|
130
|
+
:last_name => 'Doe',
|
131
|
+
:title => 'Software Engineer',
|
132
|
+
:salesInfo => {
|
133
|
+
:stage => 'Customer',
|
134
|
+
:lifetime_value => 24000,
|
135
|
+
:accountOwner => 'mary@contoso.com',
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
# Campaign object is optional, but useful if you want to track ROI of acquisition channels
|
140
|
+
# See https://www.moesif.com/docs/api#users for campaign schema
|
141
|
+
campaign = MoesifApi::CampaignModel.new()
|
142
|
+
campaign.utm_source = "google"
|
143
|
+
campaign.utm_medium = "cpc"
|
144
|
+
campaign.utm_campaign = "adwords"
|
145
|
+
campaign.utm_term = "api+tooling"
|
146
|
+
campaign.utm_content = "landing"
|
147
|
+
|
148
|
+
# Only user_id is required.
|
149
|
+
# metadata can be any custom object
|
150
|
+
user = MoesifApi::UserModel.new()
|
151
|
+
user.user_id = "12345"
|
152
|
+
user.company_id = "67890" # If set, associate user with a company object
|
153
|
+
user.campaign = campaign
|
154
|
+
user.metadata = metadata
|
155
|
+
|
156
|
+
update_user = api_client.update_user(user)
|
157
|
+
```
|
134
158
|
|
135
|
-
|
136
|
-
user_model.modified_time = Time.now.utc.iso8601 # option, default now.
|
137
|
-
user_model.user_id = "12345" #only required field.
|
138
|
-
user_model.company_id = "67890"
|
139
|
-
user_model.metadata = metadata
|
140
|
-
user_model.campaign = campaign_model
|
159
|
+
## Update Users in Batch
|
141
160
|
|
142
|
-
|
143
|
-
|
161
|
+
Similar to UpdateUser, but used to update a list of users in one batch.
|
162
|
+
Only the `userId` field is required.
|
163
|
+
For details, visit the [Ruby API Reference](https://www.moesif.com/docs/api?ruby#update-users-in-batch).
|
144
164
|
|
165
|
+
```ruby
|
166
|
+
api_client = MoesifApi::MoesifAPIClient.new('YOUR_COLLECTOR_APPLICATION_ID').api
|
167
|
+
|
168
|
+
users = []
|
169
|
+
|
170
|
+
metadata = {
|
171
|
+
:email => 'john@acmeinc.com',
|
172
|
+
:first_name => 'John',
|
173
|
+
:last_name => 'Doe',
|
174
|
+
:title => 'Software Engineer',
|
175
|
+
:salesInfo => {
|
176
|
+
:stage => 'Customer',
|
177
|
+
:lifetime_value => 24000,
|
178
|
+
:accountOwner => 'mary@contoso.com',
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
# Campaign object is optional, but useful if you want to track ROI of acquisition channels
|
183
|
+
# See https://www.moesif.com/docs/api#users for campaign schema
|
184
|
+
campaign = MoesifApi::CampaignModel.new()
|
185
|
+
campaign.utm_source = "google"
|
186
|
+
campaign.utm_medium = "cpc"
|
187
|
+
campaign.utm_campaign = "adwords"
|
188
|
+
campaign.utm_term = "api+tooling"
|
189
|
+
campaign.utm_content = "landing"
|
190
|
+
|
191
|
+
# Only user_id is required.
|
192
|
+
# metadata can be any custom object
|
193
|
+
user = MoesifApi::UserModel.new()
|
194
|
+
user.user_id = "12345"
|
195
|
+
user.company_id = "67890" # If set, associate user with a company object
|
196
|
+
user.campaign = campaign
|
197
|
+
user.metadata = metadata
|
198
|
+
|
199
|
+
users << user
|
200
|
+
|
201
|
+
api_client = api_controller.update_users_batch(user_model)
|
145
202
|
```
|
146
203
|
|
147
|
-
|
204
|
+
## Update a Single Company
|
148
205
|
|
149
|
-
|
206
|
+
Create or update a company profile in Moesif.
|
207
|
+
The metadata field can be any company demographic or other info you want to store.
|
208
|
+
Only the `companyId` field is required.
|
209
|
+
For details, visit the [Ruby API Reference](https://www.moesif.com/docs/api?ruby#update-a-company).
|
150
210
|
|
151
211
|
```ruby
|
152
|
-
api_client = MoesifApi::MoesifAPIClient.new(
|
153
|
-
|
212
|
+
api_client = MoesifApi::MoesifAPIClient.new('YOUR_COLLECTOR_APPLICATION_ID').api
|
213
|
+
|
214
|
+
metadata = {
|
215
|
+
:org_name => 'Acme, Inc',
|
216
|
+
:plan_name => 'Free',
|
217
|
+
:deal_stage => 'Lead',
|
218
|
+
:mrr => 24000,
|
219
|
+
:demographics => {
|
220
|
+
:alexa_ranking => 500000,
|
221
|
+
:employee_count => 47
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
# Campaign object is optional, but useful if you want to track ROI of acquisition channels
|
226
|
+
# See https://www.moesif.com/docs/api#update-a-company for campaign schema
|
227
|
+
campaign = MoesifApi::CampaignModel.new()
|
228
|
+
campaign.utm_source = "google"
|
229
|
+
campaign.utm_medium = "cpc"
|
230
|
+
campaign.utm_campaign = "adwords"
|
231
|
+
campaign.utm_term = "api+tooling"
|
232
|
+
campaign.utm_content = "landing"
|
233
|
+
|
234
|
+
# Only company_id is required.
|
235
|
+
# metadata can be any custom object
|
236
|
+
company = MoesifApi::CompanyModel.new()
|
237
|
+
company.company_id = "67890"
|
238
|
+
company.company_domain = "acmeinc.com" # If domain is set, Moesif will enrich your profiles with publicly available info
|
239
|
+
company.campaign = campaign
|
240
|
+
company.metadata = metadata
|
241
|
+
|
242
|
+
update_company = api_client.update_company(company)
|
243
|
+
```
|
154
244
|
|
155
|
-
metadata = JSON.parse('{'\
|
156
|
-
'"email": "testrubyapi@user.com",'\
|
157
|
-
'"name": "ruby api user",'\
|
158
|
-
'"location": "United States"'\
|
159
|
-
'}')
|
160
245
|
|
161
|
-
|
162
|
-
campaign_model.utm_source = "Adwords"
|
163
|
-
campaign_model.utm_medium = "Twitter"
|
246
|
+
## Update Companies in Batch
|
164
247
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
company_model.metadata = metadata
|
169
|
-
company_model.campaign = campaign_model
|
248
|
+
Similar to updateCompany, but used to update a list of companies in one batch.
|
249
|
+
Only the `companyId` field is required.
|
250
|
+
For details, visit the [Ruby API Reference](https://www.moesif.com/docs/api?ruby#update-companies-in-batch).
|
170
251
|
|
171
|
-
|
172
|
-
|
252
|
+
```ruby
|
253
|
+
api_client = MoesifApi::MoesifAPIClient.new('YOUR_COLLECTOR_APPLICATION_ID').api
|
254
|
+
|
255
|
+
companies = []
|
256
|
+
|
257
|
+
metadata = {
|
258
|
+
:org_name => 'Acme, Inc',
|
259
|
+
:plan_name => 'Free',
|
260
|
+
:deal_stage => 'Lead',
|
261
|
+
:mrr => 24000,
|
262
|
+
:demographics => {
|
263
|
+
:alexa_ranking => 500000,
|
264
|
+
:employee_count => 47
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
# Campaign object is optional, but useful if you want to track ROI of acquisition channels
|
269
|
+
# See https://www.moesif.com/docs/api#update-a-company for campaign schema
|
270
|
+
campaign = MoesifApi::CampaignModel.new()
|
271
|
+
campaign.utm_source = "google"
|
272
|
+
campaign.utm_medium = "cpc"
|
273
|
+
campaign.utm_campaign = "adwords"
|
274
|
+
campaign.utm_term = "api+tooling"
|
275
|
+
campaign.utm_content = "landing"
|
276
|
+
|
277
|
+
# Only company_id is required.
|
278
|
+
# metadata can be any custom object
|
279
|
+
company = MoesifApi::CompanyModel.new()
|
280
|
+
company.company_id = "67890"
|
281
|
+
company.company_domain = "acmeinc.com" # If domain is set, Moesif will enrich your profiles with publicly available info
|
282
|
+
company.campaign = campaign
|
283
|
+
company.metadata = metadata
|
284
|
+
|
285
|
+
companies << company
|
286
|
+
|
287
|
+
update_company = api_client.update_companies(companies)
|
173
288
|
```
|
174
289
|
|
175
290
|
## How to build and install manually:
|
@@ -196,7 +311,7 @@ Note: You will need to have internet access for this step.
|
|
196
311
|
You can test the generated SDK and the server with automatically generated test
|
197
312
|
cases as follows:
|
198
313
|
|
199
|
-
1. Add your Moesif application id to 'test/controllers/controller_test_base'. You can find your Application Id from [_Moesif Dashboard_](https://www.moesif.com/) ->
|
314
|
+
1. Add your Moesif application id to 'test/controllers/controller_test_base'. You can find your Application Id from [_Moesif Dashboard_](https://www.moesif.com/) -> _Bottom Left Menu_ -> _Installation_
|
200
315
|
2. From terminal/cmd navigate to the root directory of the SDK.
|
201
316
|
3. Invoke: `bundle exec rake`
|
202
317
|
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
require 'zlib'
|
2
|
+
require 'net/http'
|
2
3
|
|
3
4
|
module MoesifApi
|
4
5
|
class ApiController < BaseController
|
@@ -8,6 +9,43 @@ module MoesifApi
|
|
8
9
|
@@instance
|
9
10
|
end
|
10
11
|
|
12
|
+
# API Call to send data to Moesif
|
13
|
+
# @param [EventModel] body Required [Hash] headers Required [String] url Required
|
14
|
+
# @return response and context from the API call
|
15
|
+
def send_moesif(url, headers, body)
|
16
|
+
begin
|
17
|
+
# Gzip the body
|
18
|
+
gzip = Zlib::GzipWriter.new(StringIO.new)
|
19
|
+
gzip << body.to_json
|
20
|
+
gzip_body = gzip.close.string
|
21
|
+
|
22
|
+
# Add Content-Encoding header
|
23
|
+
headers['Content-Encoding'] = 'gzip'
|
24
|
+
# Gzip payload
|
25
|
+
_request_body = gzip_body
|
26
|
+
rescue => e
|
27
|
+
# Json payload
|
28
|
+
_request_body = body.to_json
|
29
|
+
end
|
30
|
+
|
31
|
+
# Create the HttpRequest object for the call
|
32
|
+
_request = @http_client.post url, headers: headers, parameters: _request_body
|
33
|
+
|
34
|
+
# Call the on_before_request callback
|
35
|
+
@http_call_back.on_before_request(_request) if @http_call_back
|
36
|
+
|
37
|
+
# Invoke the API call and get the response
|
38
|
+
_response = @http_client.execute_as_string(_request)
|
39
|
+
|
40
|
+
# Wrap the request and response in an HttpContext object
|
41
|
+
_context = HttpContext.new(_request, _response)
|
42
|
+
|
43
|
+
# Call the on_after_response callback
|
44
|
+
@http_call_back.on_after_response(_context) if @http_call_back
|
45
|
+
|
46
|
+
return _response, _context
|
47
|
+
end
|
48
|
+
|
11
49
|
# Add Single API Event Call
|
12
50
|
# @param [EventModel] body Required parameter: Example:
|
13
51
|
# @return void response from the API call
|
@@ -28,20 +66,8 @@ module MoesifApi
|
|
28
66
|
'User-Agent' => 'moesifapi-ruby/' + Configuration.version
|
29
67
|
}
|
30
68
|
|
31
|
-
# Create the HttpRequest object for the call
|
32
|
-
|
33
|
-
|
34
|
-
# Call the on_before_request callback
|
35
|
-
@http_call_back.on_before_request(_request) if @http_call_back
|
36
|
-
|
37
|
-
# Invoke the API call and get the response
|
38
|
-
_response = @http_client.execute_as_string(_request)
|
39
|
-
|
40
|
-
# Wrap the request and response in an HttpContext object
|
41
|
-
_context = HttpContext.new(_request, _response)
|
42
|
-
|
43
|
-
# Call the on_after_response callback
|
44
|
-
@http_call_back.on_after_response(_context) if @http_call_back
|
69
|
+
# Create the HttpRequest object for the call, fetch and wrap the respone in a HttpContext object
|
70
|
+
_response, _context = send_moesif(_query_url, _headers, body)
|
45
71
|
|
46
72
|
# Global error handling using HTTP status codes.
|
47
73
|
validate_response(_context)
|
@@ -70,20 +96,8 @@ module MoesifApi
|
|
70
96
|
'User-Agent' => 'moesifapi-ruby/' + Configuration.version
|
71
97
|
}
|
72
98
|
|
73
|
-
# Create the HttpRequest object for the call
|
74
|
-
|
75
|
-
|
76
|
-
# Call the on_before_request callback
|
77
|
-
@http_call_back.on_before_request(_request) if @http_call_back
|
78
|
-
|
79
|
-
# Invoke the API call and get the response
|
80
|
-
_response = @http_client.execute_as_string(_request)
|
81
|
-
|
82
|
-
# Wrap the request and response in an HttpContext object
|
83
|
-
_context = HttpContext.new(_request, _response)
|
84
|
-
|
85
|
-
# Call the on_after_response callback
|
86
|
-
@http_call_back.on_after_response(_context) if @http_call_back
|
99
|
+
# Create the HttpRequest object for the call, fetch and wrap the respone in a HttpContext object
|
100
|
+
_response, _context = send_moesif(_query_url, _headers, body)
|
87
101
|
|
88
102
|
# Global error handling using HTTP status codes.
|
89
103
|
validate_response(_context)
|
@@ -112,20 +126,8 @@ module MoesifApi
|
|
112
126
|
'User-Agent' => 'moesifapi-ruby/' + Configuration.version
|
113
127
|
}
|
114
128
|
|
115
|
-
# Create the HttpRequest object for the call
|
116
|
-
|
117
|
-
|
118
|
-
# Call the on_before_request callback
|
119
|
-
@http_call_back.on_before_request(_request) if @http_call_back
|
120
|
-
|
121
|
-
# Invoke the API call and get the response
|
122
|
-
_response = @http_client.execute_as_string(_request)
|
123
|
-
|
124
|
-
# Wrap the request and response in an HttpContext object
|
125
|
-
_context = HttpContext.new(_request, _response)
|
126
|
-
|
127
|
-
# Call the on_after_response callback
|
128
|
-
@http_call_back.on_after_response(_context) if @http_call_back
|
129
|
+
# Create the HttpRequest object for the call, fetch and wrap the respone in a HttpContext object
|
130
|
+
_response, _context = send_moesif(_query_url, _headers, body)
|
129
131
|
|
130
132
|
# Global error handling using HTTP status codes.
|
131
133
|
validate_response(_context)
|
@@ -152,20 +154,8 @@ module MoesifApi
|
|
152
154
|
'User-Agent' => 'moesifapi-ruby/' + Configuration.version
|
153
155
|
}
|
154
156
|
|
155
|
-
# Create the HttpRequest object for the call
|
156
|
-
|
157
|
-
|
158
|
-
# Call the on_before_request callback
|
159
|
-
@http_call_back.on_before_request(_request) if @http_call_back
|
160
|
-
|
161
|
-
# Invoke the API call and get the response
|
162
|
-
_response = @http_client.execute_as_string(_request)
|
163
|
-
|
164
|
-
# Wrap the request and response in an HttpContext object
|
165
|
-
_context = HttpContext.new(_request, _response)
|
166
|
-
|
167
|
-
# Call the on_after_response callback
|
168
|
-
@http_call_back.on_after_response(_context) if @http_call_back
|
157
|
+
# Create the HttpRequest object for the call, fetch and wrap the respone in a HttpContext object
|
158
|
+
_response, _context = send_moesif(_query_url, _headers, body)
|
169
159
|
|
170
160
|
# Global error handling using HTTP status codes.
|
171
161
|
validate_response(_context)
|
@@ -232,20 +222,8 @@ module MoesifApi
|
|
232
222
|
'User-Agent' => 'moesifapi-ruby/' + Configuration.version
|
233
223
|
}
|
234
224
|
|
235
|
-
# Create the HttpRequest object for the call
|
236
|
-
|
237
|
-
|
238
|
-
# Call the on_before_request callback
|
239
|
-
@http_call_back.on_before_request(_request) if @http_call_back
|
240
|
-
|
241
|
-
# Invoke the API call and get the response
|
242
|
-
_response = @http_client.execute_as_string(_request)
|
243
|
-
|
244
|
-
# Wrap the request and response in an HttpContext object
|
245
|
-
_context = HttpContext.new(_request, _response)
|
246
|
-
|
247
|
-
# Call the on_after_response callback
|
248
|
-
@http_call_back.on_after_response(_context) if @http_call_back
|
225
|
+
# Create the HttpRequest object for the call, fetch and wrap the respone in a HttpContext object
|
226
|
+
_response, _context = send_moesif(_query_url, _headers, body)
|
249
227
|
|
250
228
|
# Global error handling using HTTP status codes.
|
251
229
|
validate_response(_context)
|
@@ -271,20 +249,8 @@ module MoesifApi
|
|
271
249
|
'User-Agent' => 'moesifapi-ruby/' + Configuration.version
|
272
250
|
}
|
273
251
|
|
274
|
-
# Create the HttpRequest object for the call
|
275
|
-
|
276
|
-
|
277
|
-
# Call the on_before_request callback
|
278
|
-
@http_call_back.on_before_request(_request) if @http_call_back
|
279
|
-
|
280
|
-
# Invoke the API call and get the response
|
281
|
-
_response = @http_client.execute_as_string(_request)
|
282
|
-
|
283
|
-
# Wrap the request and response in an HttpContext object
|
284
|
-
_context = HttpContext.new(_request, _response)
|
285
|
-
|
286
|
-
# Call the on_after_response callback
|
287
|
-
@http_call_back.on_after_response(_context) if @http_call_back
|
252
|
+
# Create the HttpRequest object for the call, fetch and wrap the respone in a HttpContext object
|
253
|
+
_response, _context = send_moesif(_query_url, _headers, body)
|
288
254
|
|
289
255
|
# Global error handling using HTTP status codes.
|
290
256
|
validate_response(_context)
|
@@ -8,21 +8,27 @@ module MoesifApi
|
|
8
8
|
self.instance_variables.each do |name|
|
9
9
|
value = self.instance_variable_get(name)
|
10
10
|
name = name[1..-1]
|
11
|
-
key = self.class.names.key?(name) ? self.class.names[name] : name
|
11
|
+
key = clean_str(self.class.names.key?(name) ? self.class.names[name] : name)
|
12
12
|
if value.instance_of? Array
|
13
|
-
hash[key] = value.map{|v|
|
13
|
+
hash[key] = value.map{|v|
|
14
|
+
v.kind_of?(BaseModel) ? v.to_hash : clean_str(v)
|
15
|
+
}
|
14
16
|
elsif value.instance_of? Hash
|
15
17
|
hash[key] = {}
|
16
18
|
value.each do |k, v|
|
17
|
-
hash[key][k] = v.kind_of?(BaseModel) ? v.to_hash : v
|
19
|
+
hash[key][k] = v.kind_of?(BaseModel) ? v.to_hash : clean_str(v)
|
18
20
|
end
|
19
21
|
else
|
20
|
-
hash[key] = value.kind_of?(BaseModel) ? value.to_hash : value
|
22
|
+
hash[key] = value.kind_of?(BaseModel) ? value.to_hash : clean_str(value)
|
21
23
|
end
|
22
24
|
end
|
23
25
|
hash
|
24
26
|
end
|
25
27
|
|
28
|
+
def clean_str(x)
|
29
|
+
x.is_a?(String) ? x.encode(Encoding::UTF_8, Encoding::UTF_8, :invalid => :replace): x
|
30
|
+
end
|
31
|
+
|
26
32
|
# Returns a JSON representation of the curent object
|
27
33
|
def to_json(options = {})
|
28
34
|
hash = to_hash
|
@@ -34,6 +34,10 @@ module MoesifApi
|
|
34
34
|
# @return [String]
|
35
35
|
attr_accessor :direction
|
36
36
|
|
37
|
+
# Weight of an API call
|
38
|
+
# @return [Integer]
|
39
|
+
attr_accessor :weight
|
40
|
+
|
37
41
|
# A mapping from model property names to API property names
|
38
42
|
def self.names
|
39
43
|
if @hash.nil?
|
@@ -46,6 +50,7 @@ module MoesifApi
|
|
46
50
|
@hash["company_id"] = "company_id"
|
47
51
|
@hash["metadata"] = "metadata"
|
48
52
|
@hash["direction"] = "direction"
|
53
|
+
@hash["weight"] = "weight"
|
49
54
|
end
|
50
55
|
@hash
|
51
56
|
end
|
@@ -57,7 +62,8 @@ module MoesifApi
|
|
57
62
|
user_id = nil,
|
58
63
|
company_id = nil,
|
59
64
|
metadata = nil,
|
60
|
-
direction = nil
|
65
|
+
direction = nil,
|
66
|
+
weight = nil)
|
61
67
|
@request = request
|
62
68
|
@response = response
|
63
69
|
@session_token = session_token
|
@@ -66,6 +72,7 @@ module MoesifApi
|
|
66
72
|
@company_id = company_id
|
67
73
|
@metadata = metadata
|
68
74
|
@direction = direction
|
75
|
+
@weight = weight
|
69
76
|
end
|
70
77
|
|
71
78
|
# Creates an instance of the object from a hash
|
@@ -82,6 +89,7 @@ module MoesifApi
|
|
82
89
|
company_id = hash["company_id"]
|
83
90
|
metadata = hash["metadata"]
|
84
91
|
direction = hash["direction"]
|
92
|
+
weight = hash["weight"]
|
85
93
|
|
86
94
|
# Create object from extracted values
|
87
95
|
EventModel.new(request,
|
@@ -91,7 +99,8 @@ module MoesifApi
|
|
91
99
|
user_id,
|
92
100
|
company_id,
|
93
101
|
metadata,
|
94
|
-
direction
|
102
|
+
direction,
|
103
|
+
weight)
|
95
104
|
end
|
96
105
|
end
|
97
106
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moesif_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moesif, Inc
|
8
8
|
- Derric Gilling
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|
@@ -17,33 +17,42 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 3.
|
21
|
-
|
20
|
+
version: '3.5'
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.5.0
|
24
|
+
type: :development
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
28
|
- - "~>"
|
26
29
|
- !ruby/object:Gem::Version
|
27
|
-
version: 3.
|
30
|
+
version: '3.5'
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.5.0
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: moesif_unirest
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
31
37
|
requirements:
|
32
38
|
- - "~>"
|
33
39
|
- !ruby/object:Gem::Version
|
34
|
-
version: 1.1.
|
40
|
+
version: 1.1.6
|
35
41
|
type: :runtime
|
36
42
|
prerelease: false
|
37
43
|
version_requirements: !ruby/object:Gem::Requirement
|
38
44
|
requirements:
|
39
45
|
- - "~>"
|
40
46
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.1.
|
47
|
+
version: 1.1.6
|
42
48
|
- !ruby/object:Gem::Dependency
|
43
49
|
name: json_mapper
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
45
51
|
requirements:
|
46
52
|
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.2'
|
55
|
+
- - ">="
|
47
56
|
- !ruby/object:Gem::Version
|
48
57
|
version: 0.2.1
|
49
58
|
type: :runtime
|
@@ -51,6 +60,9 @@ dependencies:
|
|
51
60
|
version_requirements: !ruby/object:Gem::Requirement
|
52
61
|
requirements:
|
53
62
|
- - "~>"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0.2'
|
65
|
+
- - ">="
|
54
66
|
- !ruby/object:Gem::Version
|
55
67
|
version: 0.2.1
|
56
68
|
description: Collection/Data Ingestion API
|
@@ -94,13 +106,13 @@ homepage: https://moesif.com
|
|
94
106
|
licenses:
|
95
107
|
- Apache-2.0
|
96
108
|
metadata: {}
|
97
|
-
post_install_message:
|
109
|
+
post_install_message:
|
98
110
|
rdoc_options: []
|
99
111
|
require_paths:
|
100
112
|
- lib
|
101
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
114
|
requirements:
|
103
|
-
- - "
|
115
|
+
- - ">="
|
104
116
|
- !ruby/object:Gem::Version
|
105
117
|
version: '2.0'
|
106
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -109,9 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
121
|
- !ruby/object:Gem::Version
|
110
122
|
version: '0'
|
111
123
|
requirements: []
|
112
|
-
|
113
|
-
|
114
|
-
signing_key:
|
124
|
+
rubygems_version: 3.1.6
|
125
|
+
signing_key:
|
115
126
|
specification_version: 4
|
116
127
|
summary: moesif_api
|
117
128
|
test_files: []
|