Class: Gonebusy::UpdateServiceByIdBody

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/gonebusy/models/update_service_by_id_body.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(categories = nil, description = nil, duration = nil, max_duration = nil, name = nil, price_model_id = nil, resources = nil, short_name = nil) ⇒ UpdateServiceByIdBody

Returns a new instance of UpdateServiceByIdBody.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 53

def initialize(categories = nil,
               description = nil,
               duration = nil,
               max_duration = nil,
               name = nil,
               price_model_id = nil,
               resources = nil,
               short_name = nil)
  @categories = categories
  @description = description
  @duration = duration
  @max_duration = max_duration
  @name = name
  @price_model_id = price_model_id
  @resources = resources
  @short_name = short_name
end

Instance Attribute Details

#categoriesString

Optional List of comma-separated Category IDs to associate with Service

Returns:



7
8
9
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 7

def categories
  @categories
end

#descriptionString

Service Description

Returns:



11
12
13
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 11

def description
  @description
end

#durationInteger

Duration of the Service in minutes

Returns:

  • (Integer)


15
16
17
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 15

def duration
  @duration
end

#max_durationInteger

Max duration of the Service in minutes

Returns:

  • (Integer)


19
20
21
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 19

def max_duration
  @max_duration
end

#nameString

Service Name

Returns:



23
24
25
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 23

def name
  @name
end

#price_model_idInteger

Optional Price Model Id

Returns:

  • (Integer)


27
28
29
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 27

def price_model_id
  @price_model_id
end

#resourcesString

Optional List of comma-separated Resource IDs that will provide this Service, default: API user’s resource id

Returns:



31
32
33
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 31

def resources
  @resources
end

#short_nameString

Optional abbreviated Service name

Returns:



35
36
37
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 35

def short_name
  @short_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 72

def self.from_hash(hash)
  if hash == nil
    nil
  else
    # Extract variables from the hash

    categories = hash["categories"]
    description = hash["description"]
    duration = hash["duration"]
    max_duration = hash["max_duration"]
    name = hash["name"]
    price_model_id = hash["price_model_id"]
    resources = hash["resources"]
    short_name = hash["short_name"]

    # Create object from extracted values

    UpdateServiceByIdBody.new(categories,
                              description,
                              duration,
                              max_duration,
                              name,
                              price_model_id,
                              resources,
                              short_name)
  end
end

.namesObject

A mapping from model property names to API property names



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gonebusy/models/update_service_by_id_body.rb', line 38

def self.names
  if @hash.nil?
    @hash = {}
    @hash["categories"] = "categories"
    @hash["description"] = "description"
    @hash["duration"] = "duration"
    @hash["max_duration"] = "max_duration"
    @hash["name"] = "name"
    @hash["price_model_id"] = "price_model_id"
    @hash["resources"] = "resources"
    @hash["short_name"] = "short_name"
  end
  @hash
end