From 31a36b6ca68038573bb07ccde4260e365de123f1 Mon Sep 17 00:00:00 2001 From: Keyur Date: Tue, 17 Dec 2019 10:52:27 -0800 Subject: [PATCH] Add: weight field to Event Model Add: weight field to Event Model Bump version to 1.2.11 --- Gemfile.lock | 4 ++-- lib/moesif_api/configuration.rb | 2 +- lib/moesif_api/models/event_model.rb | 13 +++++++++++-- moesif_api.gemspec | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e1794a6..ab8bd97 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - moesif_api (1.2.10) + moesif_api (1.2.11) json_mapper (~> 0.2.1) moesif_unirest (~> 1.1.5) test-unit (~> 3.1.5) @@ -16,7 +16,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - json (2.2.0) + json (2.3.0) json_mapper (0.2.1) json (>= 1.4.3) mime-types (3.3) diff --git a/lib/moesif_api/configuration.rb b/lib/moesif_api/configuration.rb index 76c96db..8cca85f 100755 --- a/lib/moesif_api/configuration.rb +++ b/lib/moesif_api/configuration.rb @@ -8,7 +8,7 @@ class Configuration # Your Application Id for authentication/authorization @application_id = 'SET_ME' - @version = '1.2.10' + @version = '1.2.11' # create the getters and setters class << self diff --git a/lib/moesif_api/models/event_model.rb b/lib/moesif_api/models/event_model.rb index 7754323..5a63f62 100755 --- a/lib/moesif_api/models/event_model.rb +++ b/lib/moesif_api/models/event_model.rb @@ -34,6 +34,10 @@ class EventModel < BaseModel # @return [String] attr_accessor :direction + # Weight of an API call + # @return [Integer] + attr_accessor :weight + # A mapping from model property names to API property names def self.names if @hash.nil? @@ -46,6 +50,7 @@ def self.names @hash["company_id"] = "company_id" @hash["metadata"] = "metadata" @hash["direction"] = "direction" + @hash["weight"] = "weight" end @hash end @@ -57,7 +62,8 @@ def initialize(request = nil, user_id = nil, company_id = nil, metadata = nil, - direction = nil) + direction = nil, + weight = nil) @request = request @response = response @session_token = session_token @@ -66,6 +72,7 @@ def initialize(request = nil, @company_id = company_id @metadata = metadata @direction = direction + @weight = weight end # Creates an instance of the object from a hash @@ -82,6 +89,7 @@ def self.from_hash(hash) company_id = hash["company_id"] metadata = hash["metadata"] direction = hash["direction"] + weight = hash["weight"] # Create object from extracted values EventModel.new(request, @@ -91,7 +99,8 @@ def self.from_hash(hash) user_id, company_id, metadata, - direction) + direction, + weight) end end end diff --git a/moesif_api.gemspec b/moesif_api.gemspec index bc24ea5..305fe33 100755 --- a/moesif_api.gemspec +++ b/moesif_api.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'moesif_api' - s.version = '1.2.10' + s.version = '1.2.11' s.summary = 'moesif_api' s.description = 'Collection/Data Ingestion API' s.authors = ['Moesif, Inc', 'Derric Gilling']