gonebusy-ruby-client 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,49 +1,49 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class EntitiesResourceAvailabilities < BaseModel
|
5
|
-
# array of available date and time slots
|
6
|
-
# @return [List of EntitiesSlots]
|
7
|
-
attr_accessor :available_slots
|
8
|
-
|
9
|
-
# id of Resource
|
10
|
-
# @return [Integer]
|
11
|
-
attr_accessor :id
|
12
|
-
|
13
|
-
# A mapping from model property names to API property names
|
14
|
-
def self.names
|
15
|
-
if @hash.nil?
|
16
|
-
@hash = {}
|
17
|
-
@hash["available_slots"] = "available_slots"
|
18
|
-
@hash["id"] = "id"
|
19
|
-
end
|
20
|
-
@hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(available_slots = nil,
|
24
|
-
id = nil)
|
25
|
-
@available_slots = available_slots
|
26
|
-
@id = id
|
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
|
-
available_slots = nil
|
37
|
-
if hash[
|
38
|
-
available_slots = Array.new
|
39
|
-
hash[
|
40
|
-
end
|
41
|
-
id = hash[
|
42
|
-
|
43
|
-
# Create object from extracted values
|
44
|
-
EntitiesResourceAvailabilities.new(available_slots,
|
45
|
-
id)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class EntitiesResourceAvailabilities < BaseModel
|
5
|
+
# array of available date and time slots
|
6
|
+
# @return [List of EntitiesSlots]
|
7
|
+
attr_accessor :available_slots
|
8
|
+
|
9
|
+
# id of Resource
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :id
|
12
|
+
|
13
|
+
# A mapping from model property names to API property names
|
14
|
+
def self.names
|
15
|
+
if @hash.nil?
|
16
|
+
@hash = {}
|
17
|
+
@hash["available_slots"] = "available_slots"
|
18
|
+
@hash["id"] = "id"
|
19
|
+
end
|
20
|
+
@hash
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(available_slots = nil,
|
24
|
+
id = nil)
|
25
|
+
@available_slots = available_slots
|
26
|
+
@id = id
|
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
|
+
available_slots = nil
|
37
|
+
if hash['available_slots'] != nil
|
38
|
+
available_slots = Array.new
|
39
|
+
hash['available_slots'].each{|structure| available_slots << (EntitiesSlots.from_hash(structure) if structure)}
|
40
|
+
end
|
41
|
+
id = hash['id']
|
42
|
+
|
43
|
+
# Create object from extracted values
|
44
|
+
EntitiesResourceAvailabilities.new(available_slots,
|
45
|
+
id)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -1,107 +1,107 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class EntitiesResourceResponse < BaseModel
|
5
|
-
# capacity of Resource, if applicable
|
6
|
-
# @return [Integer]
|
7
|
-
attr_accessor :capacity
|
8
|
-
|
9
|
-
# description of Resource
|
10
|
-
# @return [String]
|
11
|
-
attr_accessor :description
|
12
|
-
|
13
|
-
# gender of Resource, if applicable
|
14
|
-
# @return [String]
|
15
|
-
attr_accessor :gender
|
16
|
-
|
17
|
-
# id of Resource
|
18
|
-
# @return [Integer]
|
19
|
-
attr_accessor :id
|
20
|
-
|
21
|
-
# name of Resource
|
22
|
-
# @return [String]
|
23
|
-
attr_accessor :name
|
24
|
-
|
25
|
-
# id of User owning Resource
|
26
|
-
# @return [Integer]
|
27
|
-
attr_accessor :owner_id
|
28
|
-
|
29
|
-
# if Calendar is primary, if applicable
|
30
|
-
# @return [Boolean]
|
31
|
-
attr_accessor :primary_cal
|
32
|
-
|
33
|
-
# type of Resource
|
34
|
-
# @return [String]
|
35
|
-
attr_accessor :resource_type
|
36
|
-
|
37
|
-
# type Id of Thing Resource, if applicable
|
38
|
-
# @return [Integer]
|
39
|
-
attr_accessor :thing_type_id
|
40
|
-
|
41
|
-
# A mapping from model property names to API property names
|
42
|
-
def self.names
|
43
|
-
if @hash.nil?
|
44
|
-
@hash = {}
|
45
|
-
@hash["capacity"] = "capacity"
|
46
|
-
@hash["description"] = "description"
|
47
|
-
@hash["gender"] = "gender"
|
48
|
-
@hash["id"] = "id"
|
49
|
-
@hash["name"] = "name"
|
50
|
-
@hash["owner_id"] = "owner_id"
|
51
|
-
@hash["primary_cal"] = "primary_cal"
|
52
|
-
@hash["resource_type"] = "resource_type"
|
53
|
-
@hash["thing_type_id"] = "thing_type_id"
|
54
|
-
end
|
55
|
-
@hash
|
56
|
-
end
|
57
|
-
|
58
|
-
def initialize(capacity = nil,
|
59
|
-
description = nil,
|
60
|
-
gender = nil,
|
61
|
-
id = nil,
|
62
|
-
name = nil,
|
63
|
-
owner_id = nil,
|
64
|
-
primary_cal = nil,
|
65
|
-
resource_type = nil,
|
66
|
-
thing_type_id = nil)
|
67
|
-
@capacity = capacity
|
68
|
-
@description = description
|
69
|
-
@gender = gender
|
70
|
-
@id = id
|
71
|
-
@name = name
|
72
|
-
@owner_id = owner_id
|
73
|
-
@primary_cal = primary_cal
|
74
|
-
@resource_type = resource_type
|
75
|
-
@thing_type_id = thing_type_id
|
76
|
-
end
|
77
|
-
|
78
|
-
# Creates an instance of the object from a hash
|
79
|
-
def self.from_hash(hash)
|
80
|
-
if hash == nil
|
81
|
-
nil
|
82
|
-
else
|
83
|
-
# Extract variables from the hash
|
84
|
-
capacity = hash[
|
85
|
-
description = hash[
|
86
|
-
gender = hash[
|
87
|
-
id = hash[
|
88
|
-
name = hash[
|
89
|
-
owner_id = hash[
|
90
|
-
primary_cal = hash[
|
91
|
-
resource_type = hash[
|
92
|
-
thing_type_id = hash[
|
93
|
-
|
94
|
-
# Create object from extracted values
|
95
|
-
EntitiesResourceResponse.new(capacity,
|
96
|
-
description,
|
97
|
-
gender,
|
98
|
-
id,
|
99
|
-
name,
|
100
|
-
owner_id,
|
101
|
-
primary_cal,
|
102
|
-
resource_type,
|
103
|
-
thing_type_id)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class EntitiesResourceResponse < BaseModel
|
5
|
+
# capacity of Resource, if applicable
|
6
|
+
# @return [Integer]
|
7
|
+
attr_accessor :capacity
|
8
|
+
|
9
|
+
# description of Resource
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :description
|
12
|
+
|
13
|
+
# gender of Resource, if applicable
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :gender
|
16
|
+
|
17
|
+
# id of Resource
|
18
|
+
# @return [Integer]
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# name of Resource
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :name
|
24
|
+
|
25
|
+
# id of User owning Resource
|
26
|
+
# @return [Integer]
|
27
|
+
attr_accessor :owner_id
|
28
|
+
|
29
|
+
# if Calendar is primary, if applicable
|
30
|
+
# @return [Boolean]
|
31
|
+
attr_accessor :primary_cal
|
32
|
+
|
33
|
+
# type of Resource
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :resource_type
|
36
|
+
|
37
|
+
# type Id of Thing Resource, if applicable
|
38
|
+
# @return [Integer]
|
39
|
+
attr_accessor :thing_type_id
|
40
|
+
|
41
|
+
# A mapping from model property names to API property names
|
42
|
+
def self.names
|
43
|
+
if @hash.nil?
|
44
|
+
@hash = {}
|
45
|
+
@hash["capacity"] = "capacity"
|
46
|
+
@hash["description"] = "description"
|
47
|
+
@hash["gender"] = "gender"
|
48
|
+
@hash["id"] = "id"
|
49
|
+
@hash["name"] = "name"
|
50
|
+
@hash["owner_id"] = "owner_id"
|
51
|
+
@hash["primary_cal"] = "primary_cal"
|
52
|
+
@hash["resource_type"] = "resource_type"
|
53
|
+
@hash["thing_type_id"] = "thing_type_id"
|
54
|
+
end
|
55
|
+
@hash
|
56
|
+
end
|
57
|
+
|
58
|
+
def initialize(capacity = nil,
|
59
|
+
description = nil,
|
60
|
+
gender = nil,
|
61
|
+
id = nil,
|
62
|
+
name = nil,
|
63
|
+
owner_id = nil,
|
64
|
+
primary_cal = nil,
|
65
|
+
resource_type = nil,
|
66
|
+
thing_type_id = nil)
|
67
|
+
@capacity = capacity
|
68
|
+
@description = description
|
69
|
+
@gender = gender
|
70
|
+
@id = id
|
71
|
+
@name = name
|
72
|
+
@owner_id = owner_id
|
73
|
+
@primary_cal = primary_cal
|
74
|
+
@resource_type = resource_type
|
75
|
+
@thing_type_id = thing_type_id
|
76
|
+
end
|
77
|
+
|
78
|
+
# Creates an instance of the object from a hash
|
79
|
+
def self.from_hash(hash)
|
80
|
+
if hash == nil
|
81
|
+
nil
|
82
|
+
else
|
83
|
+
# Extract variables from the hash
|
84
|
+
capacity = hash['capacity']
|
85
|
+
description = hash['description']
|
86
|
+
gender = hash['gender']
|
87
|
+
id = hash['id']
|
88
|
+
name = hash['name']
|
89
|
+
owner_id = hash['owner_id']
|
90
|
+
primary_cal = hash['primary_cal']
|
91
|
+
resource_type = hash['resource_type']
|
92
|
+
thing_type_id = hash['thing_type_id']
|
93
|
+
|
94
|
+
# Create object from extracted values
|
95
|
+
EntitiesResourceResponse.new(capacity,
|
96
|
+
description,
|
97
|
+
gender,
|
98
|
+
id,
|
99
|
+
name,
|
100
|
+
owner_id,
|
101
|
+
primary_cal,
|
102
|
+
resource_type,
|
103
|
+
thing_type_id)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -1,76 +1,76 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class EntitiesScheduleResponse < BaseModel
|
5
|
-
# id of Schedule
|
6
|
-
# @return [Integer]
|
7
|
-
attr_accessor :id
|
8
|
-
|
9
|
-
# id of owner of Schedule
|
10
|
-
# @return [Integer]
|
11
|
-
attr_accessor :owner_id
|
12
|
-
|
13
|
-
# id of Resource
|
14
|
-
# @return [Integer]
|
15
|
-
attr_accessor :resource_id
|
16
|
-
|
17
|
-
# id of Service
|
18
|
-
# @return [Integer]
|
19
|
-
attr_accessor :service_id
|
20
|
-
|
21
|
-
# array of TimeWindows making up Schedule
|
22
|
-
# @return [List of EntitiesTimeWindowResponse]
|
23
|
-
attr_accessor :time_windows
|
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["resource_id"] = "resource_id"
|
32
|
-
@hash["service_id"] = "service_id"
|
33
|
-
@hash["time_windows"] = "time_windows"
|
34
|
-
end
|
35
|
-
@hash
|
36
|
-
end
|
37
|
-
|
38
|
-
def initialize(id = nil,
|
39
|
-
owner_id = nil,
|
40
|
-
resource_id = nil,
|
41
|
-
service_id = nil,
|
42
|
-
time_windows = nil)
|
43
|
-
@id = id
|
44
|
-
@owner_id = owner_id
|
45
|
-
@resource_id = resource_id
|
46
|
-
@service_id = service_id
|
47
|
-
@time_windows = time_windows
|
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[
|
57
|
-
owner_id = hash[
|
58
|
-
resource_id = hash[
|
59
|
-
service_id = hash[
|
60
|
-
# Parameter is an array, so we need to iterate through it
|
61
|
-
time_windows = nil
|
62
|
-
if hash[
|
63
|
-
time_windows = Array.new
|
64
|
-
hash[
|
65
|
-
end
|
66
|
-
|
67
|
-
# Create object from extracted values
|
68
|
-
EntitiesScheduleResponse.new(id,
|
69
|
-
owner_id,
|
70
|
-
resource_id,
|
71
|
-
service_id,
|
72
|
-
time_windows)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class EntitiesScheduleResponse < BaseModel
|
5
|
+
# id of Schedule
|
6
|
+
# @return [Integer]
|
7
|
+
attr_accessor :id
|
8
|
+
|
9
|
+
# id of owner of Schedule
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :owner_id
|
12
|
+
|
13
|
+
# id of Resource
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :resource_id
|
16
|
+
|
17
|
+
# id of Service
|
18
|
+
# @return [Integer]
|
19
|
+
attr_accessor :service_id
|
20
|
+
|
21
|
+
# array of TimeWindows making up Schedule
|
22
|
+
# @return [List of EntitiesTimeWindowResponse]
|
23
|
+
attr_accessor :time_windows
|
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["resource_id"] = "resource_id"
|
32
|
+
@hash["service_id"] = "service_id"
|
33
|
+
@hash["time_windows"] = "time_windows"
|
34
|
+
end
|
35
|
+
@hash
|
36
|
+
end
|
37
|
+
|
38
|
+
def initialize(id = nil,
|
39
|
+
owner_id = nil,
|
40
|
+
resource_id = nil,
|
41
|
+
service_id = nil,
|
42
|
+
time_windows = nil)
|
43
|
+
@id = id
|
44
|
+
@owner_id = owner_id
|
45
|
+
@resource_id = resource_id
|
46
|
+
@service_id = service_id
|
47
|
+
@time_windows = time_windows
|
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
|
+
resource_id = hash['resource_id']
|
59
|
+
service_id = hash['service_id']
|
60
|
+
# Parameter is an array, so we need to iterate through it
|
61
|
+
time_windows = nil
|
62
|
+
if hash['time_windows'] != nil
|
63
|
+
time_windows = Array.new
|
64
|
+
hash['time_windows'].each{|structure| time_windows << (EntitiesTimeWindowResponse.from_hash(structure) if structure)}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Create object from extracted values
|
68
|
+
EntitiesScheduleResponse.new(id,
|
69
|
+
owner_id,
|
70
|
+
resource_id,
|
71
|
+
service_id,
|
72
|
+
time_windows)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|