gonebusy-ruby-client 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +1963 -0
- data/lib/gonebusy/api_helper.rb +149 -0
- data/lib/gonebusy/configuration.rb +16 -0
- data/lib/gonebusy/controllers/base_controller.rb +45 -0
- data/lib/gonebusy/controllers/bookings_controller.rb +298 -0
- data/lib/gonebusy/controllers/categories_controller.rb +180 -0
- data/lib/gonebusy/controllers/pricing_models_controller.rb +241 -0
- data/lib/gonebusy/controllers/resources_controller.rb +355 -0
- data/lib/gonebusy/controllers/schedules_controller.rb +426 -0
- data/lib/gonebusy/controllers/search_controller.rb +64 -0
- data/lib/gonebusy/controllers/services_controller.rb +367 -0
- data/lib/gonebusy/controllers/users_controller.rb +288 -0
- data/lib/gonebusy/exceptions/api_exception.rb +16 -0
- data/lib/gonebusy/exceptions/entities_error_exception.rb +27 -0
- data/lib/gonebusy/gonebusy_client.rb +58 -0
- data/lib/gonebusy/http/auth/custom_auth.rb +16 -0
- data/lib/gonebusy/http/faraday_client.rb +41 -0
- data/lib/gonebusy/http/http_call_back.rb +17 -0
- data/lib/gonebusy/http/http_client.rb +82 -0
- data/lib/gonebusy/http/http_context.rb +15 -0
- data/lib/gonebusy/http/http_method_enum.rb +7 -0
- data/lib/gonebusy/http/http_request.rb +44 -0
- data/lib/gonebusy/http/http_response.rb +19 -0
- data/lib/gonebusy/models/base_model.rb +32 -0
- data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -0
- data/lib/gonebusy/models/create_booking_body.rb +80 -0
- data/lib/gonebusy/models/create_booking_response.rb +35 -0
- data/lib/gonebusy/models/create_category_body.rb +71 -0
- data/lib/gonebusy/models/create_category_response.rb +35 -0
- data/lib/gonebusy/models/create_pricing_model_body.rb +80 -0
- data/lib/gonebusy/models/create_pricing_model_response.rb +35 -0
- data/lib/gonebusy/models/create_resource_body.rb +89 -0
- data/lib/gonebusy/models/create_resource_response.rb +35 -0
- data/lib/gonebusy/models/create_schedule_body.rb +144 -0
- data/lib/gonebusy/models/create_schedule_response.rb +35 -0
- data/lib/gonebusy/models/create_schedule_time_window_body.rb +117 -0
- data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -0
- data/lib/gonebusy/models/create_service_body.rb +98 -0
- data/lib/gonebusy/models/create_service_response.rb +35 -0
- data/lib/gonebusy/models/create_user_body.rb +89 -0
- data/lib/gonebusy/models/create_user_response.rb +35 -0
- data/lib/gonebusy/models/date_recurs_by_enum.rb +13 -0
- data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -0
- data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -0
- data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -0
- data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -0
- data/lib/gonebusy/models/entities_address_entity.rb +116 -0
- data/lib/gonebusy/models/entities_availability_response.rb +58 -0
- data/lib/gonebusy/models/entities_booking_response.rb +71 -0
- data/lib/gonebusy/models/entities_category_response.rb +98 -0
- data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -0
- data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -0
- data/lib/gonebusy/models/entities_resource_response.rb +98 -0
- data/lib/gonebusy/models/entities_schedule_response.rb +76 -0
- data/lib/gonebusy/models/entities_search_response.rb +54 -0
- data/lib/gonebusy/models/entities_service_response.rb +116 -0
- data/lib/gonebusy/models/entities_slots.rb +45 -0
- data/lib/gonebusy/models/entities_thing_type_response.rb +44 -0
- data/lib/gonebusy/models/entities_time_window_response.rb +135 -0
- data/lib/gonebusy/models/entities_user_response.rb +152 -0
- data/lib/gonebusy/models/frequency_enum.rb +18 -0
- data/lib/gonebusy/models/gender_enum.rb +10 -0
- data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_bookings_response.rb +40 -0
- data/lib/gonebusy/models/get_categories_response.rb +40 -0
- data/lib/gonebusy/models/get_category_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_pricing_models_response.rb +40 -0
- data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_resource_things_response.rb +40 -0
- data/lib/gonebusy/models/get_resources_response.rb +40 -0
- data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_schedules_response.rb +40 -0
- data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_service_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_services_response.rb +40 -0
- data/lib/gonebusy/models/get_user_by_id_response.rb +35 -0
- data/lib/gonebusy/models/get_users_pros_response.rb +40 -0
- data/lib/gonebusy/models/get_users_response.rb +40 -0
- data/lib/gonebusy/models/occurrence_enum.rb +22 -0
- data/lib/gonebusy/models/recurs_by_enum.rb +16 -0
- data/lib/gonebusy/models/search_query_response.rb +35 -0
- data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -0
- data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -0
- data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -0
- data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -0
- data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -0
- data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +117 -0
- data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -0
- data/lib/gonebusy/models/update_service_by_id_body.rb +89 -0
- data/lib/gonebusy/models/update_service_by_id_response.rb +35 -0
- data/lib/gonebusy/models/update_user_by_id_body.rb +89 -0
- data/lib/gonebusy/models/update_user_by_id_response.rb +35 -0
- data/lib/gonebusy.rb +105 -0
- metadata +186 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class GetServicesResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [List of EntitiesServiceResponse]
|
7
|
+
attr_accessor :services
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["services"] = "services"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(services = nil)
|
19
|
+
@services = services
|
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
|
+
# Parameter is an array, so we need to iterate through it
|
29
|
+
services = nil
|
30
|
+
if hash["services"] != nil
|
31
|
+
services = Array.new
|
32
|
+
hash["services"].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Create object from extracted values
|
36
|
+
GetServicesResponse.new(services)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class GetUserByIdResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [EntitiesUserResponse]
|
7
|
+
attr_accessor :user
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["user"] = "user"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(user = nil)
|
19
|
+
@user = user
|
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
|
+
user = EntitiesUserResponse.from_hash(hash["user"]) if hash["user"]
|
29
|
+
|
30
|
+
# Create object from extracted values
|
31
|
+
GetUserByIdResponse.new(user)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class GetUsersProsResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [List of EntitiesUserResponse]
|
7
|
+
attr_accessor :users
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["users"] = "users"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(users = nil)
|
19
|
+
@users = users
|
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
|
+
# Parameter is an array, so we need to iterate through it
|
29
|
+
users = nil
|
30
|
+
if hash["users"] != nil
|
31
|
+
users = Array.new
|
32
|
+
hash["users"].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Create object from extracted values
|
36
|
+
GetUsersProsResponse.new(users)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class GetUsersResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [List of EntitiesUserResponse]
|
7
|
+
attr_accessor :users
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["users"] = "users"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(users = nil)
|
19
|
+
@users = users
|
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
|
+
# Parameter is an array, so we need to iterate through it
|
29
|
+
users = nil
|
30
|
+
if hash["users"] != nil
|
31
|
+
users = Array.new
|
32
|
+
hash["users"].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Create object from extracted values
|
36
|
+
GetUsersResponse.new(users)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class OccurrenceEnum
|
5
|
+
# TODO: Write general description for ENUM_4TH_TO_LAST
|
6
|
+
# TODO: Write general description for ENUM_3RD_TO_LAST
|
7
|
+
# TODO: Write general description for ENUM_2ND_TO_LAST
|
8
|
+
# TODO: Write general description for LAST
|
9
|
+
# TODO: Write general description for EVERY
|
10
|
+
# TODO: Write general description for FIRST
|
11
|
+
# TODO: Write general description for ENUM_2ND
|
12
|
+
# TODO: Write general description for ENUM_3RD
|
13
|
+
# TODO: Write general description for ENUM_4TH
|
14
|
+
# TODO: Write general description for ENUM_5TH
|
15
|
+
# TODO: Write general description for ENUM_6TH
|
16
|
+
# TODO: Write general description for ENUM_7TH
|
17
|
+
# TODO: Write general description for ENUM_8TH
|
18
|
+
# TODO: Write general description for ENUM_9TH
|
19
|
+
# TODO: Write general description for ENUM_10TH
|
20
|
+
OCCURRENCE_ENUM = [ENUM_4TH_TO_LAST = '4th_to_last', ENUM_3RD_TO_LAST = '3rd_to_last', ENUM_2ND_TO_LAST = '2nd_to_last', LAST = 'last', EVERY = 'every', FIRST = 'first', ENUM_2ND = '2nd', ENUM_3RD = '3rd', ENUM_4TH = '4th', ENUM_5TH = '5th', ENUM_6TH = '6th', ENUM_7TH = '7th', ENUM_8TH = '8th', ENUM_9TH = '9th', ENUM_10TH = '10th']
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class RecursByEnum
|
5
|
+
# TODO: Write general description for ONCE
|
6
|
+
# TODO: Write general description for DAILY
|
7
|
+
# TODO: Write general description for WEEKEND
|
8
|
+
# TODO: Write general description for MON_WED_FRI
|
9
|
+
# TODO: Write general description for TUE_THU
|
10
|
+
# TODO: Write general description for WEEKDAY
|
11
|
+
# TODO: Write general description for WEEKLY
|
12
|
+
# TODO: Write general description for MONTHLY
|
13
|
+
# TODO: Write general description for YEARLY
|
14
|
+
RECURS_BY_ENUM = [ONCE = 'once', DAILY = 'daily', WEEKEND = 'weekend', MON_WED_FRI = 'mon_wed_fri', TUE_THU = 'tue_thu', WEEKDAY = 'weekday', WEEKLY = 'weekly', MONTHLY = 'monthly', YEARLY = 'yearly']
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class SearchQueryResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [EntitiesSearchResponse]
|
7
|
+
attr_accessor :results
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["results"] = "results"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(results = nil)
|
19
|
+
@results = results
|
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
|
+
results = EntitiesSearchResponse.from_hash(hash["results"]) if hash["results"]
|
29
|
+
|
30
|
+
# Create object from extracted values
|
31
|
+
SearchQueryResponse.new(results)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class UpdateBookingByIdResponse < 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
|
+
UpdateBookingByIdResponse.new(booking)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class UpdatePricingModelByIdBody < BaseModel
|
5
|
+
# 3 Letter ISO Currency Code
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :currency
|
8
|
+
|
9
|
+
# PricingModel Name
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :name
|
12
|
+
|
13
|
+
# Optional Notes Field
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :notes
|
16
|
+
|
17
|
+
# Price
|
18
|
+
# @return [Float]
|
19
|
+
attr_accessor :price
|
20
|
+
|
21
|
+
# A mapping from model property names to API property names
|
22
|
+
def self.names
|
23
|
+
if @hash.nil?
|
24
|
+
@hash = {}
|
25
|
+
@hash["currency"] = "currency"
|
26
|
+
@hash["name"] = "name"
|
27
|
+
@hash["notes"] = "notes"
|
28
|
+
@hash["price"] = "price"
|
29
|
+
end
|
30
|
+
@hash
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(currency = nil,
|
34
|
+
name = nil,
|
35
|
+
notes = nil,
|
36
|
+
price = nil)
|
37
|
+
@currency = currency
|
38
|
+
@name = name
|
39
|
+
@notes = notes
|
40
|
+
@price = price
|
41
|
+
end
|
42
|
+
|
43
|
+
# Creates an instance of the object from a hash
|
44
|
+
def self.from_hash(hash)
|
45
|
+
if hash == nil
|
46
|
+
nil
|
47
|
+
else
|
48
|
+
# Extract variables from the hash
|
49
|
+
currency = hash["currency"]
|
50
|
+
name = hash["name"]
|
51
|
+
notes = hash["notes"]
|
52
|
+
price = hash["price"]
|
53
|
+
|
54
|
+
# Create object from extracted values
|
55
|
+
UpdatePricingModelByIdBody.new(currency,
|
56
|
+
name,
|
57
|
+
notes,
|
58
|
+
price)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class UpdatePricingModelByIdResponse < BaseModel
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [EntitiesPricingModelResponse]
|
7
|
+
attr_accessor :pricing_models
|
8
|
+
|
9
|
+
# A mapping from model property names to API property names
|
10
|
+
def self.names
|
11
|
+
if @hash.nil?
|
12
|
+
@hash = {}
|
13
|
+
@hash["pricing_models"] = "pricing_models"
|
14
|
+
end
|
15
|
+
@hash
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(pricing_models = nil)
|
19
|
+
@pricing_models = pricing_models
|
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
|
+
pricing_models = EntitiesPricingModelResponse.from_hash(hash["pricing_models"]) if hash["pricing_models"]
|
29
|
+
|
30
|
+
# Create object from extracted values
|
31
|
+
UpdatePricingModelByIdResponse.new(pricing_models)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module Gonebusy
|
4
|
+
class UpdateResourceByIdBody < BaseModel
|
5
|
+
# Optional Capacity
|
6
|
+
# @return [Integer]
|
7
|
+
attr_accessor :capacity
|
8
|
+
|
9
|
+
# Optional Description
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :description
|
12
|
+
|
13
|
+
# Optional Gender
|
14
|
+
# @return [GenderEnum]
|
15
|
+
attr_accessor :gender
|
16
|
+
|
17
|
+
# Resource Name
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# When Resource is a Thing, the type Id
|
22
|
+
# @return [Integer]
|
23
|
+
attr_accessor :thing_type_id
|
24
|
+
|
25
|
+
# A mapping from model property names to API property names
|
26
|
+
def self.names
|
27
|
+
if @hash.nil?
|
28
|
+
@hash = {}
|
29
|
+
@hash["capacity"] = "capacity"
|
30
|
+
@hash["description"] = "description"
|
31
|
+
@hash["gender"] = "gender"
|
32
|
+
@hash["name"] = "name"
|
33
|
+
@hash["thing_type_id"] = "thing_type_id"
|
34
|
+
end
|
35
|
+
@hash
|
36
|
+
end
|
37
|
+
|
38
|
+
def initialize(capacity = nil,
|
39
|
+
description = nil,
|
40
|
+
gender = nil,
|
41
|
+
name = nil,
|
42
|
+
thing_type_id = nil)
|
43
|
+
@capacity = capacity
|
44
|
+
@description = description
|
45
|
+
@gender = gender
|
46
|
+
@name = name
|
47
|
+
@thing_type_id = thing_type_id
|
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
|
+
capacity = hash["capacity"]
|
57
|
+
description = hash["description"]
|
58
|
+
gender = hash["gender"]
|
59
|
+
name = hash["name"]
|
60
|
+
thing_type_id = hash["thing_type_id"]
|
61
|
+
|
62
|
+
# Create object from extracted values
|
63
|
+
UpdateResourceByIdBody.new(capacity,
|
64
|
+
description,
|
65
|
+
gender,
|
66
|
+
name,
|
67
|
+
thing_type_id)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|