gonebusy-ruby-client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +2 -1
  4. data/lib/gonebusy/controllers/bookings_controller.rb +77 -74
  5. data/lib/gonebusy/controllers/categories_controller.rb +29 -29
  6. data/lib/gonebusy/controllers/pricing_models_controller.rb +47 -47
  7. data/lib/gonebusy/controllers/resources_controller.rb +77 -77
  8. data/lib/gonebusy/controllers/schedules_controller.rb +92 -92
  9. data/lib/gonebusy/controllers/services_controller.rb +86 -86
  10. data/lib/gonebusy/controllers/users_controller.rb +56 -56
  11. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +10 -12
  12. data/lib/gonebusy/models/create_booking_body.rb +78 -80
  13. data/lib/gonebusy/models/create_booking_response.rb +10 -12
  14. data/lib/gonebusy/models/create_category_body.rb +34 -36
  15. data/lib/gonebusy/models/create_category_response.rb +10 -12
  16. data/lib/gonebusy/models/create_pricing_model_body.rb +35 -37
  17. data/lib/gonebusy/models/create_pricing_model_response.rb +10 -12
  18. data/lib/gonebusy/models/create_resource_body.rb +39 -41
  19. data/lib/gonebusy/models/create_resource_response.rb +10 -12
  20. data/lib/gonebusy/models/create_schedule_body.rb +92 -94
  21. data/lib/gonebusy/models/create_schedule_response.rb +10 -12
  22. data/lib/gonebusy/models/create_schedule_time_window_body.rb +64 -66
  23. data/lib/gonebusy/models/create_schedule_time_window_response.rb +10 -12
  24. data/lib/gonebusy/models/create_service_body.rb +57 -59
  25. data/lib/gonebusy/models/create_service_response.rb +10 -12
  26. data/lib/gonebusy/models/create_user_body.rb +40 -42
  27. data/lib/gonebusy/models/create_user_response.rb +10 -12
  28. data/lib/gonebusy/models/delete_resource_by_id_response.rb +10 -12
  29. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +10 -12
  30. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +10 -12
  31. data/lib/gonebusy/models/delete_service_by_id_response.rb +10 -12
  32. data/lib/gonebusy/models/entities_address_entity.rb +69 -71
  33. data/lib/gonebusy/models/entities_availability_response.rb +21 -23
  34. data/lib/gonebusy/models/entities_booking_response.rb +32 -34
  35. data/lib/gonebusy/models/entities_category_response.rb +52 -54
  36. data/lib/gonebusy/models/entities_pricing_model_response.rb +44 -46
  37. data/lib/gonebusy/models/entities_resource_availabilities.rb +24 -26
  38. data/lib/gonebusy/models/entities_resource_response.rb +60 -62
  39. data/lib/gonebusy/models/entities_schedule_response.rb +26 -28
  40. data/lib/gonebusy/models/entities_search_response.rb +29 -31
  41. data/lib/gonebusy/models/entities_service_response.rb +82 -84
  42. data/lib/gonebusy/models/entities_slots.rb +13 -15
  43. data/lib/gonebusy/models/entities_thing_type_response.rb +13 -15
  44. data/lib/gonebusy/models/entities_time_window_response.rb +81 -83
  45. data/lib/gonebusy/models/entities_user_response.rb +95 -97
  46. data/lib/gonebusy/models/get_booking_by_id_response.rb +10 -12
  47. data/lib/gonebusy/models/get_bookings_response.rb +14 -16
  48. data/lib/gonebusy/models/get_categories_response.rb +14 -16
  49. data/lib/gonebusy/models/get_category_by_id_response.rb +10 -12
  50. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +10 -12
  51. data/lib/gonebusy/models/get_pricing_models_response.rb +14 -16
  52. data/lib/gonebusy/models/get_resource_by_id_response.rb +10 -12
  53. data/lib/gonebusy/models/get_resource_things_response.rb +14 -16
  54. data/lib/gonebusy/models/get_resources_response.rb +14 -16
  55. data/lib/gonebusy/models/get_schedule_by_id_response.rb +10 -12
  56. data/lib/gonebusy/models/get_schedules_response.rb +14 -16
  57. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +10 -12
  58. data/lib/gonebusy/models/get_service_by_id_response.rb +10 -12
  59. data/lib/gonebusy/models/get_services_response.rb +14 -16
  60. data/lib/gonebusy/models/get_user_by_id_response.rb +10 -12
  61. data/lib/gonebusy/models/get_users_response.rb +14 -16
  62. data/lib/gonebusy/models/search_query_response.rb +10 -12
  63. data/lib/gonebusy/models/update_booking_by_id_body.rb +58 -60
  64. data/lib/gonebusy/models/update_booking_by_id_response.rb +10 -12
  65. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +28 -30
  66. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +10 -12
  67. data/lib/gonebusy/models/update_resource_by_id_body.rb +33 -35
  68. data/lib/gonebusy/models/update_resource_by_id_response.rb +10 -12
  69. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +71 -73
  70. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +10 -12
  71. data/lib/gonebusy/models/update_service_by_id_body.rb +43 -45
  72. data/lib/gonebusy/models/update_service_by_id_response.rb +10 -12
  73. data/lib/gonebusy/models/update_user_by_id_body.rb +41 -43
  74. data/lib/gonebusy/models/update_user_by_id_response.rb +10 -12
  75. data/lib/gonebusy.rb +67 -67
  76. metadata +2 -3
  77. data/lib/gonebusy/exceptions/entities_error_exception.rb +0 -27
