From 520a36ad12f66782ea899f50afb834a814131c6d Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Tue, 21 May 2024 21:56:19 +0200 Subject: [PATCH 1/4] Change access for default_resource_configuration --- lib/ioki/model/operator/vehicle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ioki/model/operator/vehicle.rb b/lib/ioki/model/operator/vehicle.rb index 667c2f75..e0e9a2c0 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' From c940a41c712e1608562f09289ee39d35fa78871d Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Wed, 22 May 2024 10:26:19 +0200 Subject: [PATCH 2/4] Remove deprecated attributes from Vehicle model --- lib/ioki/model/operator/vehicle.rb | 20 -------------------- spec/ioki/model/operator/vehicle_spec.rb | 4 ---- 2 files changed, 24 deletions(-) diff --git a/lib/ioki/model/operator/vehicle.rb b/lib/ioki/model/operator/vehicle.rb index e0e9a2c0..7635a5ec 100644 --- a/lib/ioki/model/operator/vehicle.rb +++ b/lib/ioki/model/operator/vehicle.rb @@ -106,26 +106,6 @@ class Vehicle < Base on: [:create, :read, :update], type: :string - deprecated_attribute :seats, - on: [:create, :read, :update], - omit_if_nil_on: [:create, :update], - type: :integer - - deprecated_attribute :storage_spaces, - on: [:create, :read, :update], - omit_if_nil_on: [:create, :update], - type: :integer - - deprecated_attribute :walker_bays, - on: [:create, :read, :update], - omit_if_nil_on: [:create, :update], - type: :integer - - deprecated_attribute :wheelchair_bays, - on: [:create, :read, :update], - omit_if_nil_on: [:create, :update], - type: :integer - attribute :telemetry, on: :read, type: :object, 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 From 749b74d788d3b292522bfa15cc36088495eb8e60 Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Wed, 22 May 2024 10:29:22 +0200 Subject: [PATCH 3/4] Also adjust Vehicle model for platform api --- lib/ioki/model/platform/vehicle.rb | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) 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 From 05d60a7d94430e4360a055f0983675da4e87ac69 Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Thu, 23 May 2024 17:47:27 +0200 Subject: [PATCH 4/4] Readd deprecated attributes --- lib/ioki/model/operator/vehicle.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/ioki/model/operator/vehicle.rb b/lib/ioki/model/operator/vehicle.rb index 7635a5ec..045ae475 100644 --- a/lib/ioki/model/operator/vehicle.rb +++ b/lib/ioki/model/operator/vehicle.rb @@ -115,6 +115,26 @@ class Vehicle < Base on: [:update, :read], omit_if_nil_on: [:update], type: :integer + + deprecated_attribute :seats, + on: [:create, :read, :update], + omit_if_nil_on: [:create, :update], + type: :integer + + deprecated_attribute :storage_spaces, + on: [:create, :read, :update], + omit_if_nil_on: [:create, :update], + type: :integer + + deprecated_attribute :walker_bays, + on: [:create, :read, :update], + omit_if_nil_on: [:create, :update], + type: :integer + + deprecated_attribute :wheelchair_bays, + on: [:create, :read, :update], + omit_if_nil_on: [:create, :update], + type: :integer end end end