diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e9ab05..49d2bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to this project will be documented in this file. +## [0.1.2] - 2017-06-14 ## +### Changed +- [#13](https://github.com/gonebusy/gonebusy-nodejs-client/pull/13) - Booking item response now includes :resource_id and :service_id corresponding to Resource providing the Booking and the Service being performed. + ## [0.1.1] - 2017-05-25 ## ### Changed - [#12](https://github.com/gonebusy/gonebusy-nodejs-client/pull/12) - POST /bookings/new :user_id is now a required parameter. diff --git a/README.md b/README.md index 4efce2e..7de2c31 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This client library is a Ruby gem which can be compiled and used in your Ruby an 1. Open the command line interface or the terminal and navigate to the folder containing the source code. 2. Run ``` gem build gonebusy.gemspec ``` to build the gem. -3. Once built, the gem can be installed on the current work environment using ``` gem install gonebusy-0.1.1.gem ``` +3. Once built, the gem can be installed on the current work environment using ``` gem install gonebusy-0.1.2.gem ``` ## How to Use diff --git a/gonebusy-ruby-client.gemspec b/gonebusy-ruby-client.gemspec index b288c15..e293435 100644 --- a/gonebusy-ruby-client.gemspec +++ b/gonebusy-ruby-client.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'gonebusy-ruby-client' - s.version = '0.1.1' + s.version = '0.1.2' s.summary = 'GoneBusy API Ruby client' s.description = 'This is a Ruby client for communicating with the full GoneBusy API' s.authors = ["Alex Agranov"] diff --git a/lib/gonebusy/models/entities_booking_response.rb b/lib/gonebusy/models/entities_booking_response.rb index 0f120fe..9907686 100644 --- a/lib/gonebusy/models/entities_booking_response.rb +++ b/lib/gonebusy/models/entities_booking_response.rb @@ -22,6 +22,14 @@ class EntitiesBookingResponse < BaseModel # @return [EntitiesTimeWindowResponse] attr_accessor :time_window + # id of Resource performing Booking + # @return [Integer] + attr_accessor :resource_id + + # id of Service booked + # @return [Integer] + attr_accessor :service_id + # A mapping from model property names to API property names def self.names if @_hash.nil? @@ -31,6 +39,8 @@ def self.names @_hash["workflow_state"] = "workflow_state" @_hash["user_message"] = "user_message" @_hash["time_window"] = "time_window" + @_hash["resource_id"] = "resource_id" + @_hash["service_id"] = "service_id" end @_hash end @@ -39,12 +49,16 @@ def initialize(id = nil, owner_id = nil, workflow_state = nil, user_message = nil, - time_window = nil) + time_window = nil, + resource_id = nil, + service_id = nil) @id = id @owner_id = owner_id @workflow_state = workflow_state @user_message = user_message @time_window = time_window + @resource_id = resource_id + @service_id = service_id end # Creates an instance of the object from a hash @@ -57,13 +71,17 @@ def self.from_hash(hash) workflow_state = hash['workflow_state'] user_message = hash['user_message'] time_window = EntitiesTimeWindowResponse.from_hash(hash['time_window']) if hash['time_window'] + resource_id = hash['resource_id'] + service_id = hash['service_id'] # Create object from extracted values EntitiesBookingResponse.new(id, owner_id, workflow_state, user_message, - time_window) + time_window, + resource_id, + service_id) end end end