@@ -2,6 +2,10 @@
2
2
 
3
3
  module Gonebusy
4
4
  class CreateServiceBody < BaseModel
5
+ # Service Name
6
+ # @return [String]
7
+ attr_accessor :name
8
+
5
9
  # Service Description
6
10
  # @return [String]
7
11
  attr_accessor :description
@@ -10,18 +14,18 @@ module Gonebusy
10
14
  # @return [Integer]
11
15
  attr_accessor :duration
12
16
 
13
- # Service Name
14
- # @return [String]
15
- attr_accessor :name
16
-
17
- # Optional List of comma-separated Category IDs to associate with Service
18
- # @return [String]
19
- attr_accessor :categories
20
-
21
17
  # Max duration of the Service in minutes
22
18
  # @return [Integer]
23
19
  attr_accessor :max_duration
24
20
 
21
+ # ID of User to create Service for. You must be authorized to manage this User Id.
22
+ # @return [Integer]
23
+ attr_accessor :user_id
24
+
25
+ # Optional abbreviated Service name
26
+ # @return [String]
27
+ attr_accessor :short_name
28
+
25
29
  # Optional Price Model Id
26
30
  # @return [Integer]
27
31
  attr_accessor :price_model_id
@@ -30,78 +34,72 @@ module Gonebusy
30
34
  # @return [String]
31
35
  attr_accessor :resources
32
36
 
33
- # Optional abbreviated Service name
37
+ # Optional List of comma-separated Category IDs to associate with Service
34
38
  # @return [String]
35
- attr_accessor :short_name
36
-
37
- # ID of User to create Service for. You must be authorized to manage this User Id.
38
- # @return [Integer]
39
- attr_accessor :user_id
39
+ attr_accessor :categories
40
40
 
41
41
  # A mapping from model property names to API property names
42
42
  def self.names
43
- if @hash.nil?
44
- @hash = {}
45
- @hash["description"] = "description"
46
- @hash["duration"] = "duration"
47
- @hash["name"] = "name"
48
- @hash["categories"] = "categories"
49
- @hash["max_duration"] = "max_duration"
50
- @hash["price_model_id"] = "price_model_id"
51
- @hash["resources"] = "resources"
52
- @hash["short_name"] = "short_name"
53
- @hash["user_id"] = "user_id"
43
+ if @_hash.nil?
44
+ @_hash = {}
45
+ @_hash["name"] = "name"
46
+ @_hash["description"] = "description"
47
+ @_hash["duration"] = "duration"
48
+ @_hash["max_duration"] = "max_duration"
49
+ @_hash["user_id"] = "user_id"
50
+ @_hash["short_name"] = "short_name"
51
+ @_hash["price_model_id"] = "price_model_id"
52
+ @_hash["resources"] = "resources"
53
+ @_hash["categories"] = "categories"
54
54
  end
