Class: DeliveryFivePostClient::Resources::API::V1::Tariff

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery_five_post_client/resources/api/v1/tariff.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tariff

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 Tariff.

Parameters:



45
46
47
# File 'lib/delivery_five_post_client/resources/api/v1/tariff.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#c2c(assessed_value:, from_location_id:, height:, length:, to_location_id:, weight:, width:, request_options: {}) ⇒ DeliveryFivePostClient::Models::API::V1::TariffC2cResponse

Расчет стоимости C2C доставки / Calculate C2C delivery cost

Parameters:

  • assessed_value (Float) —

    Оценочная стоимость / Assessed value

  • from_location_id (String) —

    UUID в формате v4 / UUID in v4 format

  • height (Float) —

    Высота (см) / Height

  • length (Float) —

    Длина (см) / Length

  • to_location_id (String) —

    UUID в формате v4 / UUID in v4 format

  • weight (Float) —

    Вес грузоместа (кг) / Weight

  • width (Float) —

    Ширина (см) / Width

  • request_options (DeliveryFivePostClient::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
# File 'lib/delivery_five_post_client/resources/api/v1/tariff.rb', line 31

def c2c(params)
  parsed, options = DeliveryFivePostClient::API::V1::TariffC2cParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/tariff/c2c",
    body: parsed,
    model: DeliveryFivePostClient::Models::API::V1::TariffC2cResponse,
    options: options
  )
end