Class: MetronomeSDK::Resources::V1::Contracts::NamedSchedules

Inherits:
Object
  • Object
show all
Defined in:
lib/metronome_sdk/resources/v1/contracts/named_schedules.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ NamedSchedules

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

Parameters:



77
78
79
# File 'lib/metronome_sdk/resources/v1/contracts/named_schedules.rb', line 77

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(rate_card_id: , schedule_name: , covering_date: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Contracts::NamedScheduleRetrieveResponse

Some parameter documentations has been truncated, see Models::V1::Contracts::NamedScheduleRetrieveParams for more details.

Get a named schedule for the given rate card. This endpoint’s availability is dependent on your client’s configuration.

Parameters:

  • rate_card_id (String)

    ID of the rate card whose named schedule is to be retrieved

  • schedule_name (String)

    The identifier for the schedule to be retrieved

  • covering_date (Time)

    If provided, at most one schedule segment will be returned (the one that covers

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/metronome_sdk/resources/v1/contracts/named_schedules.rb', line 28

def retrieve(params)
  parsed, options = MetronomeSDK::V1::Contracts::NamedScheduleRetrieveParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/contract-pricing/rate-cards/getNamedSchedule",
    body: parsed,
    model: MetronomeSDK::Models::V1::Contracts::NamedScheduleRetrieveResponse,
    options: options
  )
end

#update(rate_card_id: , schedule_name: , starting_at: , value: , ending_before: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::V1::Contracts::NamedScheduleUpdateParams for more details.

Update a named schedule for the given rate card. This endpoint’s availability is dependent on your client’s configuration.

Parameters:

  • rate_card_id (String)

    ID of the rate card whose named schedule is to be updated

  • schedule_name (String)

    The identifier for the schedule to be updated

  • starting_at (Time)
  • value (Object)

    The value to set for the named schedule. The structure of this object is specifi

  • ending_before (Time)
  • request_options (MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



63
64
65
66
67
68
69
70
71
72
# File 'lib/metronome_sdk/resources/v1/contracts/named_schedules.rb', line 63

def update(params)
  parsed, options = MetronomeSDK::V1::Contracts::NamedScheduleUpdateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/contract-pricing/rate-cards/updateNamedSchedule",
    body: parsed,
    model: NilClass,
    options: options
  )
end