Class: DeliveryFivePostClient::Resources::Webhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery_five_post_client/resources/webhooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Webhooks

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

Parameters:



77
78
79
# File 'lib/delivery_five_post_client/resources/webhooks.rb', line 77

def initialize(client:)
  @client = client
end

Instance Method Details

#create_cargo_status(cargo_id:, change_date:, order_id:, sender_cargo_id:, status:, error_desc: nil, mile_type: nil, request_options: {}) ⇒ nil

Событие изменения статуса грузоместа / Cargo status change event

Parameters:

  • cargo_id (String) —

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

  • change_date (Time) —

    Дата изменения статуса / Status change date

  • order_id (String) —

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

  • sender_cargo_id (String) —

    ID грузоместа партнера / Partner cargo ID

  • status (String) —

    Статус грузоместа / Cargo status

  • error_desc (String) —

    Описание ошибки / Error description

  • mile_type (Symbol, DeliveryFivePostClient::Models::MileType) —

    Тип мили доставки / Delivery mile type

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

Returns:

  • (nil)

See Also:



29
30
31
32
33
34
35
36
37
38
# File 'lib/delivery_five_post_client/resources/webhooks.rb', line 29

def create_cargo_status(params)
  parsed, options = DeliveryFivePostClient::WebhookCreateCargoStatusParams.dump_request(params)
  @client.request(
    method: :post,
    path: "webhooks/cargo-status",
    body: parsed,
    model: NilClass,
    options: options
  )
end

#create_order_status(change_date:, execution_status:, order_id:, sender_order_id:, status:, error_desc: nil, mile_type: nil, request_options: {}) ⇒ nil

Событие изменения статуса заказа / Order status change event

Parameters:

  • change_date (Time) —

    Дата изменения статуса / Status change date

  • execution_status (Symbol, DeliveryFivePostClient::Models::API::V1::ExecutionStatus) —

    Статусы исполнения заказа / Order execution statuses

  • order_id (String) —

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

  • sender_order_id (String) —

    ID заказа партнера / Partner order ID

  • status (String) —

    Статус заказа / Order status

  • error_desc (String) —

    Описание ошибки / Error description

  • mile_type (Symbol, DeliveryFivePostClient::Models::MileType) —

    Тип мили доставки / Delivery mile type

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

Returns:

  • (nil)

See Also:



63
64
65
66
67
68
69
70
71
72
# File 'lib/delivery_five_post_client/resources/webhooks.rb', line 63

def create_order_status(params)
  parsed, options = DeliveryFivePostClient::WebhookCreateOrderStatusParams.dump_request(params)
  @client.request(
    method: :post,
    path: "webhooks/order-status",
    body: parsed,
    model: NilClass,
    options: options
  )
end