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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +2 -1
- data/lib/gonebusy/controllers/bookings_controller.rb +77 -74
- data/lib/gonebusy/controllers/categories_controller.rb +29 -29
- data/lib/gonebusy/controllers/pricing_models_controller.rb +47 -47
- data/lib/gonebusy/controllers/resources_controller.rb +77 -77
- data/lib/gonebusy/controllers/schedules_controller.rb +92 -92
- data/lib/gonebusy/controllers/services_controller.rb +86 -86
- data/lib/gonebusy/controllers/users_controller.rb +56 -56
- data/lib/gonebusy/models/cancel_booking_by_id_response.rb +10 -12
- data/lib/gonebusy/models/create_booking_body.rb +78 -80
- data/lib/gonebusy/models/create_booking_response.rb +10 -12
- data/lib/gonebusy/models/create_category_body.rb +34 -36
- data/lib/gonebusy/models/create_category_response.rb +10 -12
- data/lib/gonebusy/models/create_pricing_model_body.rb +35 -37
- data/lib/gonebusy/models/create_pricing_model_response.rb +10 -12
- data/lib/gonebusy/models/create_resource_body.rb +39 -41
- data/lib/gonebusy/models/create_resource_response.rb +10 -12
- data/lib/gonebusy/models/create_schedule_body.rb +92 -94
- data/lib/gonebusy/models/create_schedule_response.rb +10 -12
- data/lib/gonebusy/models/create_schedule_time_window_body.rb +64 -66
- data/lib/gonebusy/models/create_schedule_time_window_response.rb +10 -12
- data/lib/gonebusy/models/create_service_body.rb +57 -59
- data/lib/gonebusy/models/create_service_response.rb +10 -12
- data/lib/gonebusy/models/create_user_body.rb +40 -42
- data/lib/gonebusy/models/create_user_response.rb +10 -12
- data/lib/gonebusy/models/delete_resource_by_id_response.rb +10 -12
- data/lib/gonebusy/models/delete_schedule_by_id_response.rb +10 -12
- data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +10 -12
- data/lib/gonebusy/models/delete_service_by_id_response.rb +10 -12
- data/lib/gonebusy/models/entities_address_entity.rb +69 -71
- data/lib/gonebusy/models/entities_availability_response.rb +21 -23
- data/lib/gonebusy/models/entities_booking_response.rb +32 -34
- data/lib/gonebusy/models/entities_category_response.rb +52 -54
- data/lib/gonebusy/models/entities_pricing_model_response.rb +44 -46
- data/lib/gonebusy/models/entities_resource_availabilities.rb +24 -26
- data/lib/gonebusy/models/entities_resource_response.rb +60 -62
- data/lib/gonebusy/models/entities_schedule_response.rb +26 -28
- data/lib/gonebusy/models/entities_search_response.rb +29 -31
- data/lib/gonebusy/models/entities_service_response.rb +82 -84
- data/lib/gonebusy/models/entities_slots.rb +13 -15
- data/lib/gonebusy/models/entities_thing_type_response.rb +13 -15
- data/lib/gonebusy/models/entities_time_window_response.rb +81 -83
- data/lib/gonebusy/models/entities_user_response.rb +95 -97
- data/lib/gonebusy/models/get_booking_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_bookings_response.rb +14 -16
- data/lib/gonebusy/models/get_categories_response.rb +14 -16
- data/lib/gonebusy/models/get_category_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_pricing_models_response.rb +14 -16
- data/lib/gonebusy/models/get_resource_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_resource_things_response.rb +14 -16
- data/lib/gonebusy/models/get_resources_response.rb +14 -16
- data/lib/gonebusy/models/get_schedule_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_schedules_response.rb +14 -16
- data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_service_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_services_response.rb +14 -16
- data/lib/gonebusy/models/get_user_by_id_response.rb +10 -12
- data/lib/gonebusy/models/get_users_response.rb +14 -16
- data/lib/gonebusy/models/search_query_response.rb +10 -12
- data/lib/gonebusy/models/update_booking_by_id_body.rb +58 -60
- data/lib/gonebusy/models/update_booking_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +28 -30
- data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_resource_by_id_body.rb +33 -35
- data/lib/gonebusy/models/update_resource_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +71 -73
- data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_service_by_id_body.rb +43 -45
- data/lib/gonebusy/models/update_service_by_id_response.rb +10 -12
- data/lib/gonebusy/models/update_user_by_id_body.rb +41 -43
- data/lib/gonebusy/models/update_user_by_id_response.rb +10 -12
- data/lib/gonebusy.rb +67 -67
- metadata +2 -3
- data/lib/gonebusy/exceptions/entities_error_exception.rb +0 -27
@@ -2,25 +2,25 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class CreateBookingBody < BaseModel
|
5
|
-
# Desired date of booking. Several formats are supported: "2014-10-31", "October 31, 2014"
|
6
|
-
# @return [Date]
|
7
|
-
attr_accessor :date
|
8
|
-
|
9
5
|
# ID of Service being booked
|
10
6
|
# @return [Integer]
|
11
7
|
attr_accessor :service_id
|
12
8
|
|
9
|
+
# Desired date of booking. Several formats are supported: "2014-10-31", "October 31, 2014"
|
10
|
+
# @return [Date]
|
11
|
+
attr_accessor :date
|
12
|
+
|
13
13
|
# Desired time of booking. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
14
14
|
# @return [String]
|
15
15
|
attr_accessor :time
|
16
16
|
|
17
|
-
#
|
18
|
-
# @return [
|
19
|
-
attr_accessor :
|
17
|
+
# Create a booking for this User Id. You must be authorized to manage this User Id.
|
18
|
+
# @return [Integer]
|
19
|
+
attr_accessor :user_id
|
20
20
|
|
21
|
-
#
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
21
|
+
# ID of a Resource to be booked. If not provided, the first available Resource will be booked.
|
22
|
+
# @return [Integer]
|
23
|
+
attr_accessor :resource_id
|
24
24
|
|
25
25
|
# Length of time, in minutes, for the desired booking - if Service allows requesting a variable amount of time
|
26
26
|
# @return [Integer]
|
@@ -30,105 +30,103 @@ module Gonebusy
|
|
30
30
|
# @return [Date]
|
31
31
|
attr_accessor :end_date
|
32
32
|
|
33
|
+
# One of the possible recurrence values. If not provided, assumed to be :once to indicate a single Booking.
|
34
|
+
# @return [RecursByEnum]
|
35
|
+
attr_accessor :recurs_by
|
36
|
+
|
33
37
|
# Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :once
|
34
38
|
# @return [FrequencyEnum]
|
35
39
|
attr_accessor :frequency
|
36
40
|
|
41
|
+
# List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :days
|
44
|
+
|
37
45
|
# Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
|
38
46
|
# @return [OccurrenceEnum]
|
39
47
|
attr_accessor :occurrence
|
40
48
|
|
41
|
-
#
|
42
|
-
# @return [
|
43
|
-
attr_accessor :
|
44
|
-
|
45
|
-
# ID of a Resource to be booked. If not provided, the first available Resource will be booked.
|
46
|
-
# @return [Integer]
|
47
|
-
attr_accessor :resource_id
|
48
|
-
|
49
|
-
# Create a booking for this User Id. You must be authorized to manage this User Id.
|
50
|
-
# @return [Integer]
|
51
|
-
attr_accessor :user_id
|
49
|
+
# Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Recurring Booking examples.
|
50
|
+
# @return [DateRecursByEnum]
|
51
|
+
attr_accessor :date_recurs_by
|
52
52
|
|
53
53
|
# A mapping from model property names to API property names
|
54
54
|
def self.names
|
55
|
-
if @
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
59
|
-
@
|
60
|
-
@
|
61
|
-
@
|
62
|
-
@
|
63
|
-
@
|
64
|
-
@
|
65
|
-
@
|
66
|
-
@
|
67
|
-
@
|
68
|
-
@
|
55
|
+
if @_hash.nil?
|
56
|
+
@_hash = {}
|
57
|
+
@_hash["service_id"] = "service_id"
|
58
|
+
@_hash["date"] = "date"
|
59
|
+
@_hash["time"] = "time"
|
60
|
+
@_hash["user_id"] = "user_id"
|
61
|
+
@_hash["resource_id"] = "resource_id"
|
62
|
+
@_hash["duration"] = "duration"
|
63
|
+
@_hash["end_date"] = "end_date"
|
64
|
+
@_hash["recurs_by"] = "recurs_by"
|
65
|
+
@_hash["frequency"] = "frequency"
|
66
|
+
@_hash["days"] = "days"
|
67
|
+
@_hash["occurrence"] = "occurrence"
|
68
|
+
@_hash["date_recurs_by"] = "date_recurs_by"
|
69
69
|
end
|
70
|
-
@
|
70
|
+
@_hash
|
71
71
|
end
|
72
72
|
|
73
|
-
def initialize(
|
74
|
-
|
73
|
+
def initialize(service_id = nil,
|
74
|
+
date = nil,
|
75
75
|
time = nil,
|
76
|
-
|
77
|
-
|
76
|
+
user_id = nil,
|
77
|
+
resource_id = nil,
|
78
78
|
duration = nil,
|
79
79
|
end_date = nil,
|
80
|
+
recurs_by = nil,
|
80
81
|
frequency = nil,
|
82
|
+
days = nil,
|
81
83
|
occurrence = nil,
|
82
|
-
|
83
|
-
resource_id = nil,
|
84
|
-
user_id = nil)
|
85
|
-
@date = date
|
84
|
+
date_recurs_by = nil)
|
86
85
|
@service_id = service_id
|
86
|
+
@date = date
|
87
87
|
@time = time
|
88
|
-
@
|
89
|
-
@
|
88
|
+
@user_id = user_id
|
89
|
+
@resource_id = resource_id
|
90
90
|
@duration = duration
|
91
91
|
@end_date = end_date
|
92
|
+
@recurs_by = recurs_by
|
92
93
|
@frequency = frequency
|
94
|
+
@days = days
|
93
95
|
@occurrence = occurrence
|
94
|
-
@
|
95
|
-
@resource_id = resource_id
|
96
|
-
@user_id = user_id
|
96
|
+
@date_recurs_by = date_recurs_by
|
97
97
|
end
|
98
98
|
|
99
99
|
# Creates an instance of the object from a hash
|
100
100
|
def self.from_hash(hash)
|
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
|
-
user_id)
|
131
|
-
end
|
101
|
+
return nil unless hash
|
102
|
+
|
103
|
+
# Extract variables from the hash
|
104
|
+
service_id = hash['service_id']
|
105
|
+
date = hash['date']
|
106
|
+
time = hash['time']
|
107
|
+
user_id = hash['user_id']
|
108
|
+
resource_id = hash['resource_id']
|
109
|
+
duration = hash['duration']
|
110
|
+
end_date = hash['end_date']
|
111
|
+
recurs_by = hash['recurs_by']
|
112
|
+
frequency = hash['frequency']
|
113
|
+
days = hash['days']
|
114
|
+
occurrence = hash['occurrence']
|
115
|
+
date_recurs_by = hash['date_recurs_by']
|
116
|
+
|
117
|
+
# Create object from extracted values
|
118
|
+
CreateBookingBody.new(service_id,
|
119
|
+
date,
|
120
|
+
time,
|
121
|
+
user_id,
|
122
|
+
resource_id,
|
123
|
+
duration,
|
124
|
+
end_date,
|
125
|
+
recurs_by,
|
126
|
+
frequency,
|
127
|
+
days,
|
128
|
+
occurrence,
|
129
|
+
date_recurs_by)
|
132
130
|
end
|
133
131
|
end
|
134
132
|
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 @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["booking"] = "booking"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(booking = 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
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
booking = EntitiesBookingResponse.from_hash(hash['booking']) if hash['booking']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
booking = EntitiesBookingResponse.from_hash(hash['booking']) if hash['booking']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
CreateBookingResponse.new(booking)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -2,13 +2,17 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class CreateCategoryBody < BaseModel
|
5
|
+
# Category Name
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :name
|
8
|
+
|
5
9
|
# Category Description
|
6
10
|
# @return [String]
|
7
11
|
attr_accessor :description
|
8
12
|
|
9
|
-
# Category
|
13
|
+
# Optional abbreviated Category name
|
10
14
|
# @return [String]
|
11
|
-
attr_accessor :
|
15
|
+
attr_accessor :short_name
|
12
16
|
|
13
17
|
# Optional full name of Category
|
14
18
|
# @return [String]
|
@@ -18,54 +22,48 @@ module Gonebusy
|
|
18
22
|
# @return [Integer]
|
19
23
|
attr_accessor :parent_category_id
|
20
24
|
|
21
|
-
# Optional abbreviated Category name
|
22
|
-
# @return [String]
|
23
|
-
attr_accessor :short_name
|
24
|
-
|
25
25
|
# A mapping from model property names to API property names
|
26
26
|
def self.names
|
27
|
-
if @
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
27
|
+
if @_hash.nil?
|
28
|
+
@_hash = {}
|
29
|
+
@_hash["name"] = "name"
|
30
|
+
@_hash["description"] = "description"
|
31
|
+
@_hash["short_name"] = "short_name"
|
32
|
+
@_hash["long_name"] = "long_name"
|
33
|
+
@_hash["parent_category_id"] = "parent_category_id"
|
34
34
|
end
|
35
|
-
@
|
35
|
+
@_hash
|
36
36
|
end
|
37
37
|
|
38
|
-
def initialize(
|
39
|
-
|
38
|
+
def initialize(name = nil,
|
39
|
+
description = nil,
|
40
|
+
short_name = nil,
|
40
41
|
long_name = nil,
|
41
|
-
parent_category_id = nil
|
42
|
-
short_name = nil)
|
43
|
-
@description = description
|
42
|
+
parent_category_id = nil)
|
44
43
|
@name = name
|
44
|
+
@description = description
|
45
|
+
@short_name = short_name
|
45
46
|
@long_name = long_name
|
46
47
|
@parent_category_id = parent_category_id
|
47
|
-
@short_name = short_name
|
48
48
|
end
|
49
49
|
|
50
50
|
# Creates an instance of the object from a hash
|
51
51
|
def self.from_hash(hash)
|
52
|
-
|
53
|
-
nil
|
54
|
-
else
|
55
|
-
# Extract variables from the hash
|
56
|
-
description = hash['description']
|
57
|
-
name = hash['name']
|
58
|
-
long_name = hash['long_name']
|
59
|
-
parent_category_id = hash['parent_category_id']
|
60
|
-
short_name = hash['short_name']
|
52
|
+
return nil unless hash
|
61
53
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
54
|
+
# Extract variables from the hash
|
55
|
+
name = hash['name']
|
56
|
+
description = hash['description']
|
57
|
+
short_name = hash['short_name']
|
58
|
+
long_name = hash['long_name']
|
59
|
+
parent_category_id = hash['parent_category_id']
|
60
|
+
|
61
|
+
# Create object from extracted values
|
62
|
+
CreateCategoryBody.new(name,
|
63
|
+
description,
|
64
|
+
short_name,
|
65
|
+
long_name,
|
66
|
+
parent_category_id)
|
69
67
|
end
|
70
68
|
end
|
71
69
|
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 @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["category"] = "category"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(category = 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
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
category = EntitiesCategoryResponse.from_hash(hash['category']) if hash['category']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
category = EntitiesCategoryResponse.from_hash(hash['category']) if hash['category']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
CreateCategoryResponse.new(category)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -10,9 +10,9 @@ module Gonebusy
|
|
10
10
|
# @return [String]
|
11
11
|
attr_accessor :type
|
12
12
|
|
13
|
-
#
|
14
|
-
# @return [
|
15
|
-
attr_accessor :
|
13
|
+
# Create a PricingModel for this User Id. You must be authorized to manage this User Id.
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :user_id
|
16
16
|
|
17
17
|
# Optional Notes Field
|
18
18
|
# @return [String]
|
@@ -22,59 +22,57 @@ module Gonebusy
|
|
22
22
|
# @return [Float]
|
23
23
|
attr_accessor :price
|
24
24
|
|
25
|
-
#
|
26
|
-
# @return [
|
27
|
-
attr_accessor :
|
25
|
+
# 3 Letter ISO Currency Code
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :currency
|
28
28
|
|
29
29
|
# A mapping from model property names to API property names
|
30
30
|
def self.names
|
31
|
-
if @
|
32
|
-
@
|
33
|
-
@
|
34
|
-
@
|
35
|
-
@
|
36
|
-
@
|
37
|
-
@
|
38
|
-
@
|
31
|
+
if @_hash.nil?
|
32
|
+
@_hash = {}
|
33
|
+
@_hash["name"] = "name"
|
34
|
+
@_hash["type"] = "type"
|
35
|
+
@_hash["user_id"] = "user_id"
|
36
|
+
@_hash["notes"] = "notes"
|
37
|
+
@_hash["price"] = "price"
|
38
|
+
@_hash["currency"] = "currency"
|
39
39
|
end
|
40
|
-
@
|
40
|
+
@_hash
|
41
41
|
end
|
42
42
|
|
43
43
|
def initialize(name = nil,
|
44
44
|
type = nil,
|
45
|
-
|
45
|
+
user_id = nil,
|
46
46
|
notes = nil,
|
47
47
|
price = nil,
|
48
|
-
|
48
|
+
currency = nil)
|
49
49
|
@name = name
|
50
50
|
@type = type
|
51
|
-
@
|
51
|
+
@user_id = user_id
|
52
52
|
@notes = notes
|
53
53
|
@price = price
|
54
|
-
@
|
54
|
+
@currency = currency
|
55
55
|
end
|
56
56
|
|
57
57
|
# Creates an instance of the object from a hash
|
58
58
|
def self.from_hash(hash)
|
59
|
-
|
60
|
-
nil
|
61
|
-
else
|
62
|
-
# Extract variables from the hash
|
63
|
-
name = hash['name']
|
64
|
-
type = hash['type']
|
65
|
-
currency = hash['currency']
|
66
|
-
notes = hash['notes']
|
67
|
-
price = hash['price']
|
68
|
-
user_id = hash['user_id']
|
59
|
+
return nil unless hash
|
69
60
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
61
|
+
# Extract variables from the hash
|
62
|
+
name = hash['name']
|
63
|
+
type = hash['type']
|
64
|
+
user_id = hash['user_id']
|
65
|
+
notes = hash['notes']
|
66
|
+
price = hash['price']
|
67
|
+
currency = hash['currency']
|
68
|
+
|
69
|
+
# Create object from extracted values
|
70
|
+
CreatePricingModelBody.new(name,
|
71
|
+
type,
|
72
|
+
user_id,
|
73
|
+
notes,
|
74
|
+
price,
|
75
|
+
currency)
|
78
76
|
end
|
79
77
|
end
|
80
78
|
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 @
|
12
|
-
@
|
13
|
-
@
|
11
|
+
if @_hash.nil?
|
12
|
+
@_hash = {}
|
13
|
+
@_hash["pricing_model"] = "pricing_model"
|
14
14
|
end
|
15
|
-
@
|
15
|
+
@_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(pricing_model = 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
|
-
|
25
|
-
nil
|
26
|
-
else
|
27
|
-
# Extract variables from the hash
|
28
|
-
pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
|
24
|
+
return nil unless hash
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
# Extract variables from the hash
|
27
|
+
pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
|
28
|
+
|
29
|
+
# Create object from extracted values
|
30
|
+
CreatePricingModelResponse.new(pricing_model)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -10,14 +10,18 @@ module Gonebusy
|
|
10
10
|
# @return [String]
|
11
11
|
attr_accessor :type
|
12
12
|
|
13
|
-
#
|
13
|
+
# Create a Resource for this User Id. You must be authorized to manage this User Id.
|
14
14
|
# @return [Integer]
|
15
|
-
attr_accessor :
|
15
|
+
attr_accessor :user_id
|
16
16
|
|
17
17
|
# Optional Description
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :description
|
20
20
|
|
21
|
+
# Optional Capacity
|
22
|
+
# @return [Integer]
|
23
|
+
attr_accessor :capacity
|
24
|
+
|
21
25
|
# Optional Gender
|
22
26
|
# @return [GenderEnum]
|
23
27
|
attr_accessor :gender
|
@@ -26,64 +30,58 @@ module Gonebusy
|
|
26
30
|
# @return [Integer]
|
27
31
|
attr_accessor :thing_type_id
|
28
32
|
|
29
|
-
# Create a Resource for this User Id. You must be authorized to manage this User Id.
|
30
|
-
# @return [Integer]
|
31
|
-
attr_accessor :user_id
|
32
|
-
|
33
33
|
# A mapping from model property names to API property names
|
34
34
|
def self.names
|
35
|
-
if @
|
36
|
-
@
|
37
|
-
@
|
38
|
-
@
|
39
|
-
@
|
40
|
-
@
|
41
|
-
@
|
42
|
-
@
|
43
|
-
@
|
35
|
+
if @_hash.nil?
|
36
|
+
@_hash = {}
|
37
|
+
@_hash["name"] = "name"
|
38
|
+
@_hash["type"] = "type"
|
39
|
+
@_hash["user_id"] = "user_id"
|
40
|
+
@_hash["description"] = "description"
|
41
|
+
@_hash["capacity"] = "capacity"
|
42
|
+
@_hash["gender"] = "gender"
|
43
|
+
@_hash["thing_type_id"] = "thing_type_id"
|
44
44
|
end
|
45
|
-
@
|
45
|
+
@_hash
|
46
46
|
end
|
47
47
|
|
48
48
|
def initialize(name = nil,
|
49
49
|
type = nil,
|
50
|
-
|
50
|
+
user_id = nil,
|
51
51
|
description = nil,
|
52
|
+
capacity = nil,
|
52
53
|
gender = nil,
|
53
|
-
thing_type_id = nil
|
54
|
-
user_id = nil)
|
54
|
+
thing_type_id = nil)
|
55
55
|
@name = name
|
56
56
|
@type = type
|
57
|
-
@
|
57
|
+
@user_id = user_id
|
58
58
|
@description = description
|
59
|
+
@capacity = capacity
|
59
60
|
@gender = gender
|
60
61
|
@thing_type_id = thing_type_id
|
61
|
-
@user_id = user_id
|
62
62
|
end
|
63
63
|
|
64
64
|
# Creates an instance of the object from a hash
|
65
65
|
def self.from_hash(hash)
|
66
|
-
|
67
|
-
nil
|
68
|
-
else
|
69
|
-
# Extract variables from the hash
|
70
|
-
name = hash['name']
|
71
|
-
type = hash['type']
|
72
|
-
capacity = hash['capacity']
|
73
|
-
description = hash['description']
|
74
|
-
gender = hash['gender']
|
75
|
-
thing_type_id = hash['thing_type_id']
|
76
|
-
user_id = hash['user_id']
|
66
|
+
return nil unless hash
|
77
67
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
68
|
+
# Extract variables from the hash
|
69
|
+
name = hash['name']
|
70
|
+
type = hash['type']
|
71
|
+
user_id = hash['user_id']
|
72
|
+
description = hash['description']
|
73
|
+
capacity = hash['capacity']
|
74
|
+
gender = hash['gender']
|
75
|
+
thing_type_id = hash['thing_type_id']
|
76
|
+
|
77
|
+
# Create object from extracted values
|
78
|
+
CreateResourceBody.new(name,
|
79
|
+
type,
|
80
|
+
user_id,
|
81
|
+
description,
|
82
|
+
capacity,
|
83
|
+
gender,
|
84
|
+
thing_type_id)
|
87
85
|
end
|
88
86
|
end
|
89
87
|
end
|