Skip to content

Commit

Permalink
Merge pull request #207 from ioki-mobility/operator-api/add-version-t…
Browse files Browse the repository at this point in the history
…o-resources

Operator Api | Add version to resources
  • Loading branch information
tom-ioki committed May 23, 2023
2 parents 01d4278 + 5522bb5 commit cf8fbaa
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/deactivation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class Deactivation < Base
on: [:create, :read, :update],
omit_if_nil_on: [:create, :update],
type: :date_time

attribute :version,
on: [:read, :update],
type: :integer
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ioki/model/operator/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Driver < Base
type: :string

attribute :version,
on: :read,
on: [:update, :read],
type: :integer
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/matching_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class MatchingConfiguration < Base
attribute :time_window_collapse_threshold,
on: [:create, :read, :update],
type: :integer

attribute :version,
on: [:update, :read],
type: :integer
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/pause.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class Pause < Base
on: [:create, :read, :update],
omit_if_nil_on: [:read, :update],
type: :date_time

attribute :version,
on: [:update, :read],
type: :integer
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ioki/model/operator/place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Place < Base
type: :boolean

attribute :version,
on: :read,
on: [:read, :update],
type: :integer
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/station.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class Station < Base
omit_if_nil_on: [:create, :update],
type: :array

attribute :version,
on: [:read, :update],
type: :integer

attribute :walker_boarding_time,
on: [:read, :create, :update],
type: :integer
Expand Down
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/station_category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class StationCategory < Base
on: [:create, :update, :read],
omit_if_nil_on: [:create, :update],
type: :string

attribute :version,
on: [:read, :update],
type: :integer
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/ioki/model/operator/task_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class TaskList < Base
on: [:create, :read, :update],
omit_if_nil_on: [:create, :update],
type: :string

attribute :version,
on: [:read, :update],
type: :integer
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ioki/model/operator/vehicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Vehicle < Base
type: :integer

attribute :version,
on: :read,
on: [:update, :read],
type: :integer
end
end
Expand Down

0 comments on commit cf8fbaa

Please sign in to comment.