gonebusy-ruby-client 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +1963 -0
  4. data/lib/gonebusy/api_helper.rb +149 -0
  5. data/lib/gonebusy/configuration.rb +16 -0
  6. data/lib/gonebusy/controllers/base_controller.rb +45 -0
  7. data/lib/gonebusy/controllers/bookings_controller.rb +298 -0
  8. data/lib/gonebusy/controllers/categories_controller.rb +180 -0
  9. data/lib/gonebusy/controllers/pricing_models_controller.rb +241 -0
  10. data/lib/gonebusy/controllers/resources_controller.rb +355 -0
  11. data/lib/gonebusy/controllers/schedules_controller.rb +426 -0
  12. data/lib/gonebusy/controllers/search_controller.rb +64 -0
  13. data/lib/gonebusy/controllers/services_controller.rb +367 -0
  14. data/lib/gonebusy/controllers/users_controller.rb +288 -0
  15. data/lib/gonebusy/exceptions/api_exception.rb +16 -0
  16. data/lib/gonebusy/exceptions/entities_error_exception.rb +27 -0
  17. data/lib/gonebusy/gonebusy_client.rb +58 -0
  18. data/lib/gonebusy/http/auth/custom_auth.rb +16 -0
  19. data/lib/gonebusy/http/faraday_client.rb +41 -0
  20. data/lib/gonebusy/http/http_call_back.rb +17 -0
  21. data/lib/gonebusy/http/http_client.rb +82 -0
  22. data/lib/gonebusy/http/http_context.rb +15 -0
  23. data/lib/gonebusy/http/http_method_enum.rb +7 -0
  24. data/lib/gonebusy/http/http_request.rb +44 -0
  25. data/lib/gonebusy/http/http_response.rb +19 -0
  26. data/lib/gonebusy/models/base_model.rb +32 -0
  27. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -0
  28. data/lib/gonebusy/models/create_booking_body.rb +80 -0
  29. data/lib/gonebusy/models/create_booking_response.rb +35 -0
  30. data/lib/gonebusy/models/create_category_body.rb +71 -0
  31. data/lib/gonebusy/models/create_category_response.rb +35 -0
  32. data/lib/gonebusy/models/create_pricing_model_body.rb +80 -0
  33. data/lib/gonebusy/models/create_pricing_model_response.rb +35 -0
  34. data/lib/gonebusy/models/create_resource_body.rb +89 -0
  35. data/lib/gonebusy/models/create_resource_response.rb +35 -0
  36. data/lib/gonebusy/models/create_schedule_body.rb +144 -0
  37. data/lib/gonebusy/models/create_schedule_response.rb +35 -0
  38. data/lib/gonebusy/models/create_schedule_time_window_body.rb +117 -0
  39. data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -0
  40. data/lib/gonebusy/models/create_service_body.rb +98 -0
  41. data/lib/gonebusy/models/create_service_response.rb +35 -0
  42. data/lib/gonebusy/models/create_user_body.rb +89 -0
  43. data/lib/gonebusy/models/create_user_response.rb +35 -0
  44. data/lib/gonebusy/models/date_recurs_by_enum.rb +13 -0
  45. data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -0
  46. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -0
  47. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -0
  48. data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -0
  49. data/lib/gonebusy/models/entities_address_entity.rb +116 -0
  50. data/lib/gonebusy/models/entities_availability_response.rb +58 -0
  51. data/lib/gonebusy/models/entities_booking_response.rb +71 -0
  52. data/lib/gonebusy/models/entities_category_response.rb +98 -0
  53. data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -0
  54. data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -0
  55. data/lib/gonebusy/models/entities_resource_response.rb +98 -0
  56. data/lib/gonebusy/models/entities_schedule_response.rb +76 -0
  57. data/lib/gonebusy/models/entities_search_response.rb +54 -0
  58. data/lib/gonebusy/models/entities_service_response.rb +116 -0
  59. data/lib/gonebusy/models/entities_slots.rb +45 -0
  60. data/lib/gonebusy/models/entities_thing_type_response.rb +44 -0
  61. data/lib/gonebusy/models/entities_time_window_response.rb +135 -0
  62. data/lib/gonebusy/models/entities_user_response.rb +152 -0
  63. data/lib/gonebusy/models/frequency_enum.rb +18 -0
  64. data/lib/gonebusy/models/gender_enum.rb +10 -0
  65. data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -0
  66. data/lib/gonebusy/models/get_bookings_response.rb +40 -0
  67. data/lib/gonebusy/models/get_categories_response.rb +40 -0
  68. data/lib/gonebusy/models/get_category_by_id_response.rb +35 -0
  69. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -0
  70. data/lib/gonebusy/models/get_pricing_models_response.rb +40 -0
  71. data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -0
  72. data/lib/gonebusy/models/get_resource_things_response.rb +40 -0
  73. data/lib/gonebusy/models/get_resources_response.rb +40 -0
  74. data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -0
  75. data/lib/gonebusy/models/get_schedules_response.rb +40 -0
  76. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -0
  77. data/lib/gonebusy/models/get_service_by_id_response.rb +35 -0
  78. data/lib/gonebusy/models/get_services_response.rb +40 -0
  79. data/lib/gonebusy/models/get_user_by_id_response.rb +35 -0
  80. data/lib/gonebusy/models/get_users_pros_response.rb +40 -0
  81. data/lib/gonebusy/models/get_users_response.rb +40 -0
  82. data/lib/gonebusy/models/occurrence_enum.rb +22 -0
  83. data/lib/gonebusy/models/recurs_by_enum.rb +16 -0
  84. data/lib/gonebusy/models/search_query_response.rb +35 -0
  85. data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -0
  86. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -0
  87. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -0
  88. data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -0
  89. data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -0
  90. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +117 -0
  91. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -0
  92. data/lib/gonebusy/models/update_service_by_id_body.rb +89 -0
  93. data/lib/gonebusy/models/update_service_by_id_response.rb +35 -0
  94. data/lib/gonebusy/models/update_user_by_id_body.rb +89 -0
  95. data/lib/gonebusy/models/update_user_by_id_response.rb +35 -0
  96. data/lib/gonebusy.rb +105 -0
  97. metadata +186 -0
