gonebusy-ruby-client 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -68
  3. data/lib/gonebusy/api_helper.rb +181 -149
  4. data/lib/gonebusy/configuration.rb +51 -16
  5. data/lib/gonebusy/controllers/base_controller.rb +46 -45
  6. data/lib/gonebusy/controllers/bookings_controller.rb +257 -293
  7. data/lib/gonebusy/controllers/categories_controller.rb +151 -180
  8. data/lib/gonebusy/controllers/pricing_models_controller.rb +202 -241
  9. data/lib/gonebusy/controllers/resources_controller.rb +295 -355
  10. data/lib/gonebusy/controllers/schedules_controller.rb +361 -428
  11. data/lib/gonebusy/controllers/search_controller.rb +52 -63
  12. data/lib/gonebusy/controllers/services_controller.rb +310 -367
  13. data/lib/gonebusy/controllers/users_controller.rb +199 -239
  14. data/lib/gonebusy/exceptions/api_exception.rb +16 -16
  15. data/lib/gonebusy/exceptions/entities_error_error_exception.rb +27 -0
  16. data/lib/gonebusy/exceptions/entities_error_exception.rb +26 -26
  17. data/lib/gonebusy/gonebusy_client.rb +58 -58
  18. data/lib/gonebusy/http/auth/custom_auth.rb +15 -15
  19. data/lib/gonebusy/http/faraday_client.rb +43 -41
  20. data/lib/gonebusy/http/http_call_back.rb +17 -17
  21. data/lib/gonebusy/http/http_client.rb +84 -82
  22. data/lib/gonebusy/http/http_context.rb +15 -15
  23. data/lib/gonebusy/http/http_method_enum.rb +7 -7
  24. data/lib/gonebusy/http/http_request.rb +44 -44
  25. data/lib/gonebusy/http/http_response.rb +19 -19
  26. data/lib/gonebusy/models/base_model.rb +31 -31
  27. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -35
  28. data/lib/gonebusy/models/create_booking_body.rb +134 -80
  29. data/lib/gonebusy/models/create_booking_response.rb +35 -35
  30. data/lib/gonebusy/models/create_category_body.rb +71 -71
  31. data/lib/gonebusy/models/create_category_response.rb +35 -35
  32. data/lib/gonebusy/models/create_pricing_model_body.rb +80 -80
  33. data/lib/gonebusy/models/create_pricing_model_response.rb +35 -35
  34. data/lib/gonebusy/models/create_resource_body.rb +89 -89
  35. data/lib/gonebusy/models/create_resource_response.rb +35 -35
  36. data/lib/gonebusy/models/create_schedule_body.rb +143 -144
  37. data/lib/gonebusy/models/create_schedule_response.rb +35 -35
  38. data/lib/gonebusy/models/create_schedule_time_window_body.rb +116 -117
  39. data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -35
  40. data/lib/gonebusy/models/create_service_body.rb +107 -107
  41. data/lib/gonebusy/models/create_service_response.rb +35 -35
  42. data/lib/gonebusy/models/create_user_body.rb +89 -89
  43. data/lib/gonebusy/models/create_user_response.rb +35 -35
  44. data/lib/gonebusy/models/date_recurs_by_enum.rb +12 -12
  45. data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -35
  46. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -35
  47. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -35
  48. data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -35
  49. data/lib/gonebusy/models/entities_address_entity.rb +116 -116
  50. data/lib/gonebusy/models/entities_availability_response.rb +58 -58
  51. data/lib/gonebusy/models/entities_booking_response.rb +71 -71
  52. data/lib/gonebusy/models/entities_category_response.rb +98 -98
  53. data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -89
  54. data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -49
  55. data/lib/gonebusy/models/entities_resource_response.rb +107 -107
  56. data/lib/gonebusy/models/entities_schedule_response.rb +76 -76
  57. data/lib/gonebusy/models/entities_search_response.rb +54 -54
  58. data/lib/gonebusy/models/entities_service_response.rb +134 -130
  59. data/lib/gonebusy/models/entities_slots.rb +44 -45
  60. data/lib/gonebusy/models/entities_thing_type_response.rb +44 -44
  61. data/lib/gonebusy/models/entities_time_window_response.rb +134 -135
  62. data/lib/gonebusy/models/entities_user_response.rb +152 -152
  63. data/lib/gonebusy/models/frequency_enum.rb +17 -17
  64. data/lib/gonebusy/models/gender_enum.rb +9 -9
  65. data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -35
  66. data/lib/gonebusy/models/get_bookings_response.rb +40 -40
  67. data/lib/gonebusy/models/get_categories_response.rb +40 -40
  68. data/lib/gonebusy/models/get_category_by_id_response.rb +35 -35
  69. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -35
  70. data/lib/gonebusy/models/get_pricing_models_response.rb +40 -40
  71. data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -35
  72. data/lib/gonebusy/models/get_resource_things_response.rb +40 -40
  73. data/lib/gonebusy/models/get_resources_response.rb +40 -40
  74. data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -35
  75. data/lib/gonebusy/models/get_schedules_response.rb +40 -40
  76. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -35
  77. data/lib/gonebusy/models/get_service_by_id_response.rb +35 -35
  78. data/lib/gonebusy/models/get_services_response.rb +40 -40
  79. data/lib/gonebusy/models/get_user_by_id_response.rb +35 -35
  80. data/lib/gonebusy/models/get_users_response.rb +40 -40
  81. data/lib/gonebusy/models/occurrence_enum.rb +21 -21
  82. data/lib/gonebusy/models/recurs_by_enum.rb +15 -15
  83. data/lib/gonebusy/models/search_query_response.rb +35 -35
  84. data/lib/gonebusy/models/update_booking_by_id_body.rb +116 -0
  85. data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -35
  86. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -62
  87. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -35
  88. data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -71
  89. data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -35
  90. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +116 -117
  91. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -35
  92. data/lib/gonebusy/models/update_service_by_id_body.rb +98 -98
  93. data/lib/gonebusy/models/update_service_by_id_response.rb +35 -35
  94. data/lib/gonebusy/models/update_user_by_id_body.rb +89 -89
  95. data/lib/gonebusy/models/update_user_by_id_response.rb +35 -35
  96. data/lib/gonebusy.rb +108 -104
  97. metadata +53 -17
