Skip to content

Commit

Permalink
Merge pull request #14 from alexagranov/v0.1.3
Browse files Browse the repository at this point in the history
Booking creation/update now accepts :name and :description; BookingRe…
  • Loading branch information
alexagranov authored Jun 19, 2017
2 parents 8843747 + c5af71c commit de4a19b
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 21 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.1.3] - 2017-06-18 ##
### Added
- [#14](https://github.com/gonebusy/gonebusy-ruby-client/pull/14) - Booking creation/update now accept optional :name and :description
- [#14](https://github.com/gonebusy/gonebusy-ruby-client/pull/14) - Booking item response now contains :name, :description, :external_link, :collaborative_link

### Changed
- [#14](https://github.com/gonebusy/gonebusy-ruby-client/pull/14) - Booking :user_message has been replaced by separate :name and :description

## [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.
- [#13](https://github.com/gonebusy/gonebusy-ruby-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.
- [#12](https://github.com/gonebusy/gonebusy-ruby-client/pull/12) - POST /bookings/new :user_id is now a required parameter.

### Added
- [#12](https://github.com/gonebusy/gonebusy-nodejs-client/pull/12) - GET /bookings now supports optional :booker_id parameter to filter retrieved bookings to those made on behalf of :booker_id.
- [#12](https://github.com/gonebusy/gonebusy-ruby-client/pull/12) - GET /bookings now supports optional :booker_id parameter to filter retrieved bookings to those made on behalf of :booker_id.

## [0.1.0] - 2017-05-09 ##
### NOTE - This version introduces breaking changes and additions listed below.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.gem ```
3. Once built, the gem can be installed on the current work environment using ``` gem install gonebusy-0.1.3.gem ```

## How to Use

Expand Down
2 changes: 1 addition & 1 deletion gonebusy-ruby-client.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'gonebusy-ruby-client'
s.version = '0.1.2'
s.version = '0.1.3'
s.summary = 'GoneBusy API Ruby client'
s.description = 'This is a Ruby client for communicating with the full GoneBusy API'
s.authors = ["Alex Agranov"]
Expand Down
24 changes: 21 additions & 3 deletions lib/gonebusy/models/create_booking_body.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
# This file was automatically generated by APIMATIC v2.0.

module Gonebusy
class CreateBookingBody < BaseModel
Expand Down Expand Up @@ -50,6 +50,14 @@ class CreateBookingBody < BaseModel
# @return [DateRecursByEnum]
attr_accessor :date_recurs_by

# Optional name for Booking, otherwise will take name of Service.
# @return [String]
attr_accessor :name

# Optional description for Booking.
# @return [String]
attr_accessor :description

# A mapping from model property names to API property names
def self.names
if @_hash.nil?
Expand All @@ -66,6 +74,8 @@ def self.names
@_hash["days"] = "days"
@_hash["occurrence"] = "occurrence"
@_hash["date_recurs_by"] = "date_recurs_by"
@_hash["name"] = "name"
@_hash["description"] = "description"
end
@_hash
end
Expand All @@ -81,7 +91,9 @@ def initialize(service_id = nil,
frequency = nil,
days = nil,
occurrence = nil,
date_recurs_by = nil)
date_recurs_by = nil,
name = nil,
description = nil)
@service_id = service_id
@date = date
@time = time
Expand All @@ -94,6 +106,8 @@ def initialize(service_id = nil,
@days = days
@occurrence = occurrence
@date_recurs_by = date_recurs_by
@name = name
@description = description
end

# Creates an instance of the object from a hash
Expand All @@ -113,6 +127,8 @@ def self.from_hash(hash)
days = hash['days']
occurrence = hash['occurrence']
date_recurs_by = hash['date_recurs_by']
name = hash['name']
description = hash['description']

# Create object from extracted values
CreateBookingBody.new(service_id,
Expand All @@ -126,7 +142,9 @@ def self.from_hash(hash)
frequency,
days,
occurrence,
date_recurs_by)
date_recurs_by,
name,
description)
end
end
end
47 changes: 37 additions & 10 deletions lib/gonebusy/models/entities_booking_response.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
# This file was automatically generated by APIMATIC v2.0.

module Gonebusy
class EntitiesBookingResponse < BaseModel
Expand All @@ -14,9 +14,9 @@ class EntitiesBookingResponse < BaseModel
# @return [String]
attr_accessor :workflow_state

# user requesting Booking may include a message
# name of Booking, if any
# @return [String]
attr_accessor :user_message
attr_accessor :name

# TimeWindow corresponding to Booking
# @return [EntitiesTimeWindowResponse]
Expand All @@ -30,35 +30,56 @@ class EntitiesBookingResponse < BaseModel
# @return [Integer]
attr_accessor :service_id

# description for Booking, if any
# @return [String]
attr_accessor :description

# external management link for Booking, if any
# @return [String]
attr_accessor :external_link

# video chat or other link associated with Booking, if any
# @return [String]
attr_accessor :collaborative_link

# A mapping from model property names to API property names
def self.names
if @_hash.nil?
@_hash = {}
@_hash["id"] = "id"
@_hash["owner_id"] = "owner_id"
@_hash["workflow_state"] = "workflow_state"
@_hash["user_message"] = "user_message"
@_hash["name"] = "name"
@_hash["time_window"] = "time_window"
@_hash["resource_id"] = "resource_id"
@_hash["service_id"] = "service_id"
@_hash["description"] = "description"
@_hash["external_link"] = "external_link"
@_hash["collaborative_link"] = "collaborative_link"
end
@_hash
end

def initialize(id = nil,
owner_id = nil,
workflow_state = nil,
user_message = nil,
name = nil,
time_window = nil,
resource_id = nil,
service_id = nil)
service_id = nil,
description = nil,
external_link = nil,
collaborative_link = nil)
@id = id
@owner_id = owner_id
@workflow_state = workflow_state
@user_message = user_message
@name = name
@time_window = time_window
@resource_id = resource_id
@service_id = service_id
@description = description
@external_link = external_link
@collaborative_link = collaborative_link
end

# Creates an instance of the object from a hash
Expand All @@ -69,19 +90,25 @@ def self.from_hash(hash)
id = hash['id']
owner_id = hash['owner_id']
workflow_state = hash['workflow_state']
user_message = hash['user_message']
name = hash['name']
time_window = EntitiesTimeWindowResponse.from_hash(hash['time_window']) if hash['time_window']
resource_id = hash['resource_id']
service_id = hash['service_id']
description = hash['description']
external_link = hash['external_link']
collaborative_link = hash['collaborative_link']

# Create object from extracted values
EntitiesBookingResponse.new(id,
owner_id,
workflow_state,
user_message,
name,
time_window,
resource_id,
service_id)
service_id,
description,
external_link,
collaborative_link)
end
end
end
24 changes: 21 additions & 3 deletions lib/gonebusy/models/update_booking_by_id_body.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
# This file was automatically generated by APIMATIC v2.0.

module Gonebusy
class UpdateBookingByIdBody < BaseModel
Expand Down Expand Up @@ -42,6 +42,14 @@ class UpdateBookingByIdBody < BaseModel
# @return [String]
attr_accessor :update_recurring

# New name for Booking.
# @return [String]
attr_accessor :name

# New description for Booking.
# @return [String]
attr_accessor :description

# A mapping from model property names to API property names
def self.names
if @_hash.nil?
Expand All @@ -56,6 +64,8 @@ def self.names
@_hash["occurrence"] = "occurrence"
@_hash["date_recurs_by"] = "date_recurs_by"
@_hash["update_recurring"] = "update_recurring"
@_hash["name"] = "name"
@_hash["description"] = "description"
end
@_hash
end
Expand All @@ -69,7 +79,9 @@ def initialize(date = nil,
days = nil,
occurrence = nil,
date_recurs_by = nil,
update_recurring = nil)
update_recurring = nil,
name = nil,
description = nil)
@date = date
@time = time
@duration = duration
Expand All @@ -80,6 +92,8 @@ def initialize(date = nil,
@occurrence = occurrence
@date_recurs_by = date_recurs_by
@update_recurring = update_recurring
@name = name
@description = description
end

# Creates an instance of the object from a hash
Expand All @@ -97,6 +111,8 @@ def self.from_hash(hash)
occurrence = hash['occurrence']
date_recurs_by = hash['date_recurs_by']
update_recurring = hash['update_recurring']
name = hash['name']
description = hash['description']

# Create object from extracted values
UpdateBookingByIdBody.new(date,
Expand All @@ -108,7 +124,9 @@ def self.from_hash(hash)
days,
occurrence,
date_recurs_by,
update_recurring)
update_recurring,
name,
description)
end
end
end

0 comments on commit de4a19b

Please sign in to comment.