diff --git a/lib/ioki/model/operator/vehicle.rb b/lib/ioki/model/operator/vehicle.rb index 667c2f75..045ae475 100644 --- a/lib/ioki/model/operator/vehicle.rb +++ b/lib/ioki/model/operator/vehicle.rb @@ -34,7 +34,7 @@ class Vehicle < Base type: :string attribute :default_resource_configuration, - on: :read, + on: [:create, :read, :update], type: :object, class_name: 'ResourceConfiguration' @@ -106,6 +106,16 @@ class Vehicle < Base on: [:create, :read, :update], type: :string + attribute :telemetry, + on: :read, + type: :object, + class_name: 'Telemetry' + + attribute :version, + on: [:update, :read], + omit_if_nil_on: [:update], + type: :integer + deprecated_attribute :seats, on: [:create, :read, :update], omit_if_nil_on: [:create, :update], @@ -125,16 +135,6 @@ class Vehicle < Base on: [:create, :read, :update], omit_if_nil_on: [:create, :update], type: :integer - - attribute :telemetry, - on: :read, - type: :object, - class_name: 'Telemetry' - - attribute :version, - on: [:update, :read], - omit_if_nil_on: [:update], - type: :integer end end end diff --git a/lib/ioki/model/platform/vehicle.rb b/lib/ioki/model/platform/vehicle.rb index 9119510f..18b8e2f1 100644 --- a/lib/ioki/model/platform/vehicle.rb +++ b/lib/ioki/model/platform/vehicle.rb @@ -28,6 +28,11 @@ class Vehicle < Base on: :read, type: :string + attribute :default_resource_configuration, + on: [:create, :read, :update], + type: :object, + class_name: 'ResourceConfiguration' + attribute :description, on: [:read, :create, :update], type: :string @@ -70,14 +75,6 @@ class Vehicle < Base on: [:read, :create, :update], type: :string - attribute :seats, - on: [:read, :create, :update], - type: :integer - - attribute :storage_spaces, - on: [:read, :create, :update], - type: :integer - attribute :vehicle_type, on: [:read, :create, :update], type: :string @@ -85,14 +82,6 @@ class Vehicle < Base attribute :version, on: [:read, :update], type: :integer - - attribute :walker_bays, - on: [:read, :create, :update], - type: :integer - - attribute :wheelchair_bays, - on: [:read, :create, :update], - type: :integer end end end diff --git a/spec/ioki/model/operator/vehicle_spec.rb b/spec/ioki/model/operator/vehicle_spec.rb index 4972b955..a4342f69 100644 --- a/spec/ioki/model/operator/vehicle_spec.rb +++ b/spec/ioki/model/operator/vehicle_spec.rb @@ -29,9 +29,5 @@ it { is_expected.to define_attribute(:num_wheelchair_bays_as_storages).as(:integer) } it { is_expected.to define_attribute(:operator_id).as(:string) } it { is_expected.to define_attribute(:phone_number).as(:string) } - it { is_expected.to define_attribute(:seats).as(:integer) } - it { is_expected.to define_attribute(:storage_spaces).as(:integer) } - it { is_expected.to define_attribute(:walker_bays).as(:integer) } - it { is_expected.to define_attribute(:wheelchair_bays).as(:integer) } it { is_expected.to define_attribute(:telemetry).as(:object).with(class_name: 'Telemetry') } end