55
- @hash
55
+ @_hash
56
56
  end
57
57
 
58
- def initialize(description = nil,
58
+ def initialize(name = nil,
59
+ description = nil,
59
60
  duration = nil,
60
- name = nil,
61
- categories = nil,
62
61
  max_duration = nil,
62
+ user_id = nil,
63
+ short_name = nil,
63
64
  price_model_id = nil,
64
65
  resources = nil,
65
- short_name = nil,
66
- user_id = nil)
66
+ categories = nil)
67
+ @name = name
67
68
  @description = description
68
69
  @duration = duration
69
- @name = name
70
- @categories = categories
71
70
  @max_duration = max_duration
71
+ @user_id = user_id
72
+ @short_name = short_name
72
73
  @price_model_id = price_model_id
73
74
  @resources = resources
74
- @short_name = short_name
75
- @user_id = user_id
75
+ @categories = categories
76
76
  end
77
77
 
78
78
  # Creates an instance of the object from a hash
79
79
  def self.from_hash(hash)
80
- if hash == nil
81
- nil
82
- else
83
- # Extract variables from the hash
84
- description = hash['description']
85
- duration = hash['duration']
86
- name = hash['name']
87
- categories = hash['categories']
88
- max_duration = hash['max_duration']
89
- price_model_id = hash['price_model_id']
90
- resources = hash['resources']
91
- short_name = hash['short_name']
92
- user_id = hash['user_id']
80
+ return nil unless hash
93
81
 
94
- # Create object from extracted values
95
- CreateServiceBody.new(description,
96
- duration,
97
- name,
98
- categories,
99
- max_duration,
100
- price_model_id,
101
- resources,
102
- short_name,
103
- user_id)
104
- end
82
+ # Extract variables from the hash
83
+ name = hash['name']
84
+ description = hash['description']
85
+ duration = hash['duration']
86
+ max_duration = hash['max_duration']
87
+ user_id = hash['user_id']
88
+ short_name = hash['short_name']
89
+ price_model_id = hash['price_model_id']
90
+ resources = hash['resources']
91
+ categories = hash['categories']
92
+
93
+ # Create object from extracted values
94
+ CreateServiceBody.new(name,
95
+ description,
96
+ duration,
97
+ max_duration,
98
+ user_id,
99
+ short_name,
100
+ price_model_id,
101
+ resources,
102
+ categories)
105
103
  end
106
104
  end