@@ -0,0 +1,13 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class DateRecursByEnum
5
+ # TODO: Write general description for DAY_IN_MONTH
6
+ # TODO: Write general description for DAY_IN_YEAR
7
+ # TODO: Write general description for DATE_IN_MONTH
8
+ # TODO: Write general description for DATE_IN_YEAR
9
+ # TODO: Write general description for DAY_IN_QUARTER
10
+ # TODO: Write general description for DATE_IN_QUARTER
11
+ DATE_RECURS_BY_ENUM = [DAY_IN_MONTH = 'day_in_month', DAY_IN_YEAR = 'day_in_year', DATE_IN_MONTH = 'date_in_month', DATE_IN_YEAR = 'date_in_year', DAY_IN_QUARTER = 'day_in_quarter', DATE_IN_QUARTER = 'date_in_quarter']
12
+ end
13
+ end
@@ -0,0 +1,35 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class DeleteResourceByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesResourceResponse]
7
+ attr_accessor :resource
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["resource"] = "resource"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(resource = nil)
19
+ @resource = resource
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
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"]
29
+
30
+ # Create object from extracted values
31
+ DeleteResourceByIdResponse.new(resource)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class DeleteScheduleByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesScheduleResponse]
7
+ attr_accessor :schedule
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["schedule"] = "schedule"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(schedule = nil)
19
+ @schedule = schedule
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
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"]
29
+
30
+ # Create object from extracted values
31
+ DeleteScheduleByIdResponse.new(schedule)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class DeleteScheduleTimeWindowByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesScheduleResponse]
7
+ attr_accessor :schedule
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["schedule"] = "schedule"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(schedule = nil)
19
+ @schedule = schedule
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
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"]
29
+
30
+ # Create object from extracted values
31
+ DeleteScheduleTimeWindowByIdResponse.new(schedule)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class DeleteServiceByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesServiceResponse]
7
+ attr_accessor :service
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["service"] = "service"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(service = nil)
19
+ @service = service
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
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"]
29
+
30
+ # Create object from extracted values
31
+ DeleteServiceByIdResponse.new(service)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,116 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesAddressEntity < BaseModel
5
+ # city of Address
6
+ # @return [String]
7
+ attr_accessor :city
8
+
9
+ # country of Address
10
+ # @return [String]
11
+ attr_accessor :country
12
+
13
+ # country code of Address
14
+ # @return [String]
15
+ attr_accessor :country_code
16
+
17
+ # latitude of Address
18
+ # @return [String]
19
+ attr_accessor :latitude
20
+
21
+ # line 1 of Address
22
+ # @return [String]
23
+ attr_accessor :line_1
24
+
25
+ # line 2 of Address
26
+ # @return [String]
27
+ attr_accessor :line_2
28
+
29
+ # longitude of Address
30
+ # @return [String]
31
+ attr_accessor :longitude
32
+
33
+ # postal code of Address
34
+ # @return [String]
35
+ attr_accessor :postal_code
36
+
37
+ # province of Address
38
+ # @return [String]
39
+ attr_accessor :province
40
+
41
+ # state of Address
42
+ # @return [String]
43
+ attr_accessor :state
44
+
45
+ # A mapping from model property names to API property names
46
+ def self.names
47
+ if @hash.nil?
48
+ @hash = {}
49
+ @hash["city"] = "city"
50
+ @hash["country"] = "country"
51
+ @hash["country_code"] = "country_code"
52
+ @hash["latitude"] = "latitude"
53
+ @hash["line_1"] = "line1"
54
+ @hash["line_2"] = "line2"
55
+ @hash["longitude"] = "longitude"
56
+ @hash["postal_code"] = "postal_code"
57
+ @hash["province"] = "province"
58
+ @hash["state"] = "state"
59
+ end
60
+ @hash
61
+ end
62
+
63
+ def initialize(city = nil,
64
+ country = nil,
65
+ country_code = nil,
66
+ latitude = nil,
67
+ line_1 = nil,
68
+ line_2 = nil,
69
+ longitude = nil,
70
+ postal_code = nil,
71
+ province = nil,
72
+ state = nil)
73
+ @city = city
74
+ @country = country
75
+ @country_code = country_code
76
+ @latitude = latitude
77
+ @line_1 = line_1
78
+ @line_2 = line_2
79
+ @longitude = longitude
80
+ @postal_code = postal_code
81
+ @province = province
82
+ @state = state
83
+ end
84
+
85
+ # Creates an instance of the object from a hash
86
+ def self.from_hash(hash)
87
+ if hash == nil
88
+ nil
89
+ else
90
+ # Extract variables from the hash
91
+ city = hash["city"]
92
+ country = hash["country"]
93
+ country_code = hash["country_code"]
94
+ latitude = hash["latitude"]
95
+ line_1 = hash["line1"]
96
+ line_2 = hash["line2"]
97
+ longitude = hash["longitude"]
98
+ postal_code = hash["postal_code"]
99
+ province = hash["province"]
100
+ state = hash["state"]
101
+
102
+ # Create object from extracted values
103
+ EntitiesAddressEntity.new(city,
104
+ country,
105
+ country_code,
106
+ latitude,
107
+ line_1,
108
+ line_2,
109
+ longitude,
110
+ postal_code,
111
+ province,
112
+ state)
113
+ end
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,58 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesAvailabilityResponse < BaseModel
5
+ # id of Service
6
+ # @return [Integer]
7
+ attr_accessor :id
8
+
9
+ # id of owner of Service
10
+ # @return [Integer]
11
+ attr_accessor :owner_id
12
+
13
+ # array of Resource ids and available time slots
14
+ # @return [List of EntitiesResourceAvailabilities]
15
+ attr_accessor :resources
16
+
17
+ # A mapping from model property names to API property names
18
+ def self.names
19
+ if @hash.nil?
20
+ @hash = {}
21
+ @hash["id"] = "id"
22
+ @hash["owner_id"] = "owner_id"
23
+ @hash["resources"] = "resources"
24
+ end
25
+ @hash
26
+ end
27
+
28
+ def initialize(id = nil,
29
+ owner_id = nil,
30
+ resources = nil)
31
+ @id = id
32
+ @owner_id = owner_id
33
+ @resources = resources
34
+ end
35
+
36
+ # Creates an instance of the object from a hash
37
+ def self.from_hash(hash)
38
+ if hash == nil
39
+ nil
40
+ else
41
+ # Extract variables from the hash
42
+ id = hash["id"]
43
+ owner_id = hash["owner_id"]
44
+ # Parameter is an array, so we need to iterate through it
45
+ resources = nil
46
+ if hash["resources"] != nil
47
+ resources = Array.new
48
+ hash["resources"].each{|structure| resources << (EntitiesResourceAvailabilities.from_hash(structure) if structure)}
49
+ end
50
+
51
+ # Create object from extracted values
52
+ EntitiesAvailabilityResponse.new(id,
53
+ owner_id,
54
+ resources)
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +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
@@ -0,0 +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