Class: WhenIWork::Shift

Inherits:
Object
  • Object
show all
Includes:
Response
Defined in:
lib/wheniwork-ruby/models/shift.rb

Instance Attribute Summary collapse

Attributes included from Response

#raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Response

#_deserialize, #_to_hash, #build_from_hash, #eql?, #to_body, #to_hash, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ Shift

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/wheniwork-ruby/models/shift.rb', line 82

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'start_time')
    self.start_time = attributes[:'start_time']
  end

  if attributes.has_key?(:'end_time')
    self.end_time = attributes[:'end_time']
  end

  if attributes.has_key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.has_key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end

  if attributes.has_key?(:'notified_at')
    self.notified_at = attributes[:'notified_at']
  end

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'account_id')
    self. = attributes[:'account_id']
  end

  if attributes.has_key?(:'user_id')
    self.user_id = attributes[:'user_id']
  end

  if attributes.has_key?(:'location_id')
    self.location_id = attributes[:'location_id']
  end

  if attributes.has_key?(:'alerted')
    self.alerted = attributes[:'alerted']
  end

  if attributes.has_key?(:'is_open')
    self.is_open = attributes[:'is_open']
  end

  if attributes.has_key?(:'acknowledged')
    self.acknowledged = attributes[:'acknowledged']
  end

  if attributes.has_key?(:'notes')
    self.notes = attributes[:'notes']
  end

end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



34
35
36
# File 'lib/wheniwork-ruby/models/shift.rb', line 34

def 
  @account_id
end

#acknowledgedObject

Returns the value of attribute acknowledged.



39
40
41
# File 'lib/wheniwork-ruby/models/shift.rb', line 39

def acknowledged
  @acknowledged
end

#alertedObject

Returns the value of attribute alerted.



37
38
39
# File 'lib/wheniwork-ruby/models/shift.rb', line 37

def alerted
  @alerted
end

#created_atObject

Returns the value of attribute created_at.



30
31
32
# File 'lib/wheniwork-ruby/models/shift.rb', line 30

def created_at
  @created_at
end

#end_timeObject

Returns the value of attribute end_time.



29
30
31
# File 'lib/wheniwork-ruby/models/shift.rb', line 29

def end_time
  @end_time
end

#idObject

Returns the value of attribute id.



33
34
35
# File 'lib/wheniwork-ruby/models/shift.rb', line 33

def id
  @id
end

#is_openObject

Returns the value of attribute is_open.



38
39
40
# File 'lib/wheniwork-ruby/models/shift.rb', line 38

def is_open
  @is_open
end

#location_idObject

Returns the value of attribute location_id.



36
37
38
# File 'lib/wheniwork-ruby/models/shift.rb', line 36

def location_id
  @location_id
end

#notesObject

Returns the value of attribute notes.



40
41
42
# File 'lib/wheniwork-ruby/models/shift.rb', line 40

def notes
  @notes
end

#notified_atObject

Returns the value of attribute notified_at.



32
33
34
# File 'lib/wheniwork-ruby/models/shift.rb', line 32

def notified_at
  @notified_at
end

#start_timeObject

Returns the value of attribute start_time.



28
29
30
# File 'lib/wheniwork-ruby/models/shift.rb', line 28

def start_time
  @start_time
end

#updated_atObject

Returns the value of attribute updated_at.



31
32
33
# File 'lib/wheniwork-ruby/models/shift.rb', line 31

def updated_at
  @updated_at
end

#user_idObject

Returns the value of attribute user_id.



35
36
37
# File 'lib/wheniwork-ruby/models/shift.rb', line 35

def user_id
  @user_id
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/wheniwork-ruby/models/shift.rb', line 43

def self.attribute_map
  {
    :'start_time' => :'start_time',
    :'end_time' => :'end_time',
    :'created_at' => :'created_at',
    :'updated_at' => :'updated_at',
    :'notified_at' => :'notified_at',
    :'id' => :'id',
    :'account_id' => :'account_id',
    :'user_id' => :'user_id',
    :'location_id' => :'location_id',
    :'alerted' => :'alerted',
    :'is_open' => :'is_open',
    :'acknowledged' => :'acknowledged',
    :'notes' => :'notes'
  }
end

.swagger_typesObject

Attribute type mapping.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/wheniwork-ruby/models/shift.rb', line 62

def self.swagger_types
  {
    :'start_time' => :'DateTime',
    :'end_time' => :'DateTime',
    :'created_at' => :'DateTime',
    :'updated_at' => :'DateTime',
    :'notified_at' => :'DateTime',
    :'id' => :'Integer',
    :'account_id' => :'Integer',
    :'user_id' => :'Integer',
    :'location_id' => :'Integer',
    :'alerted' => :'BOOLEAN',
    :'is_open' => :'BOOLEAN',
    :'acknowledged' => :'Integer',
    :'notes' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/wheniwork-ruby/models/shift.rb', line 156

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      start_time == o.start_time &&
      end_time == o.end_time &&
      created_at == o.created_at &&
      updated_at == o.updated_at &&
      notified_at == o.notified_at &&
      id == o.id &&
       == o. &&
      user_id == o.user_id &&
      location_id == o.location_id &&
      alerted == o.alerted &&
      is_open == o.is_open &&
      acknowledged == o.acknowledged &&
      notes == o.notes
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



176
177
178
# File 'lib/wheniwork-ruby/models/shift.rb', line 176

def hash
  [start_time, end_time, created_at, updated_at, notified_at, id, , user_id, location_id, alerted, is_open, acknowledged, notes].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



144
145
146
147
# File 'lib/wheniwork-ruby/models/shift.rb', line 144

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



151
152
# File 'lib/wheniwork-ruby/models/shift.rb', line 151

def valid?
end