107
105
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["service"] = "service"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["service"] = "service"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(service = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- CreateServiceResponse.new(service)
32
- end
26
+ # Extract variables from the hash
27
+ service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
28
+
29
+ # Create object from extracted values
30
+ CreateServiceResponse.new(service)
33
31
  end
34
32
  end
35
33
  end
@@ -6,14 +6,6 @@ module Gonebusy
6
6
  # @return [String]
7
7
  attr_accessor :email
8
8
 
9
- # Optional name for your Business/Organization
10
- # @return [String]
11
- attr_accessor :business_name
12
-
13
- # Optional website URL
14
- # @return [String]
15
- attr_accessor :external_url
16
-
17
9
  # Optional first name
18
10
  # @return [String]
19
11
  attr_accessor :first_name
@@ -22,6 +14,14 @@ module Gonebusy
22
14
  # @return [String]
23
15
  attr_accessor :last_name
24
16
 
17
+ # Optional name for your Business/Organization
18
+ # @return [String]
19
+ attr_accessor :business_name
20
+
21
+ # Optional website URL
22
+ # @return [String]
23
+ attr_accessor :external_url
24
+
25
25
  # Optional vanity url - ex: www.gonebusy.com/[permalink] - must be unique
26
26
  # @return [String]
27
27
  attr_accessor :permalink
@@ -32,58 +32,56 @@ module Gonebusy
32
32
 
33
33
  # A mapping from model property names to API property names
34
34
  def self.names
35
- if @hash.nil?
36
- @hash = {}
37
- @hash["email"] = "email"
38
- @hash["business_name"] = "business_name"
39
- @hash["external_url"] = "external_url"
40
- @hash["first_name"] = "first_name"
41
- @hash["last_name"] = "last_name"
42
- @hash["permalink"] = "permalink"
43
- @hash["timezone"] = "timezone"
35
+ if @_hash.nil?
36
+ @_hash = {}
37
+ @_hash["email"] = "email"
38
+ @_hash["first_name"] = "first_name"
39
+ @_hash["last_name"] = "last_name"
40
+ @_hash["business_name"] = "business_name"
41
+ @_hash["external_url"] = "external_url"
42
+ @_hash["permalink"] = "permalink"
43
+ @_hash["timezone"] = "timezone"
44
44
  end
45
- @hash
45
+ @_hash
46
46
  end
47
47
 
48
48
  def initialize(email = nil,
49
- business_name = nil,
50
- external_url = nil,
51
49
  first_name = nil,
52
50
  last_name = nil,
51
+ business_name = nil,
52
+ external_url = nil,
53
53
  permalink = nil,
54
54
  timezone = nil)
55
55
  @email = email
56
- @business_name = business_name
57
- @external_url = external_url
58
56
  @first_name = first_name
59
57
  @last_name = last_name
58
+ @business_name = business_name
59
+ @external_url = external_url
60
60
  @permalink = permalink
61
61
  @timezone = timezone
62
62
  end
63
63
 
64
64
  # Creates an instance of the object from a hash
65
65
  def self.from_hash(hash)
66
- if hash == nil
67
- nil
68
- else
69
- # Extract variables from the hash
70
- email = hash['email']
71
- business_name = hash['business_name']
72
- external_url = hash['external_url']
73
- first_name = hash['first_name']
74
- last_name = hash['last_name']
75
- permalink = hash['permalink']
76
- timezone = hash['timezone']
66
+ return nil unless hash
77
67
 
78
- # Create object from extracted values
79
- CreateUserBody.new(email,
80
- business_name,
81
- external_url,
82
- first_name,
83
- last_name,
84
- permalink,
85
- timezone)
86
- end
68
+ # Extract variables from the hash
69
+ email = hash['email']
70
+ first_name = hash['first_name']
71
+ last_name = hash['last_name']
72
+ business_name = hash['business_name']
73
+ external_url = hash['external_url']
74
+ permalink = hash['permalink']
75
+ timezone = hash['timezone']
76
+
77
+ # Create object from extracted values
78
+ CreateUserBody.new(email,
79
+ first_name,
80
+ last_name,
81
+ business_name,
82
+ external_url,
83
+ permalink,
84
+ timezone)
87
85
  end
88
86
  end
89
87
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["user"] = "user"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["user"] = "user"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(user = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- CreateUserResponse.new(user)
32
- end
26
+ # Extract variables from the hash
27
+ user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
28
+
29
+ # Create object from extracted values
30
+ CreateUserResponse.new(user)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["resource"] = "resource"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["resource"] = "resource"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(resource = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- resource = EntitiesResourceResponse.from_hash(hash['resource']) if hash['resource']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- DeleteResourceByIdResponse.new(resource)
32
- end
26
+ # Extract variables from the hash
27
+ resource = EntitiesResourceResponse.from_hash(hash['resource']) if hash['resource']
28
+
29
+ # Create object from extracted values
30
+ DeleteResourceByIdResponse.new(resource)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["schedule"] = "schedule"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["schedule"] = "schedule"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(schedule = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- DeleteScheduleByIdResponse.new(schedule)
32
- end
26
+ # Extract variables from the hash
27
+ schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
28
+
29
+ # Create object from extracted values
30
+ DeleteScheduleByIdResponse.new(schedule)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["schedule"] = "schedule"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["schedule"] = "schedule"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(schedule = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- DeleteScheduleTimeWindowByIdResponse.new(schedule)
32
- end
26
+ # Extract variables from the hash
27
+ schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
28
+
29
+ # Create object from extracted values
30
+ DeleteScheduleTimeWindowByIdResponse.new(schedule)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["service"] = "service"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["service"] = "service"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(service = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- DeleteServiceByIdResponse.new(service)
32
- end
26
+ # Extract variables from the hash
27
+ service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
28
+
29
+ # Create object from extracted values
30
+ DeleteServiceByIdResponse.new(service)
33
31
  end
34
32
  end
35
33
  end