Class: MetronomeSDK::Models::V1::Customers::CreditCreateParams::AccessSchedule

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/metronome_sdk/models/v1/customers/credit_create_params.rb

Defined Under Namespace

Classes: ScheduleItem

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(access_schedule: , customer_id: , priority: , product_id: , applicable_contract_ids: nil, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, name: nil, netsuite_sales_order_id: nil, rate_type: nil, salesforce_opportunity_id: nil, specifiers: nil, uniqueness_key: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see MetronomeSDK::Models::V1::Customers::CreditCreateParams for more details.

Parameters:

  • access_schedule (MetronomeSDK::Models::V1::Customers::CreditCreateParams::AccessSchedule) (defaults to: )

    Schedule for distributing the credit to the customer.

  • customer_id (String) (defaults to: )
  • priority (Float) (defaults to: )

    If multiple credits or commits are applicable, the one with the lower priority w

  • product_id (String) (defaults to: )
  • applicable_contract_ids (Array<String>) (defaults to: nil)

    Which contract the credit applies to. If not provided, the credit applies to all

  • applicable_product_ids (Array<String>) (defaults to: nil)

    Which products the credit applies to. If both applicable_product_ids and applica

  • applicable_product_tags (Array<String>) (defaults to: nil)

    Which tags the credit applies to. If both applicable*product_ids and applicable*

  • custom_fields (Hash{Symbol=>String}) (defaults to: nil)

    Custom fields to be added eg. { “key1”: “value1”, “key2”: “value2” }

  • description (String) (defaults to: nil)

    Used only in UI/API. It is not exposed to end customers.

  • name (String) (defaults to: nil)

    displayed on invoices

  • netsuite_sales_order_id (String) (defaults to: nil)

    This field’s availability is dependent on your client’s configuration.

  • rate_type (Symbol, MetronomeSDK::Models::V1::Customers::CreditCreateParams::RateType) (defaults to: nil)
  • salesforce_opportunity_id (String) (defaults to: nil)

    This field’s availability is dependent on your client’s configuration.

  • specifiers (Array<MetronomeSDK::Models::CommitSpecifierInput>) (defaults to: nil)

    List of filters that determine what kind of customer usage draws down a commit o

  • uniqueness_key (String) (defaults to: nil)

    Prevents the creation of duplicates. If a request to create a commit or credit i

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


145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/metronome_sdk/models/v1/customers/credit_create_params.rb', line 145

class AccessSchedule < MetronomeSDK::Internal::Type::BaseModel
  # @!attribute schedule_items
  #
  #   @return [Array<MetronomeSDK::Models::V1::Customers::CreditCreateParams::AccessSchedule::ScheduleItem>]
  required :schedule_items,
           -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::CreditCreateParams::AccessSchedule::ScheduleItem] }

  # @!attribute credit_type_id
  #   Defaults to USD (cents) if not passed
  #
  #   @return [String, nil]
  optional :credit_type_id, String

  # @!method initialize(schedule_items:, credit_type_id: nil)
  #   Schedule for distributing the credit to the customer.
  #
  #   @param schedule_items [Array<MetronomeSDK::Models::V1::Customers::CreditCreateParams::AccessSchedule::ScheduleItem>]
  #
  #   @param credit_type_id [String] Defaults to USD (cents) if not passed

  class ScheduleItem < MetronomeSDK::Internal::Type::BaseModel
    # @!attribute amount
    #
    #   @return [Float]
    required :amount, Float

    # @!attribute ending_before
    #   RFC 3339 timestamp (exclusive)
    #
    #   @return [Time]
    required :ending_before, Time

    # @!attribute starting_at
    #   RFC 3339 timestamp (inclusive)
    #
    #   @return [Time]
    required :starting_at, Time

    # @!method initialize(amount:, ending_before:, starting_at:)
    #   @param amount [Float]
    #
    #   @param ending_before [Time] RFC 3339 timestamp (exclusive)
    #
    #   @param starting_at [Time] RFC 3339 timestamp (inclusive)
  end
end

Instance Attribute Details

#credit_type_idString?

Defaults to USD (cents) if not passed

Returns:

  • (String, nil)


156
# File 'lib/metronome_sdk/models/v1/customers/credit_create_params.rb', line 156

optional :credit_type_id, String

#schedule_itemsArray<MetronomeSDK::Models::V1::Customers::CreditCreateParams::AccessSchedule::ScheduleItem>



149
150
# File 'lib/metronome_sdk/models/v1/customers/credit_create_params.rb', line 149

required :schedule_items,
-> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::CreditCreateParams::AccessSchedule::ScheduleItem] }