Class: MethodRuby::Resources::Entities::Vehicles
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Entities::Vehicles
- Defined in:
- lib/method_ruby/resources/entities/vehicles.rb
Overview
Vehicle data for entities
Instance Method Summary collapse
-
#create(entity_id, body:, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VehicleCreateResponse
Some parameter documentations has been truncated, see Models::Entities::VehicleCreateParams for more details.
-
#initialize(client:) ⇒ Vehicles
constructor
private
A new instance of Vehicles.
-
#list(entity_id, method_version:, request_options: {}) ⇒ MethodRuby::Models::Entities::VehicleListResponse
Some parameter documentations has been truncated, see Models::Entities::VehicleListParams for more details.
-
#retrieve(vhl_id, entity_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Entities::VehicleRetrieveResponse
Some parameter documentations has been truncated, see Models::Entities::VehicleRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Vehicles
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Vehicles.
109 110 111 |
# File 'lib/method_ruby/resources/entities/vehicles.rb', line 109 def initialize(client:) @client = client end |
Instance Method Details
#create(entity_id, body:, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VehicleCreateResponse
Some parameter documentations has been truncated, see Models::Entities::VehicleCreateParams for more details.
Searches for vehicles associated with the specified entity.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/method_ruby/resources/entities/vehicles.rb', line 28 def create(entity_id, params) parsed, = MethodRuby::Entities::VehicleCreateParams.dump_request(params) @client.request( method: :post, path: ["entities/%1$s/vehicles", entity_id], headers: parsed.except(:body).transform_keys( method_version: "method-version", idempotency_key: "idempotency-key" ), body: parsed[:body], model: MethodRuby::Models::Entities::VehicleCreateResponse, security: {secret_key: true}, options: ) end |
#list(entity_id, method_version:, request_options: {}) ⇒ MethodRuby::Models::Entities::VehicleListResponse
Some parameter documentations has been truncated, see Models::Entities::VehicleListParams for more details.
Returns a list of vehicles for the specified entity.
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/method_ruby/resources/entities/vehicles.rb', line 94 def list(entity_id, params) parsed, = MethodRuby::Entities::VehicleListParams.dump_request(params) @client.request( method: :get, path: ["entities/%1$s/vehicles", entity_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Entities::VehicleListResponse, security: {secret_key: true}, options: ) end |
#retrieve(vhl_id, entity_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Entities::VehicleRetrieveResponse
Some parameter documentations has been truncated, see Models::Entities::VehicleRetrieveParams for more details.
Returns a single entity vehicle by its identifier.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/method_ruby/resources/entities/vehicles.rb', line 62 def retrieve(vhl_id, params) parsed, = MethodRuby::Entities::VehicleRetrieveParams.dump_request(params) entity_id = parsed.delete(:entity_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["entities/%1$s/vehicles/%2$s", entity_id, vhl_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Entities::VehicleRetrieveResponse, security: {secret_key: true}, options: ) end |