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,45 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ require 'date'
4
+ module Gonebusy
5
+ class EntitiesSlots < BaseModel
6
+ # date of availability
7
+ # @return [DateTime]
8
+ attr_accessor :date
9
+
10
+ # array of available time slots
11
+ # @return [List of String]
12
+ attr_accessor :slots
13
+
14
+ # A mapping from model property names to API property names
15
+ def self.names
16
+ if @hash.nil?
17
+ @hash = {}
18
+ @hash["date"] = "date"
19
+ @hash["slots"] = "slots"
20
+ end
21
+ @hash
22
+ end
23
+
24
+ def initialize(date = nil,
25
+ slots = nil)
26
+ @date = date
27
+ @slots = slots
28
+ end
29
+
30
+ # Creates an instance of the object from a hash
31
+ def self.from_hash(hash)
32
+ if hash == nil
33
+ nil
34
+ else
35
+ # Extract variables from the hash
36
+ date = DateTime.iso8601(hash["date"]) if hash["date"]
37
+ slots = hash["slots"]
38
+
39
+ # Create object from extracted values
40
+ EntitiesSlots.new(date,
41
+ slots)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,44 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesThingTypeResponse < BaseModel
5
+ # id of Category
6
+ # @return [Integer]
7
+ attr_accessor :id
8
+
9
+ # name of Category
10
+ # @return [String]
11
+ attr_accessor :name
12
+
13
+ # A mapping from model property names to API property names
14
+ def self.names
15
+ if @hash.nil?
16
+ @hash = {}
17
+ @hash["id"] = "id"
18
+ @hash["name"] = "name"
19
+ end
20
+ @hash
21
+ end
22
+
23
+ def initialize(id = nil,
24
+ name = nil)
25
+ @id = id
26
+ @name = name
27
+ end
28
+
29
+ # Creates an instance of the object from a hash
30
+ def self.from_hash(hash)
31
+ if hash == nil
32
+ nil
33
+ else
34
+ # Extract variables from the hash
35
+ id = hash["id"]
36
+ name = hash["name"]
37
+
38
+ # Create object from extracted values
39
+ EntitiesThingTypeResponse.new(id,
40
+ name)
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,135 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ require 'date'
4
+ module Gonebusy
5
+ class EntitiesTimeWindowResponse < BaseModel
6
+ # date_recurs_by
7
+ # @return [String]
8
+ attr_accessor :date_recurs_by
9
+
10
+ # array of days of week TimeWindow falls on
11
+ # @return [List of String]
12
+ attr_accessor :days
13
+
14
+ # end date
15
+ # @return [DateTime]
16
+ attr_accessor :end_date
17
+
18
+ # end time
19
+ # @return [String]
20
+ attr_accessor :end_time
21
+
22
+ # frequency
23
+ # @return [String]
24
+ attr_accessor :frequency
25
+
26
+ # id of TimeWindow
27
+ # @return [Integer]
28
+ attr_accessor :id
29
+
30
+ # true is available, false is unavailable
31
+ # @return [Boolean]
32
+ attr_accessor :negation
33
+
34
+ # occurrence
35
+ # @return [String]
36
+ attr_accessor :occurrence
37
+
38
+ # recurs by
39
+ # @return [String]
40
+ attr_accessor :recurs_by
41
+
42
+ # start date
43
+ # @return [DateTime]
44
+ attr_accessor :start_date
45
+
46
+ # start time
47
+ # @return [String]
48
+ attr_accessor :start_time
49
+
50
+ # total minutes spanned
51
+ # @return [Integer]
52
+ attr_accessor :total_minutes
53
+
54
+ # A mapping from model property names to API property names
55
+ def self.names
56
+ if @hash.nil?
57
+ @hash = {}
58
+ @hash["date_recurs_by"] = "date_recurs_by"
59
+ @hash["days"] = "days"
60
+ @hash["end_date"] = "end_date"
61
+ @hash["end_time"] = "end_time"
62
+ @hash["frequency"] = "frequency"
63
+ @hash["id"] = "id"
64
+ @hash["negation"] = "negation"
65
+ @hash["occurrence"] = "occurrence"
66
+ @hash["recurs_by"] = "recurs_by"
67
+ @hash["start_date"] = "start_date"
68
+ @hash["start_time"] = "start_time"
69
+ @hash["total_minutes"] = "total_minutes"
70
+ end
71
+ @hash
72
+ end
73
+
74
+ def initialize(date_recurs_by = nil,
75
+ days = nil,
76
+ end_date = nil,
77
+ end_time = nil,
78
+ frequency = nil,
79
+ id = nil,
80
+ negation = nil,
81
+ occurrence = nil,
82
+ recurs_by = nil,
83
+ start_date = nil,
84
+ start_time = nil,
85
+ total_minutes = nil)
86
+ @date_recurs_by = date_recurs_by
87
+ @days = days
88
+ @end_date = end_date
89
+ @end_time = end_time
90
+ @frequency = frequency
91
+ @id = id
92
+ @negation = negation
93
+ @occurrence = occurrence
94
+ @recurs_by = recurs_by
95
+ @start_date = start_date
96
+ @start_time = start_time
97
+ @total_minutes = total_minutes
98
+ end
99
+
100
+ # Creates an instance of the object from a hash
101
+ def self.from_hash(hash)
102
+ if hash == nil
103
+ nil
104
+ else
105
+ # Extract variables from the hash
106
+ date_recurs_by = hash["date_recurs_by"]
107
+ days = hash["days"]
108
+ end_date = DateTime.iso8601(hash["end_date"]) if hash["end_date"]
109
+ end_time = hash["end_time"]
110
+ frequency = hash["frequency"]
111
+ id = hash["id"]
112
+ negation = hash["negation"]
113
+ occurrence = hash["occurrence"]
114
+ recurs_by = hash["recurs_by"]
115
+ start_date = DateTime.iso8601(hash["start_date"]) if hash["start_date"]
116
+ start_time = hash["start_time"]
117
+ total_minutes = hash["total_minutes"]
118
+
119
+ # Create object from extracted values
120
+ EntitiesTimeWindowResponse.new(date_recurs_by,
121
+ days,
122
+ end_date,
123
+ end_time,
124
+ frequency,
125
+ id,
126
+ negation,
127
+ occurrence,
128
+ recurs_by,
129
+ start_date,
130
+ start_time,
131
+ total_minutes)
132
+ end
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,152 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesUserResponse < BaseModel
5
+ # id of Account Manager user for User
6
+ # @return [Integer]
7
+ attr_accessor :account_manager_id
8
+
9
+ # address of User
10
+ # @return [EntitiesAddressEntity]
11
+ attr_accessor :address
12
+
13
+ # business name for User
14
+ # @return [String]
15
+ attr_accessor :business_name
16
+
17
+ # status of user
18
+ # @return [Boolean]
19
+ attr_accessor :disabled
20
+
21
+ # email of User
22
+ # @return [String]
23
+ attr_accessor :email
24
+
25
+ # external url to business
26
+ # @return [String]
27
+ attr_accessor :external_url
28
+
29
+ # first name of User
30
+ # @return [String]
31
+ attr_accessor :first_name
32
+
33
+ # id of User
34
+ # @return [Integer]
35
+ attr_accessor :id
36
+
37
+ # last name of User
38
+ # @return [String]
39
+ attr_accessor :last_name
40
+
41
+ # permalink of User
42
+ # @return [String]
43
+ attr_accessor :permalink
44
+
45
+ # phone number of User
46
+ # @return [String]
47
+ attr_accessor :phone
48
+
49
+ # id of defacto Resource for User
50
+ # @return [Integer]
51
+ attr_accessor :resource_id
52
+
53
+ # User account type
54
+ # @return [String]
55
+ attr_accessor :role
56
+
57
+ # timezone of User,
58
+ # @return [String]
59
+ attr_accessor :timezone
60
+
61
+ # A mapping from model property names to API property names
62
+ def self.names
63
+ if @hash.nil?
64
+ @hash = {}
65
+ @hash["account_manager_id"] = "account_manager_id"
66
+ @hash["address"] = "address"
67
+ @hash["business_name"] = "business_name"
68
+ @hash["disabled"] = "disabled"
69
+ @hash["email"] = "email"
70
+ @hash["external_url"] = "external_url"
71
+ @hash["first_name"] = "first_name"
72
+ @hash["id"] = "id"
73
+ @hash["last_name"] = "last_name"
74
+ @hash["permalink"] = "permalink"
75
+ @hash["phone"] = "phone"
76
+ @hash["resource_id"] = "resource_id"
77
+ @hash["role"] = "role"
78
+ @hash["timezone"] = "timezone"
79
+ end
80
+ @hash
81
+ end
82
+
83
+ def initialize(account_manager_id = nil,
84
+ address = nil,
85
+ business_name = nil,
86
+ disabled = nil,
87
+ email = nil,
88
+ external_url = nil,
89
+ first_name = nil,
90
+ id = nil,
91
+ last_name = nil,
92
+ permalink = nil,
93
+ phone = nil,
94
+ resource_id = nil,
95
+ role = nil,
96
+ timezone = nil)
97
+ @account_manager_id = account_manager_id
98
+ @address = address
99
+ @business_name = business_name
100
+ @disabled = disabled
101
+ @email = email
102
+ @external_url = external_url
103
+ @first_name = first_name
104
+ @id = id
105
+ @last_name = last_name
106
+ @permalink = permalink
107
+ @phone = phone
108
+ @resource_id = resource_id
109
+ @role = role
110
+ @timezone = timezone
111
+ end
112
+
113
+ # Creates an instance of the object from a hash
114
+ def self.from_hash(hash)
115
+ if hash == nil
116
+ nil
117
+ else
118
+ # Extract variables from the hash
119
+ account_manager_id = hash["account_manager_id"]
120
+ address = EntitiesAddressEntity.from_hash(hash["address"]) if hash["address"]
121
+ business_name = hash["business_name"]
122
+ disabled = hash["disabled"]
123
+ email = hash["email"]
124
+ external_url = hash["external_url"]
125
+ first_name = hash["first_name"]
126
+ id = hash["id"]
127
+ last_name = hash["last_name"]
128
+ permalink = hash["permalink"]
129
+ phone = hash["phone"]
130
+ resource_id = hash["resource_id"]
131
+ role = hash["role"]
132
+ timezone = hash["timezone"]
133
+
134
+ # Create object from extracted values
135
+ EntitiesUserResponse.new(account_manager_id,
136
+ address,
137
+ business_name,
138
+ disabled,
139
+ email,
140
+ external_url,
141
+ first_name,
142
+ id,
143
+ last_name,
144
+ permalink,
145
+ phone,
146
+ resource_id,
147
+ role,
148
+ timezone)
149
+ end
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,18 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class FrequencyEnum
5
+ # TODO: Write general description for SINGLE
6
+ # TODO: Write general description for EVERY
7
+ # TODO: Write general description for EVERY_OTHER
8
+ # TODO: Write general description for EVERY_3RD
9
+ # TODO: Write general description for EVERY_4TH
10
+ # TODO: Write general description for EVERY_5TH
11
+ # TODO: Write general description for EVERY_6TH
12
+ # TODO: Write general description for EVERY_7TH
13
+ # TODO: Write general description for EVERY_8TH
14
+ # TODO: Write general description for EVERY_9TH
15
+ # TODO: Write general description for EVERY_10TH
16
+ FREQUENCY_ENUM = [SINGLE = 'single', EVERY = 'every', EVERY_OTHER = 'every_other', EVERY_3RD = 'every_3rd', EVERY_4TH = 'every_4th', EVERY_5TH = 'every_5th', EVERY_6TH = 'every_6th', EVERY_7TH = 'every_7th', EVERY_8TH = 'every_8th', EVERY_9TH = 'every_9th', EVERY_10TH = 'every_10th']
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class GenderEnum
5
+ # TODO: Write general description for F
6
+ # TODO: Write general description for M
7
+ # TODO: Write general description for ENUM_T/G
8
+ GENDER_ENUM = [F = 'F', M = 'M', ENUM_T/G = 'T/G']
9
+ end
10
+ 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 GetBookingByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesBookingResponse]
7
+ attr_accessor :booking
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["booking"] = "booking"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(booking = nil)
19
+ @booking = booking
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
+ booking = EntitiesBookingResponse.from_hash(hash["booking"]) if hash["booking"]
29
+
30
+ # Create object from extracted values
31
+ GetBookingByIdResponse.new(booking)
32
+ end
33
+ end
34
+ end
35
+ end