Skip to content

Commit 8843747

Browse files
authored
Merge pull request #13 from alexagranov/v0.1.2
adding :resource_id and :service_id to Booking item response [finishe…
2 parents efeaf07 + 3c047c4 commit 8843747

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [0.1.2] - 2017-06-14 ##
5+
### Changed
6+
- [#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.
7+
48
## [0.1.1] - 2017-05-25 ##
59
### Changed
610
- [#12](https://github.com/gonebusy/gonebusy-nodejs-client/pull/12) - POST /bookings/new :user_id is now a required parameter.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This client library is a Ruby gem which can be compiled and used in your Ruby an
1616

1717
1. Open the command line interface or the terminal and navigate to the folder containing the source code.
1818
2. Run ``` gem build gonebusy.gemspec ``` to build the gem.
19-
3. Once built, the gem can be installed on the current work environment using ``` gem install gonebusy-0.1.1.gem ```
19+
3. Once built, the gem can be installed on the current work environment using ``` gem install gonebusy-0.1.2.gem ```
2020

2121
## How to Use
2222

gonebusy-ruby-client.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'gonebusy-ruby-client'
3-
s.version = '0.1.1'
3+
s.version = '0.1.2'
44
s.summary = 'GoneBusy API Ruby client'
55
s.description = 'This is a Ruby client for communicating with the full GoneBusy API'
66
s.authors = ["Alex Agranov"]

lib/gonebusy/models/entities_booking_response.rb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ class EntitiesBookingResponse < BaseModel
2222
# @return [EntitiesTimeWindowResponse]
2323
attr_accessor :time_window
2424

25+
# id of Resource performing Booking
26+
# @return [Integer]
27+
attr_accessor :resource_id
28+
29+
# id of Service booked
30+
# @return [Integer]
31+
attr_accessor :service_id
32+
2533
# A mapping from model property names to API property names
2634
def self.names
2735
if @_hash.nil?
@@ -31,6 +39,8 @@ def self.names
3139
@_hash["workflow_state"] = "workflow_state"
3240
@_hash["user_message"] = "user_message"
3341
@_hash["time_window"] = "time_window"
42+
@_hash["resource_id"] = "resource_id"
43+
@_hash["service_id"] = "service_id"
3444
end
3545
@_hash
3646
end
@@ -39,12 +49,16 @@ def initialize(id = nil,
3949
owner_id = nil,
4050
workflow_state = nil,
4151
user_message = nil,
42-
time_window = nil)
52+
time_window = nil,
53+
resource_id = nil,
54+
service_id = nil)
4355
@id = id
4456
@owner_id = owner_id
4557
@workflow_state = workflow_state
4658
@user_message = user_message
4759
@time_window = time_window
60+
@resource_id = resource_id
61+
@service_id = service_id
4862
end
4963

5064
# Creates an instance of the object from a hash
@@ -57,13 +71,17 @@ def self.from_hash(hash)
5771
workflow_state = hash['workflow_state']
5872
user_message = hash['user_message']
5973
time_window = EntitiesTimeWindowResponse.from_hash(hash['time_window']) if hash['time_window']
74+
resource_id = hash['resource_id']
75+
service_id = hash['service_id']
6076

6177
# Create object from extracted values
6278
EntitiesBookingResponse.new(id,
6379
owner_id,
6480
workflow_state,
6581
user_message,
66-
time_window)
82+
time_window,
83+
resource_id,
84+
service_id)
6785
end
6886
end
6987
end

0 commit comments

Comments
 (0)