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.
- checksums.yaml +4 -4
- data/README.md +29 -68
- data/lib/gonebusy/api_helper.rb +181 -149
- data/lib/gonebusy/configuration.rb +51 -16
- data/lib/gonebusy/controllers/base_controller.rb +46 -45
- data/lib/gonebusy/controllers/bookings_controller.rb +257 -293
- data/lib/gonebusy/controllers/categories_controller.rb +151 -180
- data/lib/gonebusy/controllers/pricing_models_controller.rb +202 -241
- data/lib/gonebusy/controllers/resources_controller.rb +295 -355
- data/lib/gonebusy/controllers/schedules_controller.rb +361 -428
- data/lib/gonebusy/controllers/search_controller.rb +52 -63
- data/lib/gonebusy/controllers/services_controller.rb +310 -367
- data/lib/gonebusy/controllers/users_controller.rb +199 -239
- data/lib/gonebusy/exceptions/api_exception.rb +16 -16
- data/lib/gonebusy/exceptions/entities_error_error_exception.rb +27 -0
- data/lib/gonebusy/exceptions/entities_error_exception.rb +26 -26
- data/lib/gonebusy/gonebusy_client.rb +58 -58
- data/lib/gonebusy/http/auth/custom_auth.rb +15 -15
- data/lib/gonebusy/http/faraday_client.rb +43 -41
- data/lib/gonebusy/http/http_call_back.rb +17 -17
- data/lib/gonebusy/http/http_client.rb +84 -82
- data/lib/gonebusy/http/http_context.rb +15 -15
- data/lib/gonebusy/http/http_method_enum.rb +7 -7
- data/lib/gonebusy/http/http_request.rb +44 -44
- data/lib/gonebusy/http/http_response.rb +19 -19
- data/lib/gonebusy/models/base_model.rb +31 -31
- data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/create_booking_body.rb +134 -80
- data/lib/gonebusy/models/create_booking_response.rb +35 -35
- data/lib/gonebusy/models/create_category_body.rb +71 -71
- data/lib/gonebusy/models/create_category_response.rb +35 -35
- data/lib/gonebusy/models/create_pricing_model_body.rb +80 -80
- data/lib/gonebusy/models/create_pricing_model_response.rb +35 -35
- data/lib/gonebusy/models/create_resource_body.rb +89 -89
- data/lib/gonebusy/models/create_resource_response.rb +35 -35
- data/lib/gonebusy/models/create_schedule_body.rb +143 -144
- data/lib/gonebusy/models/create_schedule_response.rb +35 -35
- data/lib/gonebusy/models/create_schedule_time_window_body.rb +116 -117
- data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -35
- data/lib/gonebusy/models/create_service_body.rb +107 -107
- data/lib/gonebusy/models/create_service_response.rb +35 -35
- data/lib/gonebusy/models/create_user_body.rb +89 -89
- data/lib/gonebusy/models/create_user_response.rb +35 -35
- data/lib/gonebusy/models/date_recurs_by_enum.rb +12 -12
- data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -35
- data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/entities_address_entity.rb +116 -116
- data/lib/gonebusy/models/entities_availability_response.rb +58 -58
- data/lib/gonebusy/models/entities_booking_response.rb +71 -71
- data/lib/gonebusy/models/entities_category_response.rb +98 -98
- data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -89
- data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -49
- data/lib/gonebusy/models/entities_resource_response.rb +107 -107
- data/lib/gonebusy/models/entities_schedule_response.rb +76 -76
- data/lib/gonebusy/models/entities_search_response.rb +54 -54
- data/lib/gonebusy/models/entities_service_response.rb +134 -130
- data/lib/gonebusy/models/entities_slots.rb +44 -45
- data/lib/gonebusy/models/entities_thing_type_response.rb +44 -44
- data/lib/gonebusy/models/entities_time_window_response.rb +134 -135
- data/lib/gonebusy/models/entities_user_response.rb +152 -152
- data/lib/gonebusy/models/frequency_enum.rb +17 -17
- data/lib/gonebusy/models/gender_enum.rb +9 -9
- data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_bookings_response.rb +40 -40
- data/lib/gonebusy/models/get_categories_response.rb +40 -40
- data/lib/gonebusy/models/get_category_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_pricing_models_response.rb +40 -40
- data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_resource_things_response.rb +40 -40
- data/lib/gonebusy/models/get_resources_response.rb +40 -40
- data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_schedules_response.rb +40 -40
- data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_services_response.rb +40 -40
- data/lib/gonebusy/models/get_user_by_id_response.rb +35 -35
- data/lib/gonebusy/models/get_users_response.rb +40 -40
- data/lib/gonebusy/models/occurrence_enum.rb +21 -21
- data/lib/gonebusy/models/recurs_by_enum.rb +15 -15
- data/lib/gonebusy/models/search_query_response.rb +35 -35
- data/lib/gonebusy/models/update_booking_by_id_body.rb +116 -0
- data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -62
- data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -71
- data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +116 -117
- data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_service_by_id_body.rb +98 -98
- data/lib/gonebusy/models/update_service_by_id_response.rb +35 -35
- data/lib/gonebusy/models/update_user_by_id_body.rb +89 -89
- data/lib/gonebusy/models/update_user_by_id_response.rb +35 -35
- data/lib/gonebusy.rb +108 -104
- metadata +53 -17
@@ -1,54 +1,54 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class EntitiesSearchResponse < BaseModel
|
5
|
-
# array of Services matching query
|
6
|
-
# @return [List of EntitiesServiceResponse]
|
7
|
-
attr_accessor :services
|
8
|
-
|
9
|
-
# array of Users matching query
|
10
|
-
# @return [List of EntitiesUserResponse]
|
11
|
-
attr_accessor :users
|
12
|
-
|
13
|
-
# A mapping from model property names to API property names
|
14
|
-
def self.names
|
15
|
-
if @hash.nil?
|
16
|
-
@hash = {}
|
17
|
-
@hash["services"] = "services"
|
18
|
-
@hash["users"] = "users"
|
19
|
-
end
|
20
|
-
@hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(services = nil,
|
24
|
-
users = nil)
|
25
|
-
@services = services
|
26
|
-
@users = users
|
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
|
-
# Parameter is an array, so we need to iterate through it
|
36
|
-
services = nil
|
37
|
-
if hash[
|
38
|
-
services = Array.new
|
39
|
-
hash[
|
40
|
-
end
|
41
|
-
# Parameter is an array, so we need to iterate through it
|
42
|
-
users = nil
|
43
|
-
if hash[
|
44
|
-
users = Array.new
|
45
|
-
hash[
|
46
|
-
end
|
47
|
-
|
48
|
-
# Create object from extracted values
|
49
|
-
EntitiesSearchResponse.new(services,
|
50
|
-
users)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class EntitiesSearchResponse < BaseModel
|
5
|
+
# array of Services matching query
|
6
|
+
# @return [List of EntitiesServiceResponse]
|
7
|
+
attr_accessor :services
|
8
|
+
|
9
|
+
# array of Users matching query
|
10
|
+
# @return [List of EntitiesUserResponse]
|
11
|
+
attr_accessor :users
|
12
|
+
|
13
|
+
# A mapping from model property names to API property names
|
14
|
+
def self.names
|
15
|
+
if @hash.nil?
|
16
|
+
@hash = {}
|
17
|
+
@hash["services"] = "services"
|
18
|
+
@hash["users"] = "users"
|
19
|
+
end
|
20
|
+
@hash
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(services = nil,
|
24
|
+
users = nil)
|
25
|
+
@services = services
|
26
|
+
@users = users
|
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
|
+
# Parameter is an array, so we need to iterate through it
|
36
|
+
services = nil
|
37
|
+
if hash['services'] != nil
|
38
|
+
services = Array.new
|
39
|
+
hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
|
40
|
+
end
|
41
|
+
# Parameter is an array, so we need to iterate through it
|
42
|
+
users = nil
|
43
|
+
if hash['users'] != nil
|
44
|
+
users = Array.new
|
45
|
+
hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Create object from extracted values
|
49
|
+
EntitiesSearchResponse.new(services,
|
50
|
+
users)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -1,130 +1,134 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class EntitiesServiceResponse < BaseModel
|
5
|
-
# array of Category ids Service belongs to
|
6
|
-
# @return [List of Integer]
|
7
|
-
attr_accessor :categories
|
8
|
-
|
9
|
-
# description of Service
|
10
|
-
# @return [String]
|
11
|
-
attr_accessor :description
|
12
|
-
|
13
|
-
# length of Service in minutes
|
14
|
-
# @return [Integer]
|
15
|
-
attr_accessor :duration
|
16
|
-
|
17
|
-
#
|
18
|
-
# @return [Integer]
|
19
|
-
attr_accessor :
|
20
|
-
|
21
|
-
#
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
24
|
-
|
25
|
-
#
|
26
|
-
# @return [
|
27
|
-
attr_accessor :
|
28
|
-
|
29
|
-
# name of Service
|
30
|
-
# @return [String]
|
31
|
-
attr_accessor :name
|
32
|
-
|
33
|
-
# id of owner of Service
|
34
|
-
# @return [Integer]
|
35
|
-
attr_accessor :owner_id
|
36
|
-
|
37
|
-
# id of Pricing Model
|
38
|
-
# @return [Integer]
|
39
|
-
attr_accessor :price_model_id
|
40
|
-
|
41
|
-
# array of Resource ids offering Service
|
42
|
-
# @return [List of Integer]
|
43
|
-
attr_accessor :resources
|
44
|
-
|
45
|
-
#
|
46
|
-
# @return [
|
47
|
-
attr_accessor :
|
48
|
-
|
49
|
-
#
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
@hash
|
57
|
-
@hash["
|
58
|
-
@hash["
|
59
|
-
@hash["
|
60
|
-
@hash["
|
61
|
-
@hash["
|
62
|
-
@hash["
|
63
|
-
@hash["
|
64
|
-
@hash["
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
@
|
86
|
-
@
|
87
|
-
@
|
88
|
-
@
|
89
|
-
@
|
90
|
-
@
|
91
|
-
@
|
92
|
-
@
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class EntitiesServiceResponse < BaseModel
|
5
|
+
# array of Category ids Service belongs to
|
6
|
+
# @return [List of Integer]
|
7
|
+
attr_accessor :categories
|
8
|
+
|
9
|
+
# description of Service
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :description
|
12
|
+
|
13
|
+
# length of Service in minutes
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :duration
|
16
|
+
|
17
|
+
# id of Service
|
18
|
+
# @return [Integer]
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# status of Service
|
22
|
+
# @return [Boolean]
|
23
|
+
attr_accessor :is_active
|
24
|
+
|
25
|
+
# max length of Service in minutes
|
26
|
+
# @return [Integer]
|
27
|
+
attr_accessor :max_duration
|
28
|
+
|
29
|
+
# name of Service
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :name
|
32
|
+
|
33
|
+
# id of owner of Service
|
34
|
+
# @return [Integer]
|
35
|
+
attr_accessor :owner_id
|
36
|
+
|
37
|
+
# id of Pricing Model
|
38
|
+
# @return [Integer]
|
39
|
+
attr_accessor :price_model_id
|
40
|
+
|
41
|
+
# array of Resource ids offering Service
|
42
|
+
# @return [List of Integer]
|
43
|
+
attr_accessor :resources
|
44
|
+
|
45
|
+
# array of Schedule ids, one for each Resource offering Service
|
46
|
+
# @return [List of Integer]
|
47
|
+
attr_accessor :schedules
|
48
|
+
|
49
|
+
# abbreviated name for Service
|
50
|
+
# @return [String]
|
51
|
+
attr_accessor :short_name
|
52
|
+
|
53
|
+
# A mapping from model property names to API property names
|
54
|
+
def self.names
|
55
|
+
if @hash.nil?
|
56
|
+
@hash = {}
|
57
|
+
@hash["categories"] = "categories"
|
58
|
+
@hash["description"] = "description"
|
59
|
+
@hash["duration"] = "duration"
|
60
|
+
@hash["id"] = "id"
|
61
|
+
@hash["is_active"] = "is_active"
|
62
|
+
@hash["max_duration"] = "max_duration"
|
63
|
+
@hash["name"] = "name"
|
64
|
+
@hash["owner_id"] = "owner_id"
|
65
|
+
@hash["price_model_id"] = "price_model_id"
|
66
|
+
@hash["resources"] = "resources"
|
67
|
+
@hash["schedules"] = "schedules"
|
68
|
+
@hash["short_name"] = "short_name"
|
69
|
+
end
|
70
|
+
@hash
|
71
|
+
end
|
72
|
+
|
73
|
+
def initialize(categories = nil,
|
74
|
+
description = nil,
|
75
|
+
duration = nil,
|
76
|
+
id = nil,
|
77
|
+
is_active = nil,
|
78
|
+
max_duration = nil,
|
79
|
+
name = nil,
|
80
|
+
owner_id = nil,
|
81
|
+
price_model_id = nil,
|
82
|
+
resources = nil,
|
83
|
+
schedules = nil,
|
84
|
+
short_name = nil)
|
85
|
+
@categories = categories
|
86
|
+
@description = description
|
87
|
+
@duration = duration
|
88
|
+
@id = id
|
89
|
+
@is_active = is_active
|
90
|
+
@max_duration = max_duration
|
91
|
+
@name = name
|
92
|
+
@owner_id = owner_id
|
93
|
+
@price_model_id = price_model_id
|
94
|
+
@resources = resources
|
95
|
+
@schedules = schedules
|
96
|
+
@short_name = short_name
|
97
|
+
end
|
98
|
+
|
99
|
+
# Creates an instance of the object from a hash
|
100
|
+
def self.from_hash(hash)
|
101
|
+
if hash == nil
|
102
|
+
nil
|
103
|
+
else
|
104
|
+
# Extract variables from the hash
|
105
|
+
categories = hash['categories']
|
106
|
+
description = hash['description']
|
107
|
+
duration = hash['duration']
|
108
|
+
id = hash['id']
|
109
|
+
is_active = hash['is_active']
|
110
|
+
max_duration = hash['max_duration']
|
111
|
+
name = hash['name']
|
112
|
+
owner_id = hash['owner_id']
|
113
|
+
price_model_id = hash['price_model_id']
|
114
|
+
resources = hash['resources']
|
115
|
+
schedules = hash['schedules']
|
116
|
+
short_name = hash['short_name']
|
117
|
+
|
118
|
+
# Create object from extracted values
|
119
|
+
EntitiesServiceResponse.new(categories,
|
120
|
+
description,
|
121
|
+
duration,
|
122
|
+
id,
|
123
|
+
is_active,
|
124
|
+
max_duration,
|
125
|
+
name,
|
126
|
+
owner_id,
|
127
|
+
price_model_id,
|
128
|
+
resources,
|
129
|
+
schedules,
|
130
|
+
short_name)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -1,45 +1,44 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
@hash =
|
18
|
-
@hash["
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
@
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class EntitiesSlots < BaseModel
|
5
|
+
# date of availability
|
6
|
+
# @return [Date]
|
7
|
+
attr_accessor :date
|
8
|
+
|
9
|
+
# array of available time slots
|
10
|
+
# @return [List of String]
|
11
|
+
attr_accessor :slots
|
12
|
+
|
13
|
+
# A mapping from model property names to API property names
|
14
|
+
def self.names
|
15
|
+
if @hash.nil?
|
16
|
+
@hash = {}
|
17
|
+
@hash["date"] = "date"
|
18
|
+
@hash["slots"] = "slots"
|
19
|
+
end
|
20
|
+
@hash
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(date = nil,
|
24
|
+
slots = nil)
|
25
|
+
@date = date
|
26
|
+
@slots = slots
|
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
|
+
date = hash['date']
|
36
|
+
slots = hash['slots']
|
37
|
+
|
38
|
+
# Create object from extracted values
|
39
|
+
EntitiesSlots.new(date,
|
40
|
+
slots)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|