gonebusy-ruby-client 0.1.0 → 0.1.1
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/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,115 +2,113 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class EntitiesAddressEntity < BaseModel
|
5
|
-
#
|
5
|
+
# line 1 of Address
|
6
6
|
# @return [String]
|
7
|
-
attr_accessor :
|
7
|
+
attr_accessor :line_1
|
8
8
|
|
9
|
-
#
|
9
|
+
# line 2 of Address
|
10
10
|
# @return [String]
|
11
|
-
attr_accessor :
|
11
|
+
attr_accessor :line_2
|
12
12
|
|
13
|
-
#
|
13
|
+
# city of Address
|
14
14
|
# @return [String]
|
15
|
-
attr_accessor :
|
15
|
+
attr_accessor :city
|
16
16
|
|
17
|
-
#
|
17
|
+
# state of Address
|
18
18
|
# @return [String]
|
19
|
-
attr_accessor :
|
19
|
+
attr_accessor :state
|
20
20
|
|
21
|
-
#
|
21
|
+
# province of Address
|
22
22
|
# @return [String]
|
23
|
-
attr_accessor :
|
23
|
+
attr_accessor :province
|
24
24
|
|
25
|
-
#
|
25
|
+
# postal code of Address
|
26
26
|
# @return [String]
|
27
|
-
attr_accessor :
|
27
|
+
attr_accessor :postal_code
|
28
28
|
|
29
|
-
#
|
29
|
+
# country of Address
|
30
30
|
# @return [String]
|
31
|
-
attr_accessor :
|
31
|
+
attr_accessor :country
|
32
32
|
|
33
|
-
#
|
33
|
+
# country code of Address
|
34
34
|
# @return [String]
|
35
|
-
attr_accessor :
|
35
|
+
attr_accessor :country_code
|
36
36
|
|
37
|
-
#
|
37
|
+
# latitude of Address
|
38
38
|
# @return [String]
|
39
|
-
attr_accessor :
|
39
|
+
attr_accessor :latitude
|
40
40
|
|
41
|
-
#
|
41
|
+
# longitude of Address
|
42
42
|
# @return [String]
|
43
|
-
attr_accessor :
|
43
|
+
attr_accessor :longitude
|
44
44
|
|
45
45
|
# A mapping from model property names to API property names
|
46
46
|
def self.names
|
47
|
-
if @
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@
|
51
|
-
@
|
52
|
-
@
|
53
|
-
@
|
54
|
-
@
|
55
|
-
@
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
47
|
+
if @_hash.nil?
|
48
|
+
@_hash = {}
|
49
|
+
@_hash["line_1"] = "line1"
|
50
|
+
@_hash["line_2"] = "line2"
|
51
|
+
@_hash["city"] = "city"
|
52
|
+
@_hash["state"] = "state"
|
53
|
+
@_hash["province"] = "province"
|
54
|
+
@_hash["postal_code"] = "postal_code"
|
55
|
+
@_hash["country"] = "country"
|
56
|
+
@_hash["country_code"] = "country_code"
|
57
|
+
@_hash["latitude"] = "latitude"
|
58
|
+
@_hash["longitude"] = "longitude"
|
59
59
|
end
|
60
|
-
@
|
60
|
+
@_hash
|
61
61
|
end
|
62
62
|
|
63
|
-
def initialize(
|
63
|
+
def initialize(line_1 = nil,
|
64
|
+
line_2 = nil,
|
65
|
+
city = nil,
|
66
|
+
state = nil,
|
67
|
+
province = nil,
|
68
|
+
postal_code = nil,
|
64
69
|
country = nil,
|
65
70
|
country_code = nil,
|
66
71
|
latitude = nil,
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
postal_code = nil,
|
71
|
-
province = nil,
|
72
|
-
state = nil)
|
72
|
+
longitude = nil)
|
73
|
+
@line_1 = line_1
|
74
|
+
@line_2 = line_2
|
73
75
|
@city = city
|
76
|
+
@state = state
|
77
|
+
@province = province
|
78
|
+
@postal_code = postal_code
|
74
79
|
@country = country
|
75
80
|
@country_code = country_code
|
76
81
|
@latitude = latitude
|
77
|
-
@line_1 = line_1
|
78
|
-
@line_2 = line_2
|
79
82
|
@longitude = longitude
|
80
|
-
@postal_code = postal_code
|
81
|
-
@province = province
|
82
|
-
@state = state
|
83
83
|
end
|
84
84
|
|
85
85
|
# Creates an instance of the object from a hash
|
86
86
|
def self.from_hash(hash)
|
87
|
-
|
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']
|
87
|
+
return nil unless hash
|
101
88
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
89
|
+
# Extract variables from the hash
|
90
|
+
line_1 = hash['line1']
|
91
|
+
line_2 = hash['line2']
|
92
|
+
city = hash['city']
|
93
|
+
state = hash['state']
|
94
|
+
province = hash['province']
|
95
|
+
postal_code = hash['postal_code']
|
96
|
+
country = hash['country']
|
97
|
+
country_code = hash['country_code']
|
98
|
+
latitude = hash['latitude']
|
99
|
+
longitude = hash['longitude']
|
100
|
+
|
101
|
+
# Create object from extracted values
|
102
|
+
EntitiesAddressEntity.new(line_1,
|
103
|
+
line_2,
|
104
|
+
city,
|
105
|
+
state,
|
106
|
+
province,
|
107
|
+
postal_code,
|
108
|
+
country,
|
109
|
+
country_code,
|
110
|
+
latitude,
|
111
|
+
longitude)
|
114
112
|
end
|
115
113
|
end
|
116
114
|
end
|
@@ -16,13 +16,13 @@ module Gonebusy
|
|
16
16
|
|
17
17
|
# A mapping from model property names to API property names
|
18
18
|
def self.names
|
19
|
-
if @
|
20
|
-
@
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@
|
19
|
+
if @_hash.nil?
|
20
|
+
@_hash = {}
|
21
|
+
@_hash["id"] = "id"
|
22
|
+
@_hash["owner_id"] = "owner_id"
|
23
|
+
@_hash["resources"] = "resources"
|
24
24
|
end
|
25
|
-
@
|
25
|
+
@_hash
|
26
26
|
end
|
27
27
|
|
28
28
|
def initialize(id = nil,
|
@@ -35,24 +35,22 @@ module Gonebusy
|
|
35
35
|
|
36
36
|
# Creates an instance of the object from a hash
|
37
37
|
def self.from_hash(hash)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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)
|
38
|
+
return nil unless hash
|
39
|
+
|
40
|
+
# Extract variables from the hash
|
41
|
+
id = hash['id']
|
42
|
+
owner_id = hash['owner_id']
|
43
|
+
# Parameter is an array, so we need to iterate through it
|
44
|
+
resources = nil
|
45
|
+
if hash['resources'] != nil
|
46
|
+
resources = Array.new
|
47
|
+
hash['resources'].each{|structure| resources << (EntitiesResourceAvailabilities.from_hash(structure) if structure)}
|
55
48
|
end
|
49
|
+
|
50
|
+
# Create object from extracted values
|
51
|
+
EntitiesAvailabilityResponse.new(id,
|
52
|
+
owner_id,
|
53
|
+
resources)
|
56
54
|
end
|
57
55
|
end
|
58
56
|
end
|
@@ -10,62 +10,60 @@ module Gonebusy
|
|
10
10
|
# @return [Integer]
|
11
11
|
attr_accessor :owner_id
|
12
12
|
|
13
|
-
#
|
14
|
-
# @return [
|
15
|
-
attr_accessor :
|
13
|
+
# status of Booking
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :workflow_state
|
16
16
|
|
17
17
|
# user requesting Booking may include a message
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :user_message
|
20
20
|
|
21
|
-
#
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
21
|
+
# TimeWindow corresponding to Booking
|
22
|
+
# @return [EntitiesTimeWindowResponse]
|
23
|
+
attr_accessor :time_window
|
24
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["id"] = "id"
|
30
|
+
@_hash["owner_id"] = "owner_id"
|
31
|
+
@_hash["workflow_state"] = "workflow_state"
|
32
|
+
@_hash["user_message"] = "user_message"
|
33
|
+
@_hash["time_window"] = "time_window"
|
34
34
|
end
|
35
|
-
@
|
35
|
+
@_hash
|
36
36
|
end
|
37
37
|
|
38
38
|
def initialize(id = nil,
|
39
39
|
owner_id = nil,
|
40
|
-
|
40
|
+
workflow_state = nil,
|
41
41
|
user_message = nil,
|
42
|
-
|
42
|
+
time_window = nil)
|
43
43
|
@id = id
|
44
44
|
@owner_id = owner_id
|
45
|
-
@time_window = time_window
|
46
|
-
@user_message = user_message
|
47
45
|
@workflow_state = workflow_state
|
46
|
+
@user_message = user_message
|
47
|
+
@time_window = time_window
|
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
|
-
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']
|
52
|
+
return nil unless hash
|
61
53
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
54
|
+
# Extract variables from the hash
|
55
|
+
id = hash['id']
|
56
|
+
owner_id = hash['owner_id']
|
57
|
+
workflow_state = hash['workflow_state']
|
58
|
+
user_message = hash['user_message']
|
59
|
+
time_window = EntitiesTimeWindowResponse.from_hash(hash['time_window']) if hash['time_window']
|
60
|
+
|
61
|
+
# Create object from extracted values
|
62
|
+
EntitiesBookingResponse.new(id,
|
63
|
+
owner_id,
|
64
|
+
workflow_state,
|
65
|
+
user_message,
|
66
|
+
time_window)
|
69
67
|
end
|
70
68
|
end
|
71
69
|
end
|
@@ -2,33 +2,33 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class EntitiesCategoryResponse < BaseModel
|
5
|
-
# description of Category
|
6
|
-
# @return [String]
|
7
|
-
attr_accessor :description
|
8
|
-
|
9
5
|
# id of Category
|
10
6
|
# @return [Integer]
|
11
7
|
attr_accessor :id
|
12
8
|
|
13
|
-
#
|
14
|
-
# @return [
|
15
|
-
attr_accessor :
|
9
|
+
# name of Category
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :name
|
12
|
+
|
13
|
+
# abbreviated name for Category
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :short_name
|
16
16
|
|
17
17
|
# extended name for Category
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :long_name
|
20
20
|
|
21
|
-
#
|
21
|
+
# description of Category
|
22
22
|
# @return [String]
|
23
|
-
attr_accessor :
|
23
|
+
attr_accessor :description
|
24
24
|
|
25
25
|
# id of parent Category, if any
|
26
26
|
# @return [Integer]
|
27
27
|
attr_accessor :parent_category_id
|
28
28
|
|
29
|
-
#
|
30
|
-
# @return [
|
31
|
-
attr_accessor :
|
29
|
+
# status of Category
|
30
|
+
# @return [Boolean]
|
31
|
+
attr_accessor :is_active
|
32
32
|
|
33
33
|
# array of subcategory ids, if any
|
34
34
|
# @return [List of Integer]
|
@@ -36,63 +36,61 @@ module Gonebusy
|
|
36
36
|
|
37
37
|
# A mapping from model property names to API property names
|
38
38
|
def self.names
|
39
|
-
if @
|
40
|
-
@
|
41
|
-
@
|
42
|
-
@
|
43
|
-
@
|
44
|
-
@
|
45
|
-
@
|
46
|
-
@
|
47
|
-
@
|
48
|
-
@
|
39
|
+
if @_hash.nil?
|
40
|
+
@_hash = {}
|
41
|
+
@_hash["id"] = "id"
|
42
|
+
@_hash["name"] = "name"
|
43
|
+
@_hash["short_name"] = "short_name"
|
44
|
+
@_hash["long_name"] = "long_name"
|
45
|
+
@_hash["description"] = "description"
|
46
|
+
@_hash["parent_category_id"] = "parent_category_id"
|
47
|
+
@_hash["is_active"] = "is_active"
|
48
|
+
@_hash["subcategories"] = "subcategories"
|
49
49
|
end
|
50
|
-
@
|
50
|
+
@_hash
|
51
51
|
end
|
52
52
|
|
53
|
-
def initialize(
|
54
|
-
id = nil,
|
55
|
-
is_active = nil,
|
56
|
-
long_name = nil,
|
53
|
+
def initialize(id = nil,
|
57
54
|
name = nil,
|
58
|
-
parent_category_id = nil,
|
59
55
|
short_name = nil,
|
56
|
+
long_name = nil,
|
57
|
+
description = nil,
|
58
|
+
parent_category_id = nil,
|
59
|
+
is_active = nil,
|
60
60
|
subcategories = nil)
|
61
|
-
@description = description
|
62
61
|
@id = id
|
63
|
-
@is_active = is_active
|
64
|
-
@long_name = long_name
|
65
62
|
@name = name
|
66
|
-
@parent_category_id = parent_category_id
|
67
63
|
@short_name = short_name
|
64
|
+
@long_name = long_name
|
65
|
+
@description = description
|
66
|
+
@parent_category_id = parent_category_id
|
67
|
+
@is_active = is_active
|
68
68
|
@subcategories = subcategories
|
69
69
|
end
|
70
70
|
|
71
71
|
# Creates an instance of the object from a hash
|
72
72
|
def self.from_hash(hash)
|
73
|
-
|
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']
|
73
|
+
return nil unless hash
|
85
74
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
75
|
+
# Extract variables from the hash
|
76
|
+
id = hash['id']
|
77
|
+
name = hash['name']
|
78
|
+
short_name = hash['short_name']
|
79
|
+
long_name = hash['long_name']
|
80
|
+
description = hash['description']
|
81
|
+
parent_category_id = hash['parent_category_id']
|
82
|
+
is_active = hash['is_active']
|
83
|
+
subcategories = hash['subcategories']
|
84
|
+
|
85
|
+
# Create object from extracted values
|
86
|
+
EntitiesCategoryResponse.new(id,
|
87
|
+
name,
|
88
|
+
short_name,
|
89
|
+
long_name,
|
90
|
+
description,
|
91
|
+
parent_category_id,
|
92
|
+
is_active,
|
93
|
+
subcategories)
|
96
94
|
end
|
97
95
|
end
|
98
96
|
end
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
module Gonebusy
|
4
4
|
class EntitiesPricingModelResponse < BaseModel
|
5
|
-
# currency symbol, as per ISO-4217
|
6
|
-
# @return [String]
|
7
|
-
attr_accessor :currency
|
8
|
-
|
9
5
|
# id of PricingModel
|
10
6
|
# @return [Integer]
|
11
7
|
attr_accessor :id
|
12
8
|
|
9
|
+
# id of owner of PricingModel
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :owner_id
|
12
|
+
|
13
13
|
# name of PricingModel
|
14
14
|
# @return [String]
|
15
15
|
attr_accessor :name
|
@@ -18,72 +18,70 @@ module Gonebusy
|
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :notes
|
20
20
|
|
21
|
-
#
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
21
|
+
# type of PricingModel
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :pricing_model_type
|
24
24
|
|
25
25
|
# price/rate
|
26
26
|
# @return [String]
|
27
27
|
attr_accessor :price
|
28
28
|
|
29
|
-
#
|
29
|
+
# currency symbol, as per ISO-4217
|
30
30
|
# @return [String]
|
31
|
-
attr_accessor :
|
31
|
+
attr_accessor :currency
|
32
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["id"] = "id"
|
38
|
+
@_hash["owner_id"] = "owner_id"
|
39
|
+
@_hash["name"] = "name"
|
40
|
+
@_hash["notes"] = "notes"
|
41
|
+
@_hash["pricing_model_type"] = "pricing_model_type"
|
42
|
+
@_hash["price"] = "price"
|
43
|
+
@_hash["currency"] = "currency"
|
44
44
|
end
|
45
|
-
@
|
45
|
+
@_hash
|
46
46
|
end
|
47
47
|
|
48
|
-
def initialize(
|
49
|
-
|
48
|
+
def initialize(id = nil,
|
49
|
+
owner_id = nil,
|
50
50
|
name = nil,
|
51
51
|
notes = nil,
|
52
|
-
|
52
|
+
pricing_model_type = nil,
|
53
53
|
price = nil,
|
54
|
-
|
55
|
-
@currency = currency
|
54
|
+
currency = nil)
|
56
55
|
@id = id
|
56
|
+
@owner_id = owner_id
|
57
57
|
@name = name
|
58
58
|
@notes = notes
|
59
|
-
@owner_id = owner_id
|
60
|
-
@price = price
|
61
59
|
@pricing_model_type = pricing_model_type
|
60
|
+
@price = price
|
61
|
+
@currency = currency
|
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
|
-
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']
|
66
|
+
return nil unless hash
|
77
67
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
68
|
+
# Extract variables from the hash
|
69
|
+
id = hash['id']
|
70
|
+
owner_id = hash['owner_id']
|
71
|
+
name = hash['name']
|
72
|
+
notes = hash['notes']
|
73
|
+
pricing_model_type = hash['pricing_model_type']
|
74
|
+
price = hash['price']
|
75
|
+
currency = hash['currency']
|
76
|
+
|
77
|
+
# Create object from extracted values
|
78
|
+
EntitiesPricingModelResponse.new(id,
|
79
|
+
owner_id,
|
80
|
+
name,
|
81
|
+
notes,
|
82
|
+
pricing_model_type,
|
83
|
+
price,
|
84
|
+
currency)
|
87
85
|
end
|
88
86
|
end
|
89
87
|
end
|