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,15 +1,15 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class HttpContext
|
5
|
-
attr_accessor :request, :response
|
6
|
-
|
7
|
-
# The constructor.
|
8
|
-
# @param [HttpRequest] An HttpRequest object representing the HTTP request.
|
9
|
-
# @param [HttpResponse] An HttpResponse object representing the HTTP response.
|
10
|
-
def initialize(request, response)
|
11
|
-
@request = request
|
12
|
-
@response = response
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class HttpContext
|
5
|
+
attr_accessor :request, :response
|
6
|
+
|
7
|
+
# The constructor.
|
8
|
+
# @param [HttpRequest] An HttpRequest object representing the HTTP request.
|
9
|
+
# @param [HttpResponse] An HttpResponse object representing the HTTP response.
|
10
|
+
def initialize(request, response)
|
11
|
+
@request = request
|
12
|
+
@response = response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class HttpMethodEnum
|
5
|
-
HTTPMETHODENUM = [GET =
|
6
|
-
end
|
7
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class HttpMethodEnum
|
5
|
+
HTTPMETHODENUM = [GET = 'GET', POST = 'POST', PUT = 'PUT', PATCH = 'PATCH', DELETE = 'DELETE']
|
6
|
+
end
|
7
|
+
end
|
@@ -1,44 +1,44 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class HttpRequest
|
5
|
-
attr_accessor :http_method, :query_url, :headers, :parameters, :username, :password
|
6
|
-
|
7
|
-
# The constructor.
|
8
|
-
# @param [HttpMethodEnum] The HTTP method.
|
9
|
-
# @param [String] The URL to send the request to.
|
10
|
-
# @param [Hash, Optional] The headers for the HTTP Request.
|
11
|
-
# @param [Hash, Optional] The parameters for the HTTP Request.
|
12
|
-
def initialize(http_method,
|
13
|
-
query_url,
|
14
|
-
headers: {},
|
15
|
-
parameters: {})
|
16
|
-
@http_method = http_method
|
17
|
-
@query_url = query_url
|
18
|
-
@headers = headers
|
19
|
-
@parameters = parameters
|
20
|
-
end
|
21
|
-
|
22
|
-
# Add a header to the HttpRequest.
|
23
|
-
# @param [String] The name of the header.
|
24
|
-
# @param [String] The value of the header.
|
25
|
-
def add_header(name, value)
|
26
|
-
@headers[name] = value
|
27
|
-
end
|
28
|
-
|
29
|
-
# Add a parameter to the HttpRequest.
|
30
|
-
# @param [String] The name of the parameter.
|
31
|
-
# @param [String] The value of the parameter.
|
32
|
-
def add_parameter(name, value)
|
33
|
-
@parameters[name] = value
|
34
|
-
end
|
35
|
-
|
36
|
-
# Add a query parameter to the HttpRequest.
|
37
|
-
# @param [String] The name of the query parameter.
|
38
|
-
# @param [String] The value of the query parameter.
|
39
|
-
def add_query_parameter(name, value)
|
40
|
-
@query_url = APIHelper.append_url_with_query_parameters(@query_url,
|
41
|
-
@query_url = APIHelper.clean_url(@query_url)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class HttpRequest
|
5
|
+
attr_accessor :http_method, :query_url, :headers, :parameters, :username, :password
|
6
|
+
|
7
|
+
# The constructor.
|
8
|
+
# @param [HttpMethodEnum] The HTTP method.
|
9
|
+
# @param [String] The URL to send the request to.
|
10
|
+
# @param [Hash, Optional] The headers for the HTTP Request.
|
11
|
+
# @param [Hash, Optional] The parameters for the HTTP Request.
|
12
|
+
def initialize(http_method,
|
13
|
+
query_url,
|
14
|
+
headers: {},
|
15
|
+
parameters: {})
|
16
|
+
@http_method = http_method
|
17
|
+
@query_url = query_url
|
18
|
+
@headers = headers
|
19
|
+
@parameters = parameters
|
20
|
+
end
|
21
|
+
|
22
|
+
# Add a header to the HttpRequest.
|
23
|
+
# @param [String] The name of the header.
|
24
|
+
# @param [String] The value of the header.
|
25
|
+
def add_header(name, value)
|
26
|
+
@headers[name] = value
|
27
|
+
end
|
28
|
+
|
29
|
+
# Add a parameter to the HttpRequest.
|
30
|
+
# @param [String] The name of the parameter.
|
31
|
+
# @param [String] The value of the parameter.
|
32
|
+
def add_parameter(name, value)
|
33
|
+
@parameters[name] = value
|
34
|
+
end
|
35
|
+
|
36
|
+
# Add a query parameter to the HttpRequest.
|
37
|
+
# @param [String] The name of the query parameter.
|
38
|
+
# @param [String] The value of the query parameter.
|
39
|
+
def add_query_parameter(name, value)
|
40
|
+
@query_url = APIHelper.append_url_with_query_parameters(@query_url, name => value)
|
41
|
+
@query_url = APIHelper.clean_url(@query_url)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class HttpResponse
|
5
|
-
attr_accessor :status_code, :headers, :raw_body
|
6
|
-
|
7
|
-
# The constructor
|
8
|
-
# @param [Integer] The status code returned by the server.
|
9
|
-
# @param [Hash] The headers sent by the server in the response.
|
10
|
-
# @param [String] The raw body of the response.
|
11
|
-
def initialize(status_code,
|
12
|
-
headers,
|
13
|
-
raw_body)
|
14
|
-
@status_code = status_code
|
15
|
-
@headers = headers
|
16
|
-
@raw_body = raw_body
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class HttpResponse
|
5
|
+
attr_accessor :status_code, :headers, :raw_body
|
6
|
+
|
7
|
+
# The constructor
|
8
|
+
# @param [Integer] The status code returned by the server.
|
9
|
+
# @param [Hash] The headers sent by the server in the response.
|
10
|
+
# @param [String] The raw body of the response.
|
11
|
+
def initialize(status_code,
|
12
|
+
headers,
|
13
|
+
raw_body)
|
14
|
+
@status_code = status_code
|
15
|
+
@headers = headers
|
16
|
+
@raw_body = raw_body
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class BaseModel
|
5
|
-
# Returns a Hash representation of the current object
|
6
|
-
def to_hash
|
7
|
-
hash = {}
|
8
|
-
self.instance_variables.each do |name|
|
9
|
-
value = self.instance_variable_get(name)
|
10
|
-
name = name[1..-1]
|
11
|
-
key = self.class.names.key?(name) ? self.class.names[name] : name
|
12
|
-
if value.instance_of? Array
|
13
|
-
hash[key] = value.map{|v| v.kind_of?(BaseModel) ? v.to_hash : v}
|
14
|
-
elsif value.instance_of? Hash
|
15
|
-
hash[key] = {}
|
16
|
-
value.each do |k, v|
|
17
|
-
hash[key][k] = v.kind_of?(BaseModel) ? v.to_hash : v
|
18
|
-
end
|
19
|
-
else
|
20
|
-
hash[key] = value.kind_of?(BaseModel) ? value.to_hash : value
|
21
|
-
end
|
22
|
-
end
|
23
|
-
hash
|
24
|
-
end
|
25
|
-
|
26
|
-
# Returns a JSON representation of the curent object
|
27
|
-
def to_json(options = {})
|
28
|
-
hash = to_hash
|
29
|
-
hash.to_json(options)
|
30
|
-
end
|
31
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class BaseModel
|
5
|
+
# Returns a Hash representation of the current object
|
6
|
+
def to_hash
|
7
|
+
hash = {}
|
8
|
+
self.instance_variables.each do |name|
|
9
|
+
value = self.instance_variable_get(name)
|
10
|
+
name = name[1..-1]
|
11
|
+
key = self.class.names.key?(name) ? self.class.names[name] : name
|
12
|
+
if value.instance_of? Array
|
13
|
+
hash[key] = value.map{|v| v.kind_of?(BaseModel) ? v.to_hash : v}
|
14
|
+
elsif value.instance_of? Hash
|
15
|
+
hash[key] = {}
|
16
|
+
value.each do |k, v|
|
17
|
+
hash[key][k] = v.kind_of?(BaseModel) ? v.to_hash : v
|
18
|
+
end
|
19
|
+
else
|
20
|
+
hash[key] = value.kind_of?(BaseModel) ? value.to_hash : value
|
21
|
+
end
|
22
|
+
end
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a JSON representation of the curent object
|
27
|
+
def to_json(options = {})
|
28
|
+
hash = to_hash
|
29
|
+
hash.to_json(options)
|
30
|
+
end
|
31
|
+
end
|
32
32
|
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class CancelBookingByIdResponse < 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[
|
29
|
-
|
30
|
-
# Create object from extracted values
|
31
|
-
CancelBookingByIdResponse.new(booking)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class CancelBookingByIdResponse < 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
|
+
CancelBookingByIdResponse.new(booking)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,80 +1,134 @@
|
|
1
|
-
# This file was automatically generated
|
2
|
-
|
3
|
-
module Gonebusy
|
4
|
-
class CreateBookingBody < BaseModel
|
5
|
-
# Desired date of booking. Several formats are supported: "2014-10-31", "October 31, 2014"
|
6
|
-
# @return [
|
7
|
-
attr_accessor :date
|
8
|
-
|
9
|
-
# ID of Service being booked
|
10
|
-
# @return [Integer]
|
11
|
-
attr_accessor :service_id
|
12
|
-
|
13
|
-
# Desired time of booking. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
14
|
-
# @return [String]
|
15
|
-
attr_accessor :time
|
16
|
-
|
17
|
-
#
|
18
|
-
# @return [
|
19
|
-
attr_accessor :
|
20
|
-
|
21
|
-
#
|
22
|
-
# @return [
|
23
|
-
attr_accessor :
|
24
|
-
|
25
|
-
#
|
26
|
-
# @return [Integer]
|
27
|
-
attr_accessor :
|
28
|
-
|
29
|
-
#
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
resource_id =
|
68
|
-
user_id =
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
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
|
+
# ID of Service being booked
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :service_id
|
12
|
+
|
13
|
+
# Desired time of booking. Several formats are supported: '9am', '09:00', '9:00', '0900'
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :time
|
16
|
+
|
17
|
+
# Required only when :recurs_by is 'monthly' or 'yearly' to differentiate between exact date or 'day in month/year'. See Recurring Booking examples.
|
18
|
+
# @return [DateRecursByEnum]
|
19
|
+
attr_accessor :date_recurs_by
|
20
|
+
|
21
|
+
# List of comma-separated days of the week this Booking falls on. Useful for recurring Bookings. If provided, at least one must be specified.
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :days
|
24
|
+
|
25
|
+
# Length of time, in minutes, for the desired booking - if Service allows requesting a variable amount of time
|
26
|
+
# @return [Integer]
|
27
|
+
attr_accessor :duration
|
28
|
+
|
29
|
+
# Optional end date if a recurring booking - i.e, :recurs_by other than :once. If recurring, leave blank for infinite booking. Several formats are supported: '2014-10-31', 'October 31, 2014'.
|
30
|
+
# @return [Date]
|
31
|
+
attr_accessor :end_date
|
32
|
+
|
33
|
+
# Optional frequency of recurrence as specified by :recurs_by. E.g, :single, :every, :every_other, etc. If not provided, assumed to be :once
|
34
|
+
# @return [FrequencyEnum]
|
35
|
+
attr_accessor :frequency
|
36
|
+
|
37
|
+
# Optional occurrence of frequency. E.g, :first, :2nd, :last, :2nd_to_last, etc. If not provided, assumed to be :every
|
38
|
+
# @return [OccurrenceEnum]
|
39
|
+
attr_accessor :occurrence
|
40
|
+
|
41
|
+
# One of the possible recurrence values. If not provided, assumed to be :once to indicate a single Booking.
|
42
|
+
# @return [RecursByEnum]
|
43
|
+
attr_accessor :recurs_by
|
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
|
52
|
+
|
53
|
+
# A mapping from model property names to API property names
|
54
|
+
def self.names
|
55
|
+
if @hash.nil?
|
56
|
+
@hash = {}
|
57
|
+
@hash["date"] = "date"
|
58
|
+
@hash["service_id"] = "service_id"
|
59
|
+
@hash["time"] = "time"
|
60
|
+
@hash["date_recurs_by"] = "date_recurs_by"
|
61
|
+
@hash["days"] = "days"
|
62
|
+
@hash["duration"] = "duration"
|
63
|
+
@hash["end_date"] = "end_date"
|
64
|
+
@hash["frequency"] = "frequency"
|
65
|
+
@hash["occurrence"] = "occurrence"
|
66
|
+
@hash["recurs_by"] = "recurs_by"
|
67
|
+
@hash["resource_id"] = "resource_id"
|
68
|
+
@hash["user_id"] = "user_id"
|
69
|
+
end
|
70
|
+
@hash
|
71
|
+
end
|
72
|
+
|
73
|
+
def initialize(date = nil,
|
74
|
+
service_id = nil,
|
75
|
+
time = nil,
|
76
|
+
date_recurs_by = nil,
|
77
|
+
days = nil,
|
78
|
+
duration = nil,
|
79
|
+
end_date = nil,
|
80
|
+
frequency = nil,
|
81
|
+
occurrence = nil,
|
82
|
+
recurs_by = nil,
|
83
|
+
resource_id = nil,
|
84
|
+
user_id = nil)
|
85
|
+
@date = date
|
86
|
+
@service_id = service_id
|
87
|
+
@time = time
|
88
|
+
@date_recurs_by = date_recurs_by
|
89
|
+
@days = days
|
90
|
+
@duration = duration
|
91
|
+
@end_date = end_date
|
92
|
+
@frequency = frequency
|
93
|
+
@occurrence = occurrence
|
94
|
+
@recurs_by = recurs_by
|
95
|
+
@resource_id = resource_id
|
96
|
+
@user_id = user_id
|
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
|
+
date = hash['date']
|
106
|
+
service_id = hash['service_id']
|
107
|
+
time = hash['time']
|
108
|
+
date_recurs_by = hash['date_recurs_by']
|
109
|
+
days = hash['days']
|
110
|
+
duration = hash['duration']
|
111
|
+
end_date = hash['end_date']
|
112
|
+
frequency = hash['frequency']
|
113
|
+
occurrence = hash['occurrence']
|
114
|
+
recurs_by = hash['recurs_by']
|
115
|
+
resource_id = hash['resource_id']
|
116
|
+
user_id = hash['user_id']
|
117
|
+
|
118
|
+
# Create object from extracted values
|
119
|
+
CreateBookingBody.new(date,
|
120
|
+
service_id,
|
121
|
+
time,
|
122
|
+
date_recurs_by,
|
123
|
+
days,
|
124
|
+
duration,
|
125
|
+
end_date,
|
126
|
+
frequency,
|
127
|
+
occurrence,
|
128
|
+
recurs_by,
|
129
|
+
resource_id,
|
130
|
+
user_id)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|