@@ -1,71 +1,71 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class EntitiesBookingResponse < BaseModel
5
- # id of Booking
6
- # @return [Integer]
7
- attr_accessor :id
8
-
9
- # id of owner of Booking
10
- # @return [Integer]
11
- attr_accessor :owner_id
12
-
13
- # TimeWindow corresponding to Booking
14
- # @return [EntitiesTimeWindowResponse]
15
- attr_accessor :time_window
16
-
17
- # user requesting Booking may include a message
18
- # @return [String]
19
- attr_accessor :user_message
20
-
21
- # status of Booking
22
- # @return [String]
23
- attr_accessor :workflow_state
24
-
25
- # A mapping from model property names to API property names
26
- def self.names
27
- if @hash.nil?
28
- @hash = {}
29
- @hash["id"] = "id"
30
- @hash["owner_id"] = "owner_id"
31
- @hash["time_window"] = "time_window"
32
- @hash["user_message"] = "user_message"
33
- @hash["workflow_state"] = "workflow_state"
34
- end
35
- @hash
36
- end
37
-
38
- def initialize(id = nil,
39
- owner_id = nil,
40
- time_window = nil,
41
- user_message = nil,
42
- workflow_state = nil)
43
- @id = id
44
- @owner_id = owner_id
45
- @time_window = time_window
46
- @user_message = user_message
47
- @workflow_state = workflow_state
48
- end
49
-
50
- # Creates an instance of the object from a hash
51
- def self.from_hash(hash)
52
- if hash == nil
53
- nil
54
- else
55
- # Extract variables from the hash
56
- id = hash["id"]
57
- owner_id = hash["owner_id"]
58
- time_window = EntitiesTimeWindowResponse.from_hash(hash["time_window"]) if hash["time_window"]
59
- user_message = hash["user_message"]
60
- workflow_state = hash["workflow_state"]
61
-
62
- # Create object from extracted values
63
- EntitiesBookingResponse.new(id,
64
- owner_id,
65
- time_window,
66
- user_message,
67
- workflow_state)
68
- end
69
- end
70
- end
71
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesBookingResponse < BaseModel
5
+ # id of Booking
6
+ # @return [Integer]
7
+ attr_accessor :id
8
+
9
+ # id of owner of Booking
10
+ # @return [Integer]
11
+ attr_accessor :owner_id
12
+
13
+ # TimeWindow corresponding to Booking
14
+ # @return [EntitiesTimeWindowResponse]
15
+ attr_accessor :time_window
16
+
17
+ # user requesting Booking may include a message
18
+ # @return [String]
19
+ attr_accessor :user_message
20
+
21
+ # status of Booking
22
+ # @return [String]
23
+ attr_accessor :workflow_state
24
+
25
+ # A mapping from model property names to API property names
26
+ def self.names
27
+ if @hash.nil?
28
+ @hash = {}
29
+ @hash["id"] = "id"
30
+ @hash["owner_id"] = "owner_id"
31
+ @hash["time_window"] = "time_window"
32
+ @hash["user_message"] = "user_message"
33
+ @hash["workflow_state"] = "workflow_state"
34
+ end
35
+ @hash
36
+ end
37
+
38
+ def initialize(id = nil,
39
+ owner_id = nil,
40
+ time_window = nil,
41
+ user_message = nil,
42
+ workflow_state = nil)
43
+ @id = id
44
+ @owner_id = owner_id
45
+ @time_window = time_window
46
+ @user_message = user_message
47
+ @workflow_state = workflow_state
48
+ end
49
+
50
+ # Creates an instance of the object from a hash
51
+ def self.from_hash(hash)
52
+ if hash == nil
53
+ nil
54
+ else
55
+ # Extract variables from the hash
56
+ id = hash['id']
57
+ owner_id = hash['owner_id']
58
+ time_window = EntitiesTimeWindowResponse.from_hash(hash['time_window']) if hash['time_window']
59
+ user_message = hash['user_message']
60
+ workflow_state = hash['workflow_state']
61
+
62
+ # Create object from extracted values
63
+ EntitiesBookingResponse.new(id,
64
+ owner_id,
65
+ time_window,
66
+ user_message,
67
+ workflow_state)
68
+ end
69
+ end
70
+ end
71
+ end
@@ -1,98 +1,98 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class EntitiesCategoryResponse < BaseModel
5
- # description of Category
6
- # @return [String]
7
- attr_accessor :description
8
-
9
- # id of Category
10
- # @return [Integer]
11
- attr_accessor :id
12
-
13
- # status of Category
14
- # @return [Boolean]
15
- attr_accessor :is_active
16
-
17
- # extended name for Category
18
- # @return [String]
19
- attr_accessor :long_name
20
-
21
- # name of Category
22
- # @return [String]
23
- attr_accessor :name
24
-
25
- # id of parent Category, if any
26
- # @return [Integer]
27
- attr_accessor :parent_category_id
28
-
29
- # abbreviated name for Category
30
- # @return [String]
31
- attr_accessor :short_name
32
-
33
- # array of subcategory ids, if any
34
- # @return [List of Integer]
35
- attr_accessor :subcategories
36
-
37
- # A mapping from model property names to API property names
38
- def self.names
39
- if @hash.nil?
40
- @hash = {}
41
- @hash["description"] = "description"
42
- @hash["id"] = "id"
43
- @hash["is_active"] = "is_active"
44
- @hash["long_name"] = "long_name"
45
- @hash["name"] = "name"
46
- @hash["parent_category_id"] = "parent_category_id"
47
- @hash["short_name"] = "short_name"
48
- @hash["subcategories"] = "subcategories"
49
- end
50
- @hash
51
- end
52
-
53
- def initialize(description = nil,
54
- id = nil,
55
- is_active = nil,
56
- long_name = nil,
57
- name = nil,
58
- parent_category_id = nil,
59
- short_name = nil,
60
- subcategories = nil)
61
- @description = description
62
- @id = id
63
- @is_active = is_active
64
- @long_name = long_name
65
- @name = name
66
- @parent_category_id = parent_category_id
67
- @short_name = short_name
68
- @subcategories = subcategories
69
- end
70
-
71
- # Creates an instance of the object from a hash
72
- def self.from_hash(hash)
73
- if hash == nil
74
- nil
75
- else
76
- # Extract variables from the hash
77
- description = hash["description"]
78
- id = hash["id"]
79
- is_active = hash["is_active"]
80
- long_name = hash["long_name"]
81
- name = hash["name"]
82
- parent_category_id = hash["parent_category_id"]
83
- short_name = hash["short_name"]
84
- subcategories = hash["subcategories"]
85
-
86
- # Create object from extracted values
87
- EntitiesCategoryResponse.new(description,
88
- id,
89
- is_active,
90
- long_name,
91
- name,
92
- parent_category_id,
93
- short_name,
94
- subcategories)
95
- end
96
- end
97
- end
98
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesCategoryResponse < BaseModel
5
+ # description of Category
6
+ # @return [String]
7
+ attr_accessor :description
8
+
9
+ # id of Category
10
+ # @return [Integer]
11
+ attr_accessor :id
12
+
13
+ # status of Category
14
+ # @return [Boolean]
15
+ attr_accessor :is_active
16
+
17
+ # extended name for Category
18
+ # @return [String]
19
+ attr_accessor :long_name
20
+
21
+ # name of Category
22
+ # @return [String]
23
+ attr_accessor :name
24
+
25
+ # id of parent Category, if any
26
+ # @return [Integer]
27
+ attr_accessor :parent_category_id
28
+
29
+ # abbreviated name for Category
30
+ # @return [String]
31
+ attr_accessor :short_name
32
+
33
+ # array of subcategory ids, if any
34
+ # @return [List of Integer]
35
+ attr_accessor :subcategories
36
+
37
+ # A mapping from model property names to API property names
38
+ def self.names
39
+ if @hash.nil?
40
+ @hash = {}
41
+ @hash["description"] = "description"
42
+ @hash["id"] = "id"
43
+ @hash["is_active"] = "is_active"
44
+ @hash["long_name"] = "long_name"
45
+ @hash["name"] = "name"
46
+ @hash["parent_category_id"] = "parent_category_id"
47
+ @hash["short_name"] = "short_name"
48
+ @hash["subcategories"] = "subcategories"
49
+ end
50
+ @hash
51
+ end
52
+
53
+ def initialize(description = nil,
54
+ id = nil,
55
+ is_active = nil,
56
+ long_name = nil,
57
+ name = nil,
58
+ parent_category_id = nil,
59
+ short_name = nil,
60
+ subcategories = nil)
61
+ @description = description
62
+ @id = id
63
+ @is_active = is_active
64
+ @long_name = long_name
65
+ @name = name
66
+ @parent_category_id = parent_category_id
67
+ @short_name = short_name
68
+ @subcategories = subcategories
69
+ end
70
+
71
+ # Creates an instance of the object from a hash
72
+ def self.from_hash(hash)
73
+ if hash == nil
74
+ nil
75
+ else
76
+ # Extract variables from the hash
77
+ description = hash['description']
78
+ id = hash['id']
79
+ is_active = hash['is_active']
80
+ long_name = hash['long_name']
81
+ name = hash['name']
82
+ parent_category_id = hash['parent_category_id']
83
+ short_name = hash['short_name']
84
+ subcategories = hash['subcategories']
85
+
86
+ # Create object from extracted values
87
+ EntitiesCategoryResponse.new(description,
88
+ id,
89
+ is_active,
90
+ long_name,
91
+ name,
92
+ parent_category_id,
93
+ short_name,
94
+ subcategories)
95
+ end
96
+ end
97
+ end
98
+ end
@@ -1,89 +1,89 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class EntitiesPricingModelResponse < BaseModel
5
- # currency symbol, as per ISO-4217
6
- # @return [String]
7
- attr_accessor :currency
8
-
9
- # id of PricingModel
10
- # @return [Integer]
11
- attr_accessor :id
12
-
13
- # name of PricingModel
14
- # @return [String]
15
- attr_accessor :name
16
-
17
- # notes and description
18
- # @return [String]
19
- attr_accessor :notes
20
-
21
- # id of owner of PricingModel
22
- # @return [Integer]
23
- attr_accessor :owner_id
24
-
25
- # price/rate
26
- # @return [String]
27
- attr_accessor :price
28
-
29
- # type of PricingModel
30
- # @return [String]
31
- attr_accessor :pricing_model_type
32
-
33
- # A mapping from model property names to API property names
34
- def self.names
35
- if @hash.nil?
36
- @hash = {}
37
- @hash["currency"] = "currency"
38
- @hash["id"] = "id"
39
- @hash["name"] = "name"
40
- @hash["notes"] = "notes"
41
- @hash["owner_id"] = "owner_id"
42
- @hash["price"] = "price"
43
- @hash["pricing_model_type"] = "pricing_model_type"
44
- end
45
- @hash
46
- end
47
-
48
- def initialize(currency = nil,
49
- id = nil,
50
- name = nil,
51
- notes = nil,
52
- owner_id = nil,
53
- price = nil,
54
- pricing_model_type = nil)
55
- @currency = currency
56
- @id = id
57
- @name = name
58
- @notes = notes
59
- @owner_id = owner_id
60
- @price = price
61
- @pricing_model_type = pricing_model_type
62
- end
63
-
64
- # Creates an instance of the object from a hash
65
- def self.from_hash(hash)
66
- if hash == nil
67
- nil
68
- else
69
- # Extract variables from the hash
70
- currency = hash["currency"]
71
- id = hash["id"]
72
- name = hash["name"]
73
- notes = hash["notes"]
74
- owner_id = hash["owner_id"]
75
- price = hash["price"]
76
- pricing_model_type = hash["pricing_model_type"]
77
-
78
- # Create object from extracted values
79
- EntitiesPricingModelResponse.new(currency,
80
- id,
81
- name,
82
- notes,
83
- owner_id,
84
- price,
85
- pricing_model_type)
86
- end
87
- end
88
- end
89
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesPricingModelResponse < BaseModel
5
+ # currency symbol, as per ISO-4217
6
+ # @return [String]
7
+ attr_accessor :currency
8
+
9
+ # id of PricingModel
10
+ # @return [Integer]
11
+ attr_accessor :id
12
+
13
+ # name of PricingModel
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # notes and description
18
+ # @return [String]
19
+ attr_accessor :notes
20
+
21
+ # id of owner of PricingModel
22
+ # @return [Integer]
23
+ attr_accessor :owner_id
24
+
25
+ # price/rate
26
+ # @return [String]
27
+ attr_accessor :price
28
+
29
+ # type of PricingModel
30
+ # @return [String]
31
+ attr_accessor :pricing_model_type
32
+
33
+ # A mapping from model property names to API property names
34
+ def self.names
35
+ if @hash.nil?
36
+ @hash = {}
37
+ @hash["currency"] = "currency"
38
+ @hash["id"] = "id"
39
+ @hash["name"] = "name"
40
+ @hash["notes"] = "notes"
41
+ @hash["owner_id"] = "owner_id"
42
+ @hash["price"] = "price"
43
+ @hash["pricing_model_type"] = "pricing_model_type"
44
+ end
45
+ @hash
46
+ end
47
+
48
+ def initialize(currency = nil,
49
+ id = nil,
50
+ name = nil,
51
+ notes = nil,
52
+ owner_id = nil,
53
+ price = nil,
54
+ pricing_model_type = nil)
55
+ @currency = currency
56
+ @id = id
57
+ @name = name
58
+ @notes = notes
59
+ @owner_id = owner_id
60
+ @price = price
61
+ @pricing_model_type = pricing_model_type
62
+ end
63
+
64
+ # Creates an instance of the object from a hash
65
+ def self.from_hash(hash)
66
+ if hash == nil
67
+ nil
68
+ else
69
+ # Extract variables from the hash
70
+ currency = hash['currency']
71
+ id = hash['id']
72
+ name = hash['name']
73
+ notes = hash['notes']
74
+ owner_id = hash['owner_id']
75
+ price = hash['price']
76
+ pricing_model_type = hash['pricing_model_type']
77
+
78
+ # Create object from extracted values
79
+ EntitiesPricingModelResponse.new(currency,
80
+ id,
81
+ name,
82
+ notes,
83
+ owner_id,
84
+ price,
85
+ pricing_model_type)
86
+ end
87
+ end
88
+ end
89